xmlrpc slow in windows 7 if hostnames are used

News123 news123 at free.fr
Sun Feb 7 05:33:55 EST 2010


Hi JM,


Jean-Michel Pichavant wrote:
> News123 wrote:
>> Jean-Michel Pichavant wrote:
>>  
>>
>> Well This was exactly my question.
>> for virtual web servers I cannot just use the IP-address.
>> some XMLRPC servers do need the histname within the HTTP-POST request.
>>
>>   
> a valid IP address would make it

What I meant is: Window 7 seems to be waaaayyyy slower if an xmlrpc
client uses a host name ('localhost') than an IP-address ('127.0.0.1).
the speed difference is between 1 request per second or 10-20 requests
per second.


>> if I just replaced the hostname with the IP address, then certain servers
>> would not be accessable.

many computers host multiple web servers under the same IP-address.
( see for example http://httpd.apache.org/docs/1.3/vhosts/name-based.html )

So I cannot just replace a host name with an IP-address and expect
to receive the correct data / correct xmlrpc server.


>> I had to use the IP-address for connecteing
> why not using the host names?

I did not want to use the hostname due to the slowdown of
"locahost vs. 127.0.0.1"  issue on my host.

You are right, that I did not verify whether this issue exists also with
external servers and I should verify this first.


>> , but to pass the hostname in
>> the HTTP-POST request.
>>
>> I wondered how to convince puthon's SimpleXMLRPCServer (or any other
>> standard python xmlrpc server), such, that I can obtain above mentioned
>> goal.
>>
>>   
> I'm puzzled.
> Unless my english is failing me, everything would be solved using
> hostnames if I follow you. Why don't you do that ?
> I am no network/IP guru, but it sounds very weird to have requests
> rejected when using IP addresses. Are you sure your host names are
> resolved with the same IPM address you are using ?

The request would not be rejected, but apache can (if being configured
for name based virtual hosts) look at the hostname within the TCP/IP
payload (the entire url (including the host name) is normally also in
the GET / POST request ) and decide to deliver different data (or to
return HTTP errors) depending on the hostname in the payload.


I hope this clarifies.

Your answer gave me some thoughts though:

I still have to check whether the issue really exists with external
requests other than localhost.
Also I should probably try to attack the root cause
(  probably with help of ethereal or a similiar tool) instead of trying
to work around it.

I could just change the windows /etc/hosts equivalent and tell localhost
to have only an IPV4 address (perhaps this increases the performance)


On the other hand:
 Some people use name based virtual servers to provide special web
services by providing a 'fake-host name' in the http request. it might
be, that the fake host name doesn't even have a DNS entry.
( Though security by obscurity is a questionable practice )

so for some weird use cases it could be worth knowing how to connect to
one IP addres and to pass a different host name in the HTTP payload when
using an  xmlrpcclient


bye


N



More information about the Python-list mailing list