Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Best practices for web service timeouts [closed]

It there any article/book that defines upper bounded design limits for WS timeouts? Do you timeout at the server or recommend the client specific timeouts too?

Is there a common best practice like "never design WS that can take longer than 60 seconds, use an asynchronous token pattern"

I am interested in knowing what you do or your opinion too.

like image 299
MMind Avatar asked Nov 05 '08 19:11

MMind


People also ask

What is a good timeout value?

Your timeouts should be about 3 seconds.

What is a good HTTP timeout?

Knowing the time available to provide a response can avoid problems with timeouts. Current implementations select times between 30 and 120 seconds, times that have been empirically determined to be safe.

What should be a desirable timeout for an API between 2 systems?

Generally 1 Second is considered acceptable.

What is the default timeout for a Web service?

The timeout property specifies the maximum time (in seconds) to wait for a response to be returned. The value minus one (-1) is the default value. The -1 value causes the property to be ignored, and the underlying web service engine's default value of 300 seconds will be used for the request timeout.

How to increase execution timeout for a web method?

You can also increase executionTimeout value in web.config to allow for more time while you're trying to optimize your web method to run quicker if you have clients needing an immediate solution. If this an asmx web service, you may want to look into Session_End event in global.asax.

What is session timeout in web server?

Description of the session timeout. Session timeout represents the event occuring when a user does not perform any action on a web site during an interval (defined by a web server). The event, on the server side, changes the status of the user session to ‘invalid’ (ie. “not used anymore”) and instructs the web server to destroy it (deleting all ...

Is it possible to time out on a web service call?

1 Timing out on a web service call is something that happens only on the client side, and the server won't know anything about that. – MusiGenesis Aug 12 '09 at 13:30 Ok. There are 2 things that can bug things here then.

What are the best practices for a web server?

Actually, the main problem here is that there cannot be “best practices” for a web server. A web server is just a hosting platform for applications, and, each and every application has its own needs.


1 Answers

This stuff about 30+ second timeouts is ridiculous advice, IMO. Your timeouts should be about 3 seconds. Yes. Three. The number after two and before four. If you're building an application based on a SOA, then DEFINITELY 3 seconds, or less.

Think about it... the user of your app expects a TOTAL response time of about five seconds or less (preferably about three). If EACH INDIVIDUAL SERVICE CALL is taking more than a couple of* milliseconds* to return, you're hosed. Waiting 30+ seconds for ONE service to return is an eternity. The user will never wait around that long. Plus, if you know they're supposed to return in the sub-one second range, what's the point of waiting for another 30 or more seconds to signal an error condition; it's not going to magically work where when it didn't 28 seconds ago. If your application has wild swings in average response time from sub-one second to over 30 seconds, something was designed incorrectly. You might think about some caching or something.

like image 165
Robert C. Barth Avatar answered Sep 22 '22 13:09

Robert C. Barth