views:

218

answers:

2

I'm considering to use XML-RPC.NET to communicate with a Linux XML-RPC server written in Python. I have tried a sample application (MathApp) from Cook Computing's XML-RPC.NET but it took 30 seconds for the app to add two numbers within the same LAN with server.

I have also tried to run a simple client written in Python on Windows 7 to call the same server and it responded in 5 seconds. The machine has 4 GB of RAM with comparable processing power so this is not an issue.

Then I tried to call the server from a Windows XP system with Java and PHP. Both responses were pretty fast, almost instantly. The server was responding quickly on localhost too, so I don't think the latency arise from server.

My googling returned me some problems regarding Windows' use of IPv6 but our call to server does include IPv4 address (not hostname) in the same subnet. Anyways I turned off IPv6 but nothing changed.

Are there any more ways to check for possible causes of latency?

A: 

Run a packet capture on the client machine, check the network traffic timings versus the time the function is called.

This may help you determine where the latency is in your slow process, e.g. application start-up time, name resolution, etc.

How are you addressing the server from the client? By IP? By FQDN? Is the addressing method the same in each of the applications your using?

If you call the same remote procedure multiple times from the same slow application, does the time taken increase linearly?

MattH
A: 

There is a bug that affects BaseHTTPServer and its subclasses (including SimpleXMLRPCServer). Basically, your server is likely to call socket.getfqdn function for every IP address it is trying to log. This article probably explains it better.

The workaround describes there, for TL;DR:

import BaseHTTPServer
def not_insane_address_string(self):
    host, port = self.client_address[:2]
    return '%s (no getfqdn)' % host #used to call: socket.getfqdn(host)
BaseHTTPServer.BaseHTTPRequestHandler.address_string = \
    not_insane_address_string
Santa