使用 XML-RPC.NET 在 Windows 7 中降低 XML-RPC 速度
我正在考虑使用 XML-RPC.NET 与用 Python 编写的 Linux XML-RPC 服务器进行通信。我尝试了来自 CookComputing's XML-RPC.NET 的示例应用程序 (MathApp),但该应用程序花了 30 秒才能在与服务器相同的 LAN 内添加两个数字。
我还尝试在 Windows 7 上运行一个用 Python 编写的简单客户端来调用同一服务器,它在 5 秒内响应。该机器具有 4 GB RAM,具有相当的处理能力,因此这不是问题。
然后我尝试使用Java和PHP从Windows XP系统调用服务器。两人的反应都非常快,几乎是即时的。服务器在本地主机上响应也很快,所以我认为延迟不是由服务器引起的。
我的谷歌搜索返回了一些有关 Windows 使用 IPv6 的问题,但我们对服务器的调用确实包括同一子网中的 IPv4 地址(不是主机名)。无论如何,我关闭了 IPv6,但没有任何改变。
还有其他方法可以检查延迟的可能原因吗?
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
有 一个 bug 会影响
BaseHTTPServer
及其子类(包括SimpleXMLRPCServer
)。基本上,您的服务器可能会为其尝试记录的每个 IP 地址调用socket.getfqdn
函数。这篇文章可能解释了这一点更好的。解决方法在那里描述,TL;DR:
There is a bug that affects
BaseHTTPServer
and its subclasses (includingSimpleXMLRPCServer
). Basically, your server is likely to callsocket.getfqdn
function for every IP address it is trying to log. This article probably explains it better.The workaround describes there, for TL;DR:
在客户端计算机上运行数据包捕获,检查网络流量计时与调用函数的时间。
这可以帮助您确定缓慢进程中的延迟时间,例如应用程序启动时间、名称解析等。
您如何从客户端寻址服务器?通过IP?通过 FQDN?您使用的每个应用程序中的寻址方法是否相同?
如果从同一个慢速应用程序多次调用同一个远程过程,所花费的时间是否线性增加?
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?