Solved

C# Web Service timeout

Posted on 2007-11-20
8
12,027 Views
Last Modified: 2013-11-07
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
Comment
Question by:Endelm
8 Comments
 
LVL 40

Accepted Solution

by:
evilrix earned 125 total points
ID: 20320473
0
 
LVL 21

Assisted Solution

by:surajguptha
surajguptha earned 125 total points
ID: 20320475
Check this article about increasing timeouts
http://www.thescripts.com/forum/thread628561.html
0
 
LVL 7

Assisted Solution

by:badbearontour
badbearontour earned 125 total points
ID: 20320780
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
DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

 
LVL 7

Expert Comment

by:badbearontour
ID: 20320789
Sorry its called

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

BB
0
 
LVL 40

Expert Comment

by:evilrix
ID: 20321211
Um, all of which is documented in the very first link to that I posted -- in detail!
0
 
LVL 37

Assisted Solution

by:gregoryyoung
gregoryyoung earned 125 total points
ID: 20321894
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
 
LVL 1

Expert Comment

by:Computer101
ID: 20521763
Forced accept.

Computer101
EE Admin
0

Featured Post

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Jaspersoft Studio is a plugin for Eclipse that lets you create reports from a datasource.  In this article, we'll go over creating a report from a default template and setting up a datasource that connects to your database.
Entity Framework is a powerful tool to help you interact with the DataBase but still doesn't help much when we have a Stored Procedure that returns more than one resultset. The solution takes some of out-of-the-box thinking; read on!
The viewer will learn how to synchronize PHP projects with a remote server in NetBeans IDE 8.0 for Windows.
The viewer will learn how to use and create new code templates in NetBeans IDE 8.0 for Windows.

867 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now