What is the appropriate time for setting the timeout period for remote calls between systems?

reprint

https://segmentfault.com/q/1010000000166356

 

=======================================

There are many subsystems in the enterprise, and the systems will call each other. If the calling protocol is based on HTTP, such as webservice or rest,
in order to avoid the suspension of a subsystem of a service provider and cause the caller to wait for a long time, generally we A timeout is set on the caller.
Question: How much time do you set for this timeout? Can you give me an empirical value or a calculation method.

 

-------------------------------------------

You can refer to the following aspects:

1 User acceptance of overall response time. A normal website with a page completion time of more than 5 seconds is generally considered unacceptable. Do some research in advance as to how long your internal systems can withstand.

2 Status of interface performance. It needs to be set longer than the actual response time of the interface to tolerate fluctuations in the response time of the interface.

3 The current state of the network environment. Calculate the required number of packets based on the length of the response body. Considering the time-out retransmission, more than one network retransmission time is required to avoid chain reaction caused by temporary network packet loss.
For reference, the payload is within 4 packets, and the timeout can be set to 3 seconds.

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326802439&siteId=291194637