Stream_set_timeout setting timeout invalid fread still times out

Source: Internet
Author: User
Interface timeout 502badgateway timeout limit when the page fails to call the interface, the response is 10 s. Through xhprof monitoring, it is found that the interface call times out. But in fact, when the interface times out, it can only be 2 s at most, and the read stream time-out is limited through stream_set_timeout. Query manual... interface timeout 502 bad gate way timeout limit invalid

When the page calls an interface, the response is 10 s. Through xhprof monitoring, it is found that the interface call times out. But in fact, when the interface times out, it can only be 2 s at most.stream_set_timeoutThe read stream timeout limit is imposed.

Query manual

There are some examples in the manual, some of which are described as follows:

If you are using fsockopen() to create a connection, first going to write into the stream and then waiting for the reply (e.g. simulating HTTP request with some extra headers), then stream_set_timeout() must be set only after the write - if it is before write, it has no effect on the read timeout :-( 

But in fact, logical modification according to this writing method is still invalid.

How can I solve this problem?

Reply content: interface timeout 502 bad gate way timeout limit invalid

When the page calls an interface, the response is 10 s. Through xhprof monitoring, it is found that the interface call times out. But in fact, when the interface times out, it can only be 2 s at most.stream_set_timeoutThe read stream timeout limit is imposed.

Query manual

There are some examples in the manual, some of which are described as follows:

If you are using fsockopen() to create a connection, first going to write into the stream and then waiting for the reply (e.g. simulating HTTP request with some extra headers), then stream_set_timeout() must be set only after the write - if it is before write, it has no effect on the read timeout :-( 

But in fact, logical modification according to this writing method is still invalid.

How can I solve this problem?

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.