Python requests module is very slow on specific machine

后端 未结 4 995
我寻月下人不归
我寻月下人不归 2020-12-19 16:36

I\'ve experienced too slow execution of Python requests on some machines and with specific user while other tools (for instance curl) are quite fast. Strange thing is that i

4条回答
  •  长情又很酷
    2020-12-19 17:04

    There could be many things slowing the request down. Anything from DNS lookup, throttling etc.

    Try getting some more information by turning requests debug logging on

    logging.basicConfig() 
    logging.getLogger().setLevel(logging.DEBUG)
    requests_log = logging.getLogger("requests.packages.urllib3")
    requests_log.setLevel(logging.DEBUG)
    requests_log.propagate = True
    

提交回复
热议问题