Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Typical network socket timeout

I'm interested to know, what is the typical network socket timeout value, used in production today.

I'm currently using 30 seconds in our Java application, but would like to hear what other using, especially for Internet communications.

Thanks.

like image 838
SyBer Avatar asked Dec 20 '10 10:12

SyBer


2 Answers

There is no such thing as a "typical" socket timeout. Rather you should chose the timeout(s) according to the application requirements. Issues such as:

  • Is there a user waiting for the response?
  • Is a timeout a likely event?
  • Does setting a "too long" timeout tie down lots of resources, or delay processing?
  • Does setting a "too short" timeout result in wasted processing when waiting a bit longer would have given results?
  • Is there a keep-alive mechanism ... so that you can distinguish between (say) network failure and the remote server taking a long time?

The best strategy is probably to pick some intuitively sensible values, and then tune them.

like image 96
Stephen C Avatar answered Sep 28 '22 17:09

Stephen C


As a rule of thumb you can use double the expected response time for the transaction. But there is certainly no such thing as a 'typical' timeout.

like image 34
user207421 Avatar answered Sep 28 '22 19:09

user207421