简体   繁体   English

LookupAddressForName的作用是什么,为什么这么慢

[英]What does LookupAddressForName do and why is it so slow

We have an application which uses a closed source library. 我们有一个使用封闭源代码库的应用程序。 One of our customers complains that the application takes long on startup, and sent us a performance trace (using the microsoft concurrency visualizer). 我们的一位客户抱怨该应用程序需要很长时间才能启动,并向我们发送了性能跟踪(使用Microsoft并发可视化工具)。

In this trace, I can see that on startup, about a minute is spent inside ws2_32.dll!LookupAddressForName, called from the third-party dll. 在此跟踪中,我可以看到在启动时,从第三方dll调用的ws2_32.dll!LookupAddressForName内部花费了大约一分钟。

(This is multiple calls, not a single call taking so long, but since the concurrency visualizer uses sampling, not instrumentation, I can't see how long each individual call takes.) (这是多个调用,而不是单个调用花费这么长时间,但是由于并发可视化工具使用采样而不是检测,因此我看不到每个单个调用花费的时间。)

I couldn't find any documentation on LookupAddressForName, but judging from name and context, I assume that it translates a hostname to an ip address, eg does a DNS lookup. 我在LookupAddressForName上找不到任何文档,但是从名称和上下文来看,我认为它会将主机名转换为ip地址,例如进行DNS查找。

I can't reproduce this locally, and I can't install a debugger at the customer. 我无法在本地复制它,也无法在客户处安装调试器。

The customers OS is Windows 7.1 Enterprise, joined to a Domain. 客户操作系统是Windows 7.1 Enterprise,已加入域。

Do you know under which circumstances LookupAddressForName might block multiple seconds? 您知道在哪种情况下LookupAddressForName可能会阻塞几秒钟?

A slow network connection is the most common situation. 最慢的网络连接是最常见的情况。 Think a remote branch office connected to head office via a very slow connection. 考虑通过非常慢的连接将远程分支机构连接到总部。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM