Re: intervall of about 1 second for xmlrpc calls?

2010-05-21 Thread Adam Tauno Williams
On Fri, 2010-05-21 at 02:10 -0700, rav wrote:
> I had similar problem with SimpleXMLRPCServer
> Create the request handler class
> class ExtendedXMLRPCRequestHandler(SimpleXMLRPCRequestHandler):
> # originally this one was slowing down my server A LOT due to DNS
> settings!!!
> def log_request(self, *args):
> pass
> and put it in your SimpleXMLRPCServer constructor
> (...)
> class MyServer(threading.Thread):
> def __init__(self, host, port):
> threading.Thread.__init__(self)
> self.server = SimpleXMLRPCServer((host, port),
> ExtendedXMLRPCRequestHandler)
> self.server.register_function(self.is_even, "is_even")
> self.server.register_function(self.stop, "stop_server")
> (...)
> I would also change all 'localhost' occurences in the code to ip
> '127.0.0.1'.

Or the better solution is to fix your resolver.
-- 
Adam Tauno Williams  LPIC-1, Novell CLA

OpenGroupware, Cyrus IMAPd, Postfix, OpenLDAP, Samba

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: intervall of about 1 second for xmlrpc calls?

2010-05-21 Thread rav
I had similar problem with SimpleXMLRPCServer
Create the request handler class

class ExtendedXMLRPCRequestHandler(SimpleXMLRPCRequestHandler):
# originally this one was slowing down my server A LOT due to DNS
settings!!!
def log_request(self, *args):
pass

and put it in your SimpleXMLRPCServer constructor

(...)

class MyServer(threading.Thread):
def __init__(self, host, port):
threading.Thread.__init__(self)
self.server = SimpleXMLRPCServer((host, port),
ExtendedXMLRPCRequestHandler)
self.server.register_function(self.is_even, "is_even")
self.server.register_function(self.stop, "stop_server")

(...)

I would also change all 'localhost' occurences in the code to ip
'127.0.0.1'.

Good luck!
Rafal
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: intervall of about 1 second for xmlrpc calls?

2010-05-20 Thread Adam Tauno Williams
On Thu, 2010-05-20 at 22:46 +0200, News123 wrote:
> Hi Adam,
> Adam Tauno Williams wrote:
> > On Thu, 2010-05-20 at 03:40 -0700, Thomas Lehmann wrote:
> >>> What's wrong?
> >> Obviously there's a problem with "localhost". When using the IP of my
> >> machine everything is working fast.
> I think you're right.
> localhost  with IPV6 was also a problem for me. At least it was for me
> on a windows 7 host.
> I 'solved' the problem by disabling IPV6, but this is a workaround, not
> a proper solution.
> > You box may first be trying to connect to ::1 (ipv6) and when that fails
> > it falls back to 127.0.0.1.  Make sure IPv6 is properly
> > configured/enabled and try the script again.
> Do you know why the default config of IPV6 could be wrong on a windows
> 7 host?

No.  This would seem to have something to do with the resolver.  If you
do a nslookup for localhost what does it say.

> Having no experience with IPV6:

Have lots, it's really nice.  Once you get most things cut over.

> How should it be configured?
> How to detect issues?

Does nslookup localhost return the correct result?  That might depend on
your DNS server - not your local host.

Also "ping ::1"?
-- 
Adam Tauno Williams  LPIC-1, Novell CLA

OpenGroupware, Cyrus IMAPd, Postfix, OpenLDAP, Samba

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: intervall of about 1 second for xmlrpc calls?

2010-05-20 Thread News123
Hi Adam,


Adam Tauno Williams wrote:
> On Thu, 2010-05-20 at 03:40 -0700, Thomas Lehmann wrote:
>>> What's wrong?
>> Obviously there's a problem with "localhost". When using the IP of my
>> machine everything is working fast.

I think you're right.

localhost  with IPV6 was also a problem for me. At least it was for me
on a windows 7 host.
I 'solved' the problem by disabling IPV6, but this is a workaround, not
a proper solution.

> 
> You box may first be trying to connect to ::1 (ipv6) and when that fails
> it falls back to 127.0.0.1.  Make sure IPv6 is properly
> configured/enabled and try the script again.

Do you know why the default config of IPV6 could be wrong on a windows
7 host?

Having no experience with IPV6:

How should it be configured?
How to detect issues?


thanks


N


-- 
http://mail.python.org/mailman/listinfo/python-list


Re: intervall of about 1 second for xmlrpc calls?

2010-05-20 Thread Adam Tauno Williams
On Thu, 2010-05-20 at 03:40 -0700, Thomas Lehmann wrote:
> > What's wrong?
> Obviously there's a problem with "localhost". When using the IP of my
> machine everything is working fast.

You box may first be trying to connect to ::1 (ipv6) and when that fails
it falls back to 127.0.0.1.  Make sure IPv6 is properly
configured/enabled and try the script again.
-- 
Adam Tauno Williams  LPIC-1, Novell CLA

OpenGroupware, Cyrus IMAPd, Postfix, OpenLDAP, Samba

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: intervall of about 1 second for xmlrpc calls?

2010-05-20 Thread Thomas Lehmann
> What's wrong?
>

Obviously there's a problem with "localhost". When using the IP of my
machine everything is working fast.
-- 
http://mail.python.org/mailman/listinfo/python-list