xmlrpc slow in windows 7 if hostnames are used

News123 news123 at free.fr
Fri Feb 5 17:26:48 EST 2010


Hi JM,

Jean-Michel Pichavant wrote:
>> Gabriel Genellina wrote:
>>  
>>> En Thu, 04 Feb 2010 19:34:20 -0300, News123 <news123 at free.fr> escribió:
>>>
>>>    
>>>> 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.
>>>>
>
> Or you can simply use an explicit external address. Most of the time
> xmlRPC server/clients are used between distant machines.
> If your are using localhost for test purpose, then binding your server
> on its external IP instead of the local one could solve your problem
> (wihtout removing the IPV6 stack).
> 
> import socket
> 
> # server
> server = SimpleXMLRPCServer((socket.gethostname(), 5000),
> logRequests=False, allow_none=True)
> 
> 
> # client
> xmlrpclib.ServerProxy("http://%s.yourdomain.com:%s" %
> (socket.gethostname(), 5000))


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.

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

I had to use the IP-address for connecteing, 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.


bye

N


> PS : just wondering if using the port 80 is legal

If nothing else on the host runs on port 80 the answer is yes.




More information about the Python-list mailing list