xmlrpc slow in windows 7 if hostnames are used

News123 news123 at free.fr
Thu Feb 4 17:34:20 EST 2010


Hi,

I wrote a small xmlrpc client on Windows 7 with python 2.6

srv = xmlrpclib.Server('http://localhost:80')

I was able to perform about 1 rpc call per second


After changing to
srv = xmlrpclib.Server('http://127.0.0.1:80')

I was able to perform about 10 to 16 rpc calls per second.

So it seems, that under windows 7 the host name lookup occurs for every
RPC call (which is of course necessary for long running processes, as
the target host might change it's ip during the scripts execution)

For my use cases however I could live with one IP-address lookup at the
beginning of the script.


I wonder now about how I could deal with virtual web servers.

( a web server running with one ip-adress and one port, which behaves
differntly depending on the host name of the url request)

I'm just curious, as currently I don't have to access virtual servers
via xmlrpc,

Is there any way to 'pre-lookup the IP address', and to keep the host
name in the http POST request?


thanks for any ideas



N








More information about the Python-list mailing list