Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / Web Services / March 2006

Tip: Looking for answers? Try searching our database.

Webservice seems to timeout during requests to other web reference

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
ajnt - 16 Mar 2006 18:32 GMT
My web service seems to be timing out as certain stages.
The web service has 5 different web references to other services (on the
same server) which we need to communicate with.
As the number of concurrent calls to the web service increases, the
operation time of the service lengthens.
However, when there are multiple requests and the web service is taking a
bit longer to run, the service will often stop running. This is accompanied
by a 500 error in the IIS logs and a timeout error if I am calling it from my
VB.Net test harness (usually its called from another system).

I have changed the machine.config file so that the executiontimeout (in
httpruntime) is set to 40000 (should be plenty of time!) and checked that the
debug=false in the web.configs of all the services. I have also rebooted the
server.

It seems that the problem is when the web service calls one of the
references (also ASP.Net web services) and the called function takes longer
than it should do to run.

I was wondering if there was another timeout property that is assigned to
the web references by the main service that is calling them? If so, how do I
override this?
Either way, shouldn't the setting in machine.config override any other
timeouts?

I would appreciate any help / input.

Thanks,

Ajnt
Pandurang Nayak - 22 Mar 2006 23:43 GMT
Hi,

As per your own explanation, the web service calls 5 other web services. Let
us just take a look at what that means to your web server. Each web service
call is a HTTP request that has to be processed by IIS.  This request is
spawning 5 other HTTP requests and they are all running synchronously which
means one waits for the other to finish and blocks the thread till that is
done.

Now, you are saying that your test harness in VB is simulating multiple
users. Even if you did about 100 users - that means that you are calling 5 x
100 = 500 HTTP calls.

The ASP.NET worker process has a finite number of threads that it can spawn
(specified in machine.config) and further requests will just have to wait for
earlier threads to finish. And since your CPU utilization is probably running
at 100% by then, your IIS starts recycling the process. All this causes a lot
of HTTP failed requests and also the timeouts.

There are a few things you can do:
1. I don't know about your application, but surely making a Web Service call
five other services suggests to me that you have a design with too many
services. Since you have the other components that the Web Service wraps on
the same local system - why don't you reference them directly?  You can also
write some proxy code to find out if the components exist locally and
instantiate them directly if available - and if not, go make a web service
call.

2. If you are on ASP.NET 2.0, consider using Asynchronous Pages - a new
feature that spawns threads, but does not block the thread - you'll
definetely get an improvement - but depends on how much that will really help.

3. Use memory profilers (like the CLR profiler, Windows perf monitor) and
find out what piece of code is causing the delays / bottlenecks. In all
probability you will find that it is just because all your ASP.NET worker
threads are getting used up.

Hope that helps!

Regards
Pandurang

Signature

blog: www.thinkingMS.com/pandurang

> My web service seems to be timing out as certain stages.
> The web service has 5 different web references to other services (on the
[quoted text clipped - 26 lines]
>
> Ajnt
Pandurang Nayak - 23 Mar 2006 01:00 GMT
Check http://www.thejoyofcode.com/Tuning_the_ThreadPool.aspx for an excellent
article!

Regards,
Pandurang
Signature

blog: www.thinkingMS.com/pandurang

> My web service seems to be timing out as certain stages.
> The web service has 5 different web references to other services (on the
[quoted text clipped - 26 lines]
>
> Ajnt

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.