homepage

This issue tracker has been migrated to GitHub , and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Python http.server is dead slow using gethostbyaddr/getfqdn for each request
Type: performance Stage:
Components: Library (Lib) Versions: Python 3.4
process
Status: closed Resolution: duplicate
Dependencies: Superseder: Logging in BaseHTTPServer.BaseHTTPRequestHandler causes lag
View: 6085
Assigned To: Nosy List: pitrou, python-dev, ubershmekel
Priority: normal Keywords:

Created on 2012年04月19日 17:59 by ubershmekel, last changed 2022年04月11日 14:57 by admin. This issue is now closed.

Messages (2)
msg158737 - (view) Author: Yuval Greenfield (ubershmekel) * Date: 2012年04月19日 17:59
This is the line in question: http://hg.python.org/cpython/file/293180d199f2/Lib/http/server.py#l527
I was trying to test out a few html files using "python -m http.server" and it took 4 seconds for each request, it was completely unusable. I had to do hula hoops to find out that it was Python's fault. The function self.address_string is used in every log, meaning every request makes a reverse DNS query before responding. This function failed for every request. Now I know this may be my network's fault but that doesn't mean the server has to die with it. I think the better solution would be to just print out the ip address like other popular servers do. There's no need to be fancy with server names in the log of our toy server, especially when it may come at such a high price.
msg158739 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2012年04月19日 18:54
Probably a duplicate of issue 6085.
History
Date User Action Args
2022年04月11日 14:57:29adminsetgithub: 58827
2012年04月22日 17:20:36vinay.sajipsetmessages: - msg158973
2012年04月22日 17:16:21python-devsetnosy: + python-dev
messages: + msg158973
2012年04月19日 18:54:21pitrousetstatus: open -> closed

nosy: + pitrou
messages: + msg158739

superseder: Logging in BaseHTTPServer.BaseHTTPRequestHandler causes lag
resolution: duplicate
2012年04月19日 17:59:16ubershmekelsettype: performance
2012年04月19日 17:59:08ubershmekelcreate

AltStyle によって変換されたページ (->オリジナル) /