I'm trying to send about 100,000 requests in one minute using Python 3 and asyncio. My connection previously had roughly 25 Mbps upload and download, so I upgraded to a 1 Gbps connection, but the request rate barely changed. I suspect the bottleneck may be my router, ISP, computer, or implementation. What should I measure and change to identify the limiting factor? This is for a system I'm authorized to test.
3 Answers
Bandwidth probably isn’t the main limitation. The result depends on payload size, protocol, connection reuse, latency, server capacity, rate limits, and how the asyncio code manages concurrency. Before changing your internet service, share or measure the request size, destination, response size, connection behavior, and actual timing. Also confirm that the target system permits this level of traffic.
100,000 requests per minute is about 1,667 requests per second, or only around 0.6 milliseconds per request if treated serially. A single Python process and a remote server may not sustain that, especially if every request creates a new connection. Use an authorized load-testing setup, tune concurrency based on measurements, and consider multiple workers or load generators rather than assuming a faster home connection will solve it.
Break the test into controlled benchmarks. First run the client and server locally, then test between two machines in the same environment, and finally test from a properly provisioned cloud host if appropriate. This helps separate application, operating-system, network, and ISP limitations. Check CPU usage, file-descriptor limits, socket errors, connection reuse, and sockets stuck in TIME_WAIT.

The exact request and response sizes matter too. A small request may be latency- or connection-limited, while a larger one will eventually be limited by throughput. Benchmark each factor separately instead of increasing traffic blindly.