Solved

C# Web Service timeout

Posted on 2007-11-20
8
11,985 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
Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

 
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

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

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!
Performance in games development is paramount: every microsecond counts to be able to do everything in less than 33ms (aiming at 16ms). C# foreach statement is one of the worst performance killers, and here I explain why.
The viewer will learn how to use NetBeans IDE 8.0 for Windows to connect to a MySQL database. Open Services Panel: Create a new connection using New Connection Wizard: Create a test database called eetutorial: Create a new test tabel called ee…
The viewer will learn how to synchronize PHP projects with a remote server in NetBeans IDE 8.0 for Windows.

759 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

17 Experts available now in Live!

Get 1:1 Help Now