[New-bugs-announce] [issue14622] Python http.server is dead slow using gethostbyaddr/getfqdn for each request

Yuval Greenfield report at bugs.python.org
Thu Apr 19 19:59:09 CEST 2012


New submission from Yuval Greenfield <ubershmekel at gmail.com>:

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.

----------
components: Library (Lib)
messages: 158737
nosy: ubershmekel
priority: normal
severity: normal
status: open
title: Python http.server is dead slow using gethostbyaddr/getfqdn for each request
versions: Python 3.4

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue14622>
_______________________________________


More information about the New-bugs-announce mailing list