Slow Python HTTP server on localhost

前端 未结 2 799
[愿得一人]
[愿得一人] 2020-12-25 14:57

I am experiencing some performance problems when creating a very simple Python HTTP server. The key issue is that performance is varying depending on which client I use to a

2条回答
  •  时光取名叫无心
    2020-12-25 15:30

    This does not sound like a problem with the code. A nifty way of troubleshooting an HTTP server is to connect to it to telnet to it on port 80. Then you can type something like:

    GET /index.html HTTP/1.1
    host: www.blah.com
     
    

    and observe the server's response. See if you get a delay using this approach.

    You may also want to turn off any firewalls to see if they are responsible for the slowdown.

    Try replacing 127.0.0.1 for localhost. If that solves the problem, then that is a clue that the FQDN lookup may indeed be the possible cause.

提交回复
热议问题