[Web-SIG] Fwd: wsgiref.simple_server slow on slow network

Tibor Arpas tibor at infinit.sk
Wed Jul 23 12:58:57 CEST 2008


Dear all,

it think the method
BaseHTTPServer.BaseHTTPRequestHandler.address_string() is to blame for
the delay. DNS reverse lookup is a feature not a bug. I think on most
production servers it's turned off by default. And after my experience
I would prefer that it's turned off in BaseHTTPServer. It's already
documented in the very last lines of
http://www.python.org/doc/lib/module-BaseHTTPServer.html

If I can help any further let me know. Unfortunately I'll not be able
to put more time into this before weekend.
Cheers,
Tibor



On Wed, Jul 23, 2008 at 11:54 AM, Massimo Di Pierro
<mdipierro at cs.depaul.edu> wrote:
> Hi Tibor,
>
> Could you send me a detailed paragraph about this? I believe it should go on
> the manaual!
>
> Massimo
>
>
> On Jul 23, 2008, at 2:41 AM, Tibor Arpas wrote:
>
>> Reverse DNS lookup is THE reason. Thank you very much Irmen. I put my
>> remote computer into windows/system32/drivers/etc/hosts and the
>> problem disapeared. The DNS name is indeed in the log which is written
>> to the console. Thanks again.
>>
>> Is there a way to disable the reverse DNS lookup in the
>> wsgiref.simple_server? Quick googling didn't reveal much.
>>
>> Tibor
>>
>>
>>
>> On Wed, Jul 23, 2008 at 12:21 AM, Irmen de Jong <irmen at xs4all.nl> wrote:
>>>
>>> Tibor Arpas wrote:
>>>>
>>>> Hi,
>>>> I'm quite new to python and I ran into a performance problem with
>>>> wsgiref.simple_server. I'm running this little program.
>>>>
>>> [...]
>>>>
>>>> I get many hundreds of responses/second on my local computer, which is
>>>> fine.
>>>> But when I access this server through our VPN it performs very bad.
>>>
>>> Could it be that the wsgiref is doing a reverse DNS lookup for every
>>> incoming call?
>>> (for instance to determine the remote server hostname for some reason
>>> such
>>> as logging)
>>> That could be a very slow operation.
>>>
>>> Just an idea, I have no idea about the workings of wsgiref, I've just
>>> seen
>>> this happening in other situations.
>>>
>>> --irmen
>>>
>>> _______________________________________________
>>> Web-SIG mailing list
>>> Web-SIG at python.org
>>> Web SIG: http://www.python.org/sigs/web-sig
>>> Unsubscribe:
>>> http://mail.python.org/mailman/options/web-sig/tibor%40infinit.sk
>>>
>> _______________________________________________
>> Web-SIG mailing list
>> Web-SIG at python.org
>> Web SIG: http://www.python.org/sigs/web-sig
>> Unsubscribe:
>> http://mail.python.org/mailman/options/web-sig/mdipierro%40cti.depaul.edu
>
>


More information about the Web-SIG mailing list