Consider the following case: There is a slow server which use about 200ms to handle a request (no including the network transfer time). And now, we need to
I know this is an old post but someone might still need this.
If you want to do load testing but want to use python then you should use a tool like locust: http://locust.io/
Here is my solution which resulted in 10,000 requests in 10 seconds:
Needed Package: sudo pip install grequests
Code:
import grequests
import time
start_time = time.time()
# Create a 10000 requests
urls = ['http://www.google.co.il']*10000
rs = (grequests.head(u) for u in urls)
# Send them.
grequests.map(rs)
print time.time() - start_time # Result was: 9.66666889191