Skip to content

Throttling

Throttling lets you simulate slow or unreliable network conditions so you can test how your app behaves under poor connectivity. Slow down downloads, add latency, or randomly drop requests to reproduce real-world network issues.

Throttle View

How Throttling Works

When throttling is enabled, Madhyamas delays or limits traffic passing through the proxy according to your settings. The traffic still reaches its destination — just slower. This helps you:

  • Test loading states and progress indicators
  • Verify timeout handling
  • Reproduce issues that only happen on slow connections
  • Test offline behavior and retry logic

Throttle Settings

SettingDescription
Download SpeedMaximum download speed in bytes per second (e.g., 50000 = 50 KB/s)
Upload SpeedMaximum upload speed in bytes per second
LatencyAdded delay before each request in milliseconds
Packet LossPercentage of requests to randomly drop (0–100%)

Throttle Presets

Madhyamas includes common network profiles so you don't have to configure settings manually:

PresetDownloadUploadLatencyUse Case
No throttlingUnlimitedUnlimited0msNormal conditions
Slow 3G50 KB/s20 KB/s200msMobile edge networks
Fast 3G180 KB/s84 KB/s150ms3G mobile
Regular 4G4 MB/s3 MB/s50msStandard 4G LTE
Slow Wi-Fi500 KB/s500 KB/s20msPoor Wi-Fi
Offline00No connectivity

To apply a preset, click it in the presets list. The settings update automatically.

Enabling and Disabling

Throttling is off by default. To turn it on:

  1. Navigate to the Throttle view
  2. Choose a preset or configure custom settings
  3. Toggle the Enabled switch

When enabled, all traffic through the proxy is affected. Toggle it off to return to normal speed.

Common Use Cases

Testing Loading Indicators

Set throttle to "Slow 3G" and load your app. Verify that loading spinners, skeleton screens, and progress bars appear and behave correctly.

Testing Timeouts

Set a high latency (e.g., 5000ms) and verify that your app's HTTP client times out gracefully instead of hanging indefinitely.

Testing Retry Logic

Enable packet loss (e.g., 30%) and verify that your app retries failed requests with exponential backoff.

Testing Offline Mode

Use the "Offline" preset to verify that your app shows appropriate offline messages and caches data correctly.

Reproducing Mobile Issues

Use "Slow 3G" or "Fast 3G" presets to reproduce bugs that only appear on mobile networks but not on your fast development machine.

See also

Released under the MIT OR Apache-2.0 License.