Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

timeout problem

Status
Not open for further replies.

moabiker31

Programmer
Nov 6, 2004
35
0
0
US
We have a VB2005 desktop app using web services. The app/web service returns data within 4 seconds. The timeout is set to 2 minutes. There are random times when any query will timeout, which makes the user wait the full 2 minutes. we know if the data hasn't been returned in 10 seconds, the user will be waiting for 2 minutes. this is a new app with small amounts of data so i'm not ready to change the timeout to a smaller value yet, unless that's the only solution. i'm new to web services. does anyone know why there are random timeouts? is it related to the web service or poor internet service? is there a way to cancel the command we know is going to timeout so we can run it again without waiting for 2 minutes? there's currently 1 full time user that is reporting the problem. the 2 part time users have NOT experienced this. any suggestions are appreciated. thanks.
 
I guess yo uneed to identify where the delay is.

Can you put some logging in, so that (assuming that the web server, the Client and the Database Server's times are relatively close) you can see where the delay is ocurring?

You mention internet service, so Im guessing thats where the lag is, in which case I guess its beyond your control.

Is there a common trend to when it happens (AV starting up, Backup ocurring, Lunch time and 300 users getting online to check the news / hotmail etc..)?

Is it possible to write the service request / response to run asynchronously, so that they can do something else whilst the call is executing?

As an alternative to that, you could run a System.Timer with a value of 10 seconds, and if the timer completes before the data is returned, spawn another call. (Though then you need to consider what to do with the outstanding call.)

Anyway, Im wittering on, what facility / access do you have to identify where the holdup is?
 
I would move the timeout to a configurable option, instead of hardcoding it into the request. The easiest place to put this is app.config. for now set it for 10 seconds. as the timeouts become more frequent you can increase the duration by updating the app.config. no need to compile/deploy each time.

this only fixes the symptoms though. the problem is the service is not repsonding effeciently. Did you design the service, or is this a 3rd party service? if you designed it have you stress tested the code to find the bottlenecks?

if it's not your service, could you stress test the service (without upsetting the vendor) by sending X number of requests every few minutes and logging some statistics about it? This would give some insight into when the problem occurs (similar to Kalisto's comments).

I would create a simple windows service which would send 50 asynchronis requests every 10 minutes with a 1 minute timeout period. I would track the following information
GUID for uniqueness
start time (when the request was set)
stop time (when the request was completed [sucess or failure])
amount of data returned (length of json/xml string)
input parameters (if any and they vary between request)
name of the service called (if there is more than one service)

dump this into database table or xls and then you can chart the results. I would run this test for at least core business hours. best to run it for 24 hours.

you should also use some network monitoring tools to check rule out infrastructure problems.
server/client cpu usage, disk IO, paging, etc.
network latency


Jason Meckley
Programmer
Specialty Bakers, Inc.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top