Slow network and dropped connections: how to test your app on 3G
In the office on Wi-Fi, the screen opens in a second. On the subway, in an elevator or out of town, the connection breaks halfway, goes silent or drags images in a kilobyte at a time. You don’t need to ride the subway for these conditions: chaos in Microkoi Bench slows down and breaks the phone’s connection right at your desk, on one endpoint you pick. Below: which failures to turn on and what to watch in the app.
How a bad network differs from a server error
A server error comes with a status code: 503, 500, 429. The app gets a response and decides what to show. On a bad network, there’s no response at all: the connection dropped, went silent or delivered half the body. App code handles these cases separately from HTTP errors, and they break most often.
- The loading indicator spins forever because no timeout is set.
- The app crashes while parsing JSON that wasn’t fully read.
- The list arrives in pieces, and the screen shows “Nothing found”.
- A photo upload breaks off, and the listing draft is lost.
Network throttling in the phone’s settings slows everything at once, including requests you aren’t testing right now. Chaos in Bench affects only the requests a rule picks.
The phone through the Bench proxy
Chaos works in the Bench proxy, so the phone’s traffic has to go through it, with HTTPS decrypted: chaos doesn’t touch connections without decryption. Setting up the proxy and the certificate on iPhone and Android is covered in “How to inspect your app’s HTTPS traffic on iPhone and Android”.
Example: a real estate listings app with a list of apartments and photos from GET api.example.com/. A rule for the api.example.com/ branch is added from the “Endpoints” tree: hover over the branch, click “⋯” and choose “Chaos”. How profiles and rules work is covered in “Chaos engineering for a mobile app: where to start”.
Drop, hang, cut body
The “Network” block does to the connection what the subway does to it. In the “Failures” row, you select one or more kinds of failure, and each time a random one is picked.
| Failure | What Bench does | What it tests |
|---|---|---|
| Drop | Closes the connection, no response | A network message and retry |
| Hang | Holds the connection and stays silent | The app’s timeout |
| Cut body | Sends the headers and half the body | Parsing a partially read response |
- Select the
api.example.com/rule in the “Chaos” window. If it has a delay turned on, turn off the “Delay” block.v1/ listings/ ** - Turn on the “Network” block, probability 20% in the block header.
- In the “Failures” row, keep “Drop” and select “Hang” and “Cut body”. In the “When” row, keep “Before server”.
- Turn on the rule and “Apply chaos”, then click “Done”.
“Hang” holds the connection for 60 seconds. The “Hang for” field changes this from 1 to 120 seconds: if the app waits longer, Bench drops the connection itself. “Cut body” always fires after the server responds: before the server, there’s nothing to cut.
How to read a failure in the traffic
Find a disrupted exchange by the first narrow column of the table: every exchange chaos touched has an orange lightning bolt there, and for server responses the column is empty. “Chaos” in the “Show only” group of “Filters” leaves only such exchanges in the list. What the column’s other icons mean is covered in the same chaos engineering article.
A dropped exchange shows “drop” in the status column in chaos orange. A hanging exchange appears in the list right away, with “hang” and a running count of seconds waited. When the app stops waiting, the row becomes final.
The most useful part is the line above the response in the exchange panel. If the app closed the connection before Bench did, it names the app’s timeout: “The app gave up after …” and how many of the 60 seconds it waited. That’s the app’s real timeout, measured without a debugger. If the line says Bench held the connection for the full 60 seconds, the request has no timeout.
A cut body keeps the server’s status code, and the tooltip says how much got through: “Body cut by Bench chaos after 24 KB of 48 KB”. The response tabs show the part of the body the app received.
3G, Edge and bad Wi-Fi
The “Speed” block limits the transfer rate in both directions and adds network latency. The response arrives in pieces, as on a mobile network, instead of all at once after a pause.
| Network | ↓ to the app | ↑ to the server | Latency |
|---|---|---|---|
| Edge | 30 KB/s | 15 KB/s | 500 ms |
| 3G | 150 KB/s | 50 KB/s | 250 ms |
| Slow 4G | 400 KB/s | 100 KB/s | 150 ms |
| Bad Wi-Fi | 125 KB/s | 60 KB/s | 200 ms |
Turn on the “Speed” block in the apartment feed rule. “3G” is already selected in the “Network” row. Every feed response now reaches the app at 150 KB/s, and the total exchange time in the traffic grows honestly. The lightning bolt in the first column of such an exchange says “Speed limited · 3G”, and the status code stays real.
For photo uploads, set the “↑” field to 20 KB/s: the network becomes “Custom”. In the same rule, turn on “Network” with the “Cut body” failure: half the response arrives slowly, then the connection drops. That’s what driving into a tunnel looks like. Such an exchange has one lightning bolt, and its tooltip names both disruptions: the cut body and the speed limit.
What to check in the app
| Condition | What to expect from the app |
|---|---|
| Drop | A network message and “Retry”, the previous data stays in place |
| Hang | A message after 15–30 seconds, not an endless spinner |
| Cut body | The parse error is handled, the app doesn’t crash |
| 3G on the feed | The indicator moves, photos appear as they load |
| Leaving the screen | The request is canceled, no extra requests in the traffic |
Request cancellation is visible in the traffic too. If the app closed the connection during a chaos delay, the exchange is recorded as failed with the reason “the client closed the connection during the chaos delay”. No such row after leaving the screen means the request kept going.
What chaos doesn’t touch
- WebSockets: chaos slows down only regular HTTP exchanges.
- Hosts excluded in the “Recording” settings: their traffic bypasses chaos.
- Connections without HTTPS decryption.
And one quirk of HTTP/1.1: requests on one connection go one after another, so a delay also holds up the next requests on it. With HTTP/2, streams don’t wait for each other, and a drop resets only its own stream.
Run the heaviest screen of your app on “Edge” and with dropped connections, and write to beta@microkoi.com about what turned up and which network conditions were missing. We read every email.