What is the fastest way to send 100,000 HTTP requests in Python?

前端 未结 16 1226
暖寄归人
暖寄归人 2020-11-22 07:12

I am opening a file which has 100,000 URL\'s. I need to send an HTTP request to each URL and print the status code. I am using Python 2.6, and so far looked at the many con

16条回答
  •  暗喜
    暗喜 (楼主)
    2020-11-22 07:39

    Consider using Windmill , although Windmill probably cant do that many threads.

    You could do it with a hand rolled Python script on 5 machines, each one connecting outbound using ports 40000-60000, opening 100,000 port connections.

    Also, it might help to do a sample test with a nicely threaded QA app such as OpenSTA in order to get an idea of how much each server can handle.

    Also, try looking into just using simple Perl with the LWP::ConnCache class. You'll probably get more performance (more connections) that way.

提交回复
热议问题