• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 12445
  • Last Modified:

C# Web Service timeout

Hi,

I created a console application to load test my web service. I created 10 threads that I execute at the same time.

Each web service thread queries a database with a query that takes 2-3min.

When I start the 10 threads and wait for around 5min, my testing programI gets a time out exception:

System.Net.WebException: The operation has timed out
   at System.Web.Services.Protocols.WebClientProtocol.GetWebResponse(WebRequest request)
   at System.Web.Services.Protocols.HttpWebClientProtocol.GetWebResponse(WebRequest request)
   at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters)
..
..

Is this normal? Is it possable to extend this timeout in the web service?

Thank you! :P
0
Endelm
Asked:
Endelm
4 Solutions
 
evilrixSenior Software Engineer (Avast)Commented:
0
 
surajgupthaCommented:
Check this article about increasing timeouts
http://www.thescripts.com/forum/thread628561.html
0
 
badbearontourCommented:
Theres a possible change tot he webconfig file you could try. its detailed here

http://www.sitepoint.com/article/web-config-file-demystified

its something like application_timeout.

its usually set at 5 mins, you oculd try ectending it.

In reality though I would probably try using asynchronous calls to the webservice, as 2-3 minutes is a long time for a query to run

Good Luck

BB
0
Get your Disaster Recovery as a Service basics

Disaster Recovery as a Service is one go-to solution that revolutionizes DR planning. Implementing DRaaS could be an efficient process, easily accessible to non-DR experts. Learn about monitoring, testing, executing failovers and failbacks to ensure a "healthy" DR environment.

 
badbearontourCommented:
Sorry its called

   <httpRuntime appRequestQueueLimit="100" executionTimeout="600" />

BB
0
 
evilrixSenior Software Engineer (Avast)Commented:
Um, all of which is documented in the very first link to that I posted -- in detail!
0
 
gregoryyoungCommented:
I think a better question is what on earth are you doing in a webservice call that takes 5 minutes?!?!?!

I think you may be looking at a bad architecture here ... This sounds like something that should be done asynchronously i.e.

I call the WebService to request this thing to be done ...
The webservice writes the job say to a table returns me a unique ID of the task I just requested ... (it is telling me that the task will be run in the future).
Another process picks up the job out of that table and processes it (setting when it is completed)
I can then ask the webservice the status of the task *OR* I can tell the webservice a local webservice where it can call me to tell *me* that the task has been completed ...
I ask the webservice for the results (or this is combined with it telling me the job is done)


This introduces queuing to the system and allows it to be processed by some other back end processor. This is important because what happens if the webservice restarts? The tasks will still run .... if the back end processor is restarted it will continue working where it left off.

What happens if 500 calls are made concurrently (this could qualify as a DoS attack) haviong the webservice do this directly would be a disaster (500 concurrent tasks). The queuing here limits the number of concurrent jobs to be run (it is simply a configuration point of the back end processor).

The queuing provides a full transactional log of every request that has been processed (and could even link to the results returned) ... not a big deal to implement otherwise but it comes for free ...


0
 
Computer101Commented:
Forced accept.

Computer101
EE Admin
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now