How can I reliably send 100,000 authorized requests per minute with Python asyncio?

0
0
Asked By MellowPine42 On

I'm testing a system I control and want to send about 100,000 requests in one minute—roughly 1,667 requests per second—using Python 3 and asyncio. My connection used to provide about 25 Mbps up and down, and I upgraded it to 1 Gbps, but the request rate barely changed. I suspect the bottleneck may be my ISP, router, operating system, or the way the client and server are configured. What should I measure and change to identify the limiting factor?

3 Answers

Answered By NimbleCedar31 On

At 100,000 requests per minute, you need to sustain about 1,667 requests per second, or one request every 0.6 milliseconds on average. A single Python process and a single network path may not handle that reliably. Reuse persistent connections, check file-descriptor and ephemeral-port limits, watch for sockets stuck in TIME_WAIT, and profile the event loop and CPU. You may need multiple workers or load-generation machines.

Answered By OrbitingFox7 On

Raw internet bandwidth may not be the bottleneck. The payload size, protocol, connection reuse, destination server, latency, and server-side rate limits all matter. Include the actual request code and measure total bytes, connection setup time, response time, CPU usage, and error rates before assuming the ISP is responsible.

CobaltMango19 -

The test should also make clear whether the destination is a service you own or have explicit permission to load-test. Otherwise, that volume could look like a denial-of-service attack.

Answered By QuietHarbor6 On

Start by eliminating variables. If the server is local, benchmark it locally first. If it runs in the cloud, run the client from another suitable cloud instance and compare the results. That separates application and server limits from your home router and connection.

Related Questions

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.