Home > Backend Development > PHP Tutorial > curl施行速度非常慢

curl施行速度非常慢

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-06-13 13:13:29
Original
2623 people have browsed it

curl执行速度非常慢。
正常写了一个简单的curl抓取程序,但是执行之后不管是访问本地还是远程url速度都超过10秒响应。这是为什么啊
注:程序里有一个10*10的for循环,需要执行100次。

------解决方案--------------------
需要看到代码
------解决方案--------------------
对,可能就是那 10* 10 循环拖延了时间.
------解决方案--------------------
你在循环中执行 curl 100次,假定每次耗时 1 秒(不算多吧)那么就是 100 秒了

你可以 curl_multi 并发一下,那就快多了
------解决方案--------------------
sleep 只是减缓结果的产生,你已经都嫌慢了,还要有意使他更慢吗?

抓取的速度如何,取决于网络和对方响应的速度(curl_getinfo的结果中就有详细的报告)

Related labels:
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Issues
curl simulated login
From 1970-01-01 08:00:00
0
0
0
Convert cURL command line to PHP cURL code
From 1970-01-01 08:00:00
0
0
0
Convert command line cURL to PHP cURL
From 1970-01-01 08:00:00
0
0
0
How to set boolean value true in php curl
From 1970-01-01 08:00:00
0
0
0
Please tell me, php curl request page shows blank
From 1970-01-01 08:00:00
0
0
0
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template