|
|
|
|
|
by zepolen
3402 days ago
|
|
Could also use multiprocessing, got about ~500req/s returning a 'hello world' response (which the article also does). The article does about 300req/s but that's because he saturates his pipe. The reality is the article might be faster than 1,000,000/hour. from multiprocessing import Pool
from requests import get
urls = 1000 * ['http://localhost/hello']
def scrape(url):
return get(url).text
p = Pool(40)
results = p.map(scrape, urls)
~2.2 seconds on a dual core 2.2ghz |
|
I've used multiprocessing/threads/geven/asyncio before. And I will have a full test with these libraries.
Thanks again!