Curl implementation speed is very slow

Source: Internet
Author: User
The curl execution speed is very slow. A simple curl capturing program is written normally, but after execution, the response speed of both local access and remote url exceeds 10 seconds. This is why. note: There is a 10*10 for loop in the program and it needs to be executed 100 times ., You need to see the code. right, it may be that the 10*10 loop delays the time. Your curl execution speed is very slow.
A simple curl capturing program is written normally, but after execution, the response speed of both local access and remote url exceeds 10 seconds. Why?
Note: There is a 10*10 for loop in the program, which needs to be executed 100 times.

------ Solution --------------------
You need to see the code
------ Solution --------------------
Yes, it may be that the 10*10 cycle delays the time.
------ Solution --------------------
You execute curl 100 times in a loop. Assume that each time takes 1 second (not too much), it is 100 seconds.

You can write curl_multi concurrently, so it will be much faster.
------ Solution --------------------
Sleep only slows down the generation of results. are you too slow to make it slower?

The speed of crawling depends on the speed of the network and the response of the other party (a detailed report is provided in the result of curl_getinfo)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.