PHP/curl: namelookup_time/dns slowing requests

我只是一个虾纸丫 提交于 2019-12-01 22:39:20

The PHP app code is using curl_multi_select, which has a default timeout of 1 second. Changing this delay to 0.00005 seconds makes the call return much faster. So that's what's causing the delay. However, I don't yet know why this is different on Linux vs OSX or the particular flavor of php/libcurl that I have built (5.3.8).

I'm going to open a different SO question to try to resolve the curl_multi_select issue.

You can fixed your domain in /etc/hosts, then php curl don't need to lookup DNS to find ip address. That worked for me.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!