Re: XML-RPC(using SimpleXMLRPCServer) slow on the first call

2009-10-14 Thread Mahi Haile
-- Forwarded message --
 From: Gabriel Genellina gagsl-...@yahoo.com.ar
 To: python-list@python.org
 Date: Wed, 14 Oct 2009 00:52:13 -0300
 Subject: Re: XML-RPC(using SimpleXMLRPCServer) slow on the first call
 En Mon, 12 Oct 2009 18:58:45 -0300, Mahi Haile begin.middle@gmail.com
 escribió:

  Hello all,I have an xml-rpc server running on a machine in the same LAN as
 the client. Both the server and the client are in Python.

 When I have a series of xmlrepc calls from the client to the server, the
 first call usually takes much longer than it should - orders of magnitude.
 The latency is usually sub-10ms on the other calls, but the first call
 takes
 up to 10 seconds or so. This are very simple functions, with almost no
 computation.

 Do you have any ideas?


 I doubt this is a Python problem. I'd look into the network: DNS
 resolution, IPv6 (Windows XP has some timeout issues with IPv6 enabled).

 --
 Gabriel Genellina

 That seems to be correct. The machine is behind a NAT, so that is probably
why. Thank you.
-- 
http://mail.python.org/mailman/listinfo/python-list


SimpleXMLRPCServer timeout issue

2009-08-26 Thread Mahi Haile
Hi all,
I have an XML-RPC server running that is using SimpleXMLRPCServer, and I am
trying to send a relatively large file on a poor connection [simulated low
bandwidth, high latency]. The file is simply the return value of a function
call available on the server.
However, sometime in to the transfer, I get a timeout, seemingly regardless
of what I do. The server is initiated as follows:

s = SimpleXMLRPCServer((HOST, PORT), requestHandler = RequestHandler)
s.timeout = 10  #I tried setting this to None, and also a higher number

And the exception I get is:

Traceback (most recent call last):
  File /python2.5/SocketServer.py, line 464, in process_request_thread
self.finish_request(request, client_address)
  File /python2.5/SocketServer.py, line 254, in finish_request
self.RequestHandlerClass(request, client_address, self)
  File /python2.5/SocketServer.py, line 522, in __init__
self.handle()
  File /python2.5/BaseHTTPServer.py, line 316, in handle
self.handle_one_request()
  File python2.5/BaseHTTPServer.py, line 310, in handle_one_request
method()
  File /python2.5/SimpleXMLRPCServer.py, line 481, in do_POST
self.wfile.write(response)
  File /python2.5/socket.py, line 262, in write
self.flush()
  File /python2.5/socket.py, line 249, in flush
self._sock.sendall(buffer)
timeout: timed out

Googling resulted in similar questions asked in the CherryPy forums, and the
general suggestions seem to be to use a streaming transfer, using yield
rather than return.
Do you know how I go about solving when using the SimpleXMLRPCServer? For
what it is worth, I am running the server on Mac OS X.

Thank you,
-- 
http://mail.python.org/mailman/listinfo/python-list