Some questions on ASP.NET web services on IIS 6

N

Navin Mishra

1. Is maxIothreads parameter used still in IIS 6 ? For processing web
service requests, I don't see ASp.NET AvailableIOThreads going down ? If I
use another web service from my web service, would IO thread be used or
worker thread ?
2. My web service is used by another web service(A) which sends a one-way
request to my web service and I want to free up that consumer web service A
as soon as possible. So, I use ThreadPool.QueueUserWorkItem to qeuee request
for procssing. I see the thread pool thread is the SAME as the request
thread used by A web service. Is that normal ? Is the web service A really
freed-up ?
3. Is invoking a web service asynchronously a good idea as it would still
use a thread from thread pool and petform thread context switch ?

Thanks in advance and regards

Navin
 
B

Brock Allen

1. Is maxIothreads parameter used still in IIS 6 ? For processing web
service requests, I don't see ASp.NET AvailableIOThreads going down ?
If I use another web service from my web service, would IO thread be used
or worker thread ?

IOThreads are no longer used to service requests in IIS6.
2. My web service is used by another web service(A) which sends a
one-way
request to my web service and I want to free up that consumer web
service A
as soon as possible. So, I use ThreadPool.QueueUserWorkItem to qeuee
request
for procssing. I see the thread pool thread is the SAME as the request
thread used by A web service. Is that normal ? Is the web service A
really
freed-up ?

The concern with using the thread pool to do async work in ASP.NET (and webservices)
is that it's the same threadpool that is servicing your pages and webservices.
So it's very easy to flood your threadpool with async work such that your
application is no longer responsive. I'd suggest doing async work with your
own threadpool. Mike Woording has a great one that I've used before:

http://www.bearcanyon.com/dotnet/#threadpool
 
N

Navin Mishra

Thanks for response. If I call another web service C from my web service B,
wouldn't an I/O thread be used ? And, in which case, making the web service
B's web method asynschronous to call web sevice C asynchronously would help
? I saw that recommendation in MSDN. Wouldn't I/O thread be also used when
web service sends data asynschronously over a socket connection ? More
comments below:


Brock Allen said:
IOThreads are no longer used to service requests in IIS6.


The concern with using the thread pool to do async work in ASP.NET (and
webservices) is that it's the same threadpool that is servicing your pages
and webservices. So it's very easy to flood your threadpool with async
work such that your application is no longer responsive. I'd suggest doing
async work with your own threadpool. Mike Woording has a great one that
I've used before:

http://www.bearcanyon.com/dotnet/#threadpool
[Navin]Indeed. The question above is different a bit. Just for my
information, when using the system thread pool, is the web service A sending
one way request to web service B in above scenario is really freed up when
its worker thread is reused to server a queued request from the pool.
 
B

Brock Allen

Well, it's unclear. There was a lively discussion on DevelopMentor's listservs
just this past 2 weeks on the topic. Here were the 3 more relevant posts:

http://discuss.develop.com/archives/wa.exe?A2=ind0503c&L=advanced-dotnet&T=0&F=&S=&P=1712

http://discuss.develop.com/archives/wa.exe?A2=ind0503c&L=advanced-dotnet&T=0&F=&S=&P=1829

http://discuss.develop.com/archives/wa.exe?A2=ind0503e&L=advanced-dotnet&T=0&F=&S=&P=3211

You still have the issue of how to handle your response back to your client
(I assume your code is in a asp.net page of webserice and it's using another
webservice to do something interesting). So you still have to make your webservice
an async one from ASP.NET's perspective. Fritz has an article on how to do
this for pages, but I don't see why it wouldn't also work for web services
(BTW, his article was what kicked off the above discussion in the first place):

http://msdn.microsoft.com/msdnmag/issues/03/06/Threading/default.aspx




Thanks for response. If I call another web service C from my web
service B, wouldn't an I/O thread be used ? And, in which case, making
the web service B's web method asynschronous to call web sevice C
asynchronously would help ? I saw that recommendation in MSDN.
Wouldn't I/O thread be also used when web service sends data
asynschronously over a socket connection ? More comments below:

IOThreads are no longer used to service requests in IIS6.

The concern with using the thread pool to do async work in ASP.NET
(and webservices) is that it's the same threadpool that is servicing
your pages and webservices. So it's very easy to flood your
threadpool with async work such that your application is no longer
responsive. I'd suggest doing async work with your own threadpool.
Mike Woording has a great one that I've used before:

http://www.bearcanyon.com/dotnet/#threadpool
[Navin]Indeed. The question above is different a bit. Just for my
information, when using the system thread pool, is the web service A
sending one way request to web service B in above scenario is really
freed up when its worker thread is reused to server a queued request
from the pool.
 
N

Navin Mishra

Thanks...that was very helpful. BTW my web service uses other web services
and dispatches events to clients via TCP. It also being used by other web
services.


Brock Allen said:
Well, it's unclear. There was a lively discussion on DevelopMentor's
listservs just this past 2 weeks on the topic. Here were the 3 more
relevant posts:

http://discuss.develop.com/archives/wa.exe?A2=ind0503c&L=advanced-dotnet&T=0&F=&S=&P=1712

http://discuss.develop.com/archives/wa.exe?A2=ind0503c&L=advanced-dotnet&T=0&F=&S=&P=1829

http://discuss.develop.com/archives/wa.exe?A2=ind0503e&L=advanced-dotnet&T=0&F=&S=&P=3211

You still have the issue of how to handle your response back to your
client (I assume your code is in a asp.net page of webserice and it's
using another webservice to do something interesting). So you still have
to make your webservice an async one from ASP.NET's perspective. Fritz has
an article on how to do this for pages, but I don't see why it wouldn't
also work for web services (BTW, his article was what kicked off the above
discussion in the first place):

http://msdn.microsoft.com/msdnmag/issues/03/06/Threading/default.aspx



Thanks for response. If I call another web service C from my web
service B, wouldn't an I/O thread be used ? And, in which case, making
the web service B's web method asynschronous to call web sevice C
asynchronously would help ? I saw that recommendation in MSDN.
Wouldn't I/O thread be also used when web service sends data
asynschronously over a socket connection ? More comments below:

1. Is maxIothreads parameter used still in IIS 6 ? For processing
web
service requests, I don't see ASp.NET AvailableIOThreads going down
?
If I use another web service from my web service, would IO thread be
used
or worker thread ?
IOThreads are no longer used to service requests in IIS6.

2. My web service is used by another web service(A) which sends a
one-way
request to my web service and I want to free up that consumer web
service A
as soon as possible. So, I use ThreadPool.QueueUserWorkItem to qeuee
request
for procssing. I see the thread pool thread is the SAME as the
request
thread used by A web service. Is that normal ? Is the web service A
really
freed-up ?
The concern with using the thread pool to do async work in ASP.NET
(and webservices) is that it's the same threadpool that is servicing
your pages and webservices. So it's very easy to flood your
threadpool with async work such that your application is no longer
responsive. I'd suggest doing async work with your own threadpool.
Mike Woording has a great one that I've used before:

http://www.bearcanyon.com/dotnet/#threadpool
[Navin]Indeed. The question above is different a bit. Just for my
information, when using the system thread pool, is the web service A
sending one way request to web service B in above scenario is really
freed up when its worker thread is reused to server a queued request
from the pool.
 
N

Navin Mishra

Is there any example of implementing HTTPAsyncHandlers for web services ? It
turns out that asynchronous web methods are not a solution for my secnario.
I want to handle a web request in a separate thread which hosts an object
which must be used in THAT thread only beacuse of its thread-affinity. I
want to wait in ASP.NET web service method until the utility object has
returned results.

Is it possible using HTTPAsyncHandlers or any other mechanism ?

Thanks in advance and regards

Navin

Brock Allen said:
Well, it's unclear. There was a lively discussion on DevelopMentor's
listservs just this past 2 weeks on the topic. Here were the 3 more
relevant posts:

http://discuss.develop.com/archives/wa.exe?A2=ind0503c&L=advanced-dotnet&T=0&F=&S=&P=1712

http://discuss.develop.com/archives/wa.exe?A2=ind0503c&L=advanced-dotnet&T=0&F=&S=&P=1829

http://discuss.develop.com/archives/wa.exe?A2=ind0503e&L=advanced-dotnet&T=0&F=&S=&P=3211

You still have the issue of how to handle your response back to your
client (I assume your code is in a asp.net page of webserice and it's
using another webservice to do something interesting). So you still have
to make your webservice an async one from ASP.NET's perspective. Fritz has
an article on how to do this for pages, but I don't see why it wouldn't
also work for web services (BTW, his article was what kicked off the above
discussion in the first place):

http://msdn.microsoft.com/msdnmag/issues/03/06/Threading/default.aspx



Thanks for response. If I call another web service C from my web
service B, wouldn't an I/O thread be used ? And, in which case, making
the web service B's web method asynschronous to call web sevice C
asynchronously would help ? I saw that recommendation in MSDN.
Wouldn't I/O thread be also used when web service sends data
asynschronously over a socket connection ? More comments below:

1. Is maxIothreads parameter used still in IIS 6 ? For processing
web
service requests, I don't see ASp.NET AvailableIOThreads going down
?
If I use another web service from my web service, would IO thread be
used
or worker thread ?
IOThreads are no longer used to service requests in IIS6.

2. My web service is used by another web service(A) which sends a
one-way
request to my web service and I want to free up that consumer web
service A
as soon as possible. So, I use ThreadPool.QueueUserWorkItem to qeuee
request
for procssing. I see the thread pool thread is the SAME as the
request
thread used by A web service. Is that normal ? Is the web service A
really
freed-up ?
The concern with using the thread pool to do async work in ASP.NET
(and webservices) is that it's the same threadpool that is servicing
your pages and webservices. So it's very easy to flood your
threadpool with async work such that your application is no longer
responsive. I'd suggest doing async work with your own threadpool.
Mike Woording has a great one that I've used before:

http://www.bearcanyon.com/dotnet/#threadpool
[Navin]Indeed. The question above is different a bit. Just for my
information, when using the system thread pool, is the web service A
sending one way request to web service B in above scenario is really
freed up when its worker thread is reused to server a queued request
from the pool.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,009
Latest member
GidgetGamb

Latest Threads

Top