Some questions on ASP.NET web services on IIS 6

Discussion in 'ASP .Net Web Services' started by Navin Mishra, Mar 31, 2005.

  1. Navin Mishra

    Navin Mishra Guest

    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
     
    Navin Mishra, Mar 31, 2005
    #1
    1. Advertising

  2. Navin Mishra

    Brock Allen Guest

    > 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

    -Brock
    DevelopMentor
    http://staff.develop.com/ballen
     
    Brock Allen, Mar 31, 2005
    #2
    1. Advertising

  3. Navin Mishra

    Navin Mishra Guest

    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" <> wrote in message
    news:...
    >> 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.
    >
    > -Brock
    > DevelopMentor
    > http://staff.develop.com/ballen
    >
    >
    >
     
    Navin Mishra, Mar 31, 2005
    #3
  4. Navin Mishra

    Brock Allen Guest

    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

    -Brock
    DevelopMentor
    http://staff.develop.com/ballen



    > 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" <> wrote in message
    > news:...
    >
    >>> 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.
    >
    >> -Brock
    >> DevelopMentor
    >> http://staff.develop.com/ballen
     
    Brock Allen, Mar 31, 2005
    #4
  5. Navin Mishra

    Navin Mishra Guest

    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" <> wrote in message
    news:...
    > 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
    > -Brock
    > DevelopMentor
    > http://staff.develop.com/ballen
    >
    >
    >
    >> 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" <> wrote in message
    >> news:...
    >>
    >>>> 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.
    >>
    >>> -Brock
    >>> DevelopMentor
    >>> http://staff.develop.com/ballen

    >
    >
    >
     
    Navin Mishra, Apr 1, 2005
    #5
  6. Navin Mishra

    Navin Mishra Guest

    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" <> wrote in message
    news:...
    > 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
    > -Brock
    > DevelopMentor
    > http://staff.develop.com/ballen
    >
    >
    >
    >> 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" <> wrote in message
    >> news:...
    >>
    >>>> 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.
    >>
    >>> -Brock
    >>> DevelopMentor
    >>> http://staff.develop.com/ballen

    >
    >
    >
     
    Navin Mishra, Apr 26, 2005
    #6
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Mufasa
    Replies:
    2
    Views:
    343
    Michael Nemtsev
    Apr 19, 2007
  2. Jon Davis
    Replies:
    3
    Views:
    603
    Jon Davis
    Jun 21, 2007
  3. L. Liu
    Replies:
    0
    Views:
    141
    L. Liu
    Mar 3, 2006
  4. John
    Replies:
    4
    Views:
    451
  5. Namshub

    Some daft Questions About web Services

    Namshub, Sep 5, 2007, in forum: ASP .Net Web Services
    Replies:
    1
    Views:
    122
    John Saunders [MVP]
    Sep 5, 2007
Loading...

Share This Page