Thinking about project problems caused by a curl timeout

Source: Internet
Author: User
Tags curl

A curl timeout has been encountered in the recent project, resulting in a failure of the user operation to write

1, Curl timeout how to track which step caused the timeout

PHP Timeout principle:

How do we determine which step timed out in the event of a request to invoke an API timeout.

1, network reasons, the request time-out, the server code is not executed, it is easy to judge, after the timeout, the service side without any action

2, the server execution timeout, the server code has been executed, but did not run out of time exceeded the set timeout

In the second case, to first analyze what steps the server code has performed, then look at what steps are being executed but not executed, analyze whether the step caused the timeout, and then optimize for that step, not forward analysis, to determine which of the previous steps was time-consuming, resulting in a later timeout.


2, one-time operation multiple calls to an asynchronous service processing mode

How to minimize the impact of service hangs on us when we need to call a TCP asynchronous service (with a connection timeout) multiple times in one operation

My understanding is to encapsulate these multiple calls into an API interface and then go asynchronously, so that even if the asynchronous service is hung, the connection will only expire once.


3, a service our subjective judgment is not good after the first reaction should be discarded.

At least I do not think so, I am more inclined to find out whether it is really bad to use or do not use their own good.


4, as a research and development, I have never thought of shirking responsibility

When in a team, there are some problems, the solution has not yet come out, but someone has begun to think of shirking responsibility, that moment

, I really want to get out of this team. But maybe we should think about how to solve this problem if I'm a team manager.

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.