Curl paging gets a hundred thousand of data server timeout, how to resolve?

Source: Internet
Author: User
Curl gets API interface data, while loop page++ receives processing data, 100 data per page. The total data is a hundred thousand of articles. Always server timeout, how to solve?
Max_execution_time Set_time_limit

Reply content:

Curl gets API interface data, while loop page++ receives processing data, 100 data per page. The total data is a hundred thousand of articles. Always server timeout, how to solve?
Max_execution_time Set_time_limit

People can't stand it, you slow it down, sleep a bit ~

If the spider is sitting on the page content, it is recommended to use the program through the proxy IP to crawl, or else people see you crawl frequent direct IP, on the trouble;
If it's internal, like @ChanneW said, sleep for a long time, slow catch.

Indeed there is such a problem, the best solution is to combine the database to do a collection of applications, the success of the acquisition of the modified State is 1, the acquisition of the modified state is 0, and then through the timing of the script, polling collection
Analysis of the reasons for the failure, is not working time section of the traffic is larger, resulting in, can stagger the time period, such as Night/morning collection, hoping to help you.

To prevent timeouts, you can also perform a non-stop refresh jump. Re-make the request.

  • 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.