none
Seeking suggestions for making a web service more reliable RRS feed

  • Question


  • In a legacy scenario, web services were built upon complex C++-based business logic. I know question implies bad design and logic, but this is a legacy system and it is what it is, and we need to move forward.

    This business logic may under some scenarios, deadlock. Lets say we have a way to identify that a request/thread is dead-locked. Because of the way it is written (synchronized using locks () web methods), this locks up the app-pool and users can no longer enter that web site.

    1) Does IIS have a way of detecting this and restarting a particular web site?

    2) Does it make sense to write some kind of "watch-dog" service to restart a particular app-pool

    3) There is lots of discussion saying all new web services should be written using WCF instead of old style asmx. Would that solve this deadlock problem? If so, can someone provide details?

    What options are available? What is the best way to address this legacy situation?

    Thanks

    Friday, May 3, 2013 1:56 PM

Answers

  • Hi,

    WCF provides three important types of concurrency, Single, Multiple, and Reentrant. If you want to create AsyncPattern operations with non-blocking, you can set ConcurrencyMode mode to ConcurrencyMode.Multiple to allow multiple requests to increase throughput, the default is ConcurrencyMode.Single. Read more from a blog below:

    #WCF Concurrency (Single, Multiple, and Reentrant) and Throttling

    http://www.codeproject.com/Articles/89858/WCF-Concurrency-Single-Multiple-and-Reentrant-and

    Hope this information can help you.

    Best Regards.


    Haixia
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Monday, May 6, 2013 8:39 AM
    Moderator

  • Hi Rickey,

    WCF is the current recommended component for creating server-side services upon .NET Framework platform. Although, it is naturally multi-threading and provide simplified code logic for us to develop web services. And as other members have sugested, you can take advantage of the built-in concurrency or throttling settings to control the multi-threading behaviors. But for issues like dead-lock or resource racing conditions, we still need to take good care of them at the service designing stage.

    And for hosting environment like IIS web host, it does offer some configurations which can help perform process/application recycle upon certain condidtions (such as memory usage or max request number reach a certain limit or threshold.


     
    #Configuring Recycling Settings for an Application Pool (IIS 7)
    http://technet.microsoft.com/en-us/library/cc753179(v=WS.10).aspx

    #Managing, Tuning, and Configuring Application Pools in IIS 7.0
    http://technet.microsoft.com/en-us/library/cc745955.aspx


    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Wednesday, May 8, 2013 3:02 AM
    Moderator

All replies

  • On 5/3/2013 9:56 AM, Rickey Tom wrote:

    Maybe, you'll get the answers you seek about IIS.

    http://forums.iis.net/

    Friday, May 3, 2013 11:18 PM
  • Hi,

    WCF provides three important types of concurrency, Single, Multiple, and Reentrant. If you want to create AsyncPattern operations with non-blocking, you can set ConcurrencyMode mode to ConcurrencyMode.Multiple to allow multiple requests to increase throughput, the default is ConcurrencyMode.Single. Read more from a blog below:

    #WCF Concurrency (Single, Multiple, and Reentrant) and Throttling

    http://www.codeproject.com/Articles/89858/WCF-Concurrency-Single-Multiple-and-Reentrant-and

    Hope this information can help you.

    Best Regards.


    Haixia
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Monday, May 6, 2013 8:39 AM
    Moderator

  • Hi Rickey,

    WCF is the current recommended component for creating server-side services upon .NET Framework platform. Although, it is naturally multi-threading and provide simplified code logic for us to develop web services. And as other members have sugested, you can take advantage of the built-in concurrency or throttling settings to control the multi-threading behaviors. But for issues like dead-lock or resource racing conditions, we still need to take good care of them at the service designing stage.

    And for hosting environment like IIS web host, it does offer some configurations which can help perform process/application recycle upon certain condidtions (such as memory usage or max request number reach a certain limit or threshold.


     
    #Configuring Recycling Settings for an Application Pool (IIS 7)
    http://technet.microsoft.com/en-us/library/cc753179(v=WS.10).aspx

    #Managing, Tuning, and Configuring Application Pools in IIS 7.0
    http://technet.microsoft.com/en-us/library/cc745955.aspx


    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Wednesday, May 8, 2013 3:02 AM
    Moderator