Application Pool recycling hangs

Discussion in 'ASP .Net' started by Wayne Smith, Apr 5, 2006.

  1. Wayne Smith

    Wayne Smith Guest

    Hi,

    We are having a few problems with ASP.Net pages hanging during load when an
    Application Pool is recycled. To test this we have setup the following
    ASP.net page which refreshes every 2 seconds:

    <%@ Page language="c#" %>
    <%@ Import Namespace="System" %>
    <%@ Import Namespace="System.IO" %>

    <script runat="server">
    void Page_Load(Object sender, System.EventArgs e)
    {
    Label1.Text = DateTime.Now.ToString();
    StreamWriter SW;
    SW=File.AppendText("c:/inetpub/wwwroot/log1.txt");
    SW.WriteLine(DateTime.Now);
    SW.Close();
    }
    </script>

    <html>
    <head>
    <title>Cache Test</title>
    <meta http-equiv="refresh" content="2">
    </head>
    <body>

    <form runat="server">
    <asp:label id="Label1" runat="server" />
    </form>
    </body>
    </html>

    I've also set the Application Pool that the site runs under in IIS 6.0 to
    Recycle every 1 minute (and set the Idle Timeout on the Performance tab to 1
    minute).

    The page seems to refresh ok for a while in the browser each 2 seconds but
    sometimes when the Application Pool recycles the page load hangs for over
    one minute and will eventually start going again. On another machine however
    it runs continuously without hanging.

    Does anyone have an idea as to what the hanging might be caused by?

    Thanks - Wayne.
    Wayne Smith, Apr 5, 2006
    #1
    1. Advertising

  2. Application Pool recycling is overlapping by default.

    If your app shares resources, make sure it works with this potential
    "concurrency".

    --
    //David
    IIS
    http://blogs.msdn.com/David.Wang
    This posting is provided "AS IS" with no warranties, and confers no rights.
    //

    "Wayne Smith" <> wrote in message
    news:...
    > Hi,
    >
    > We are having a few problems with ASP.Net pages hanging during load when
    > an Application Pool is recycled. To test this we have setup the following
    > ASP.net page which refreshes every 2 seconds:
    >
    > <%@ Page language="c#" %>
    > <%@ Import Namespace="System" %>
    > <%@ Import Namespace="System.IO" %>
    >
    > <script runat="server">
    > void Page_Load(Object sender, System.EventArgs e)
    > {
    > Label1.Text = DateTime.Now.ToString();
    > StreamWriter SW;
    > SW=File.AppendText("c:/inetpub/wwwroot/log1.txt");
    > SW.WriteLine(DateTime.Now);
    > SW.Close();
    > }
    > </script>
    >
    > <html>
    > <head>
    > <title>Cache Test</title>
    > <meta http-equiv="refresh" content="2">
    > </head>
    > <body>
    >
    > <form runat="server">
    > <asp:label id="Label1" runat="server" />
    > </form>
    > </body>
    > </html>
    >
    > I've also set the Application Pool that the site runs under in IIS 6.0 to
    > Recycle every 1 minute (and set the Idle Timeout on the Performance tab to
    > 1 minute).
    >
    > The page seems to refresh ok for a while in the browser each 2 seconds but
    > sometimes when the Application Pool recycles the page load hangs for over
    > one minute and will eventually start going again. On another machine
    > however it runs continuously without hanging.
    >
    > Does anyone have an idea as to what the hanging might be caused by?
    >
    > Thanks - Wayne.
    >
    David Wang [Msft], Apr 5, 2006
    #2
    1. Advertising

  3. Wayne Smith

    Wayne Smith Guest

    Even with the application pool set to recycle every 1900 minutes we were
    getting this issue of the page load hanging....


    "David Wang [Msft]" <> wrote in message
    news:...
    > Application Pool recycling is overlapping by default.
    >
    > If your app shares resources, make sure it works with this potential
    > "concurrency".
    >
    > --
    > //David
    > IIS
    > http://blogs.msdn.com/David.Wang
    > This posting is provided "AS IS" with no warranties, and confers no
    > rights.
    > //
    >
    > "Wayne Smith" <> wrote in message
    > news:...
    >> Hi,
    >>
    >> We are having a few problems with ASP.Net pages hanging during load when
    >> an Application Pool is recycled. To test this we have setup the following
    >> ASP.net page which refreshes every 2 seconds:
    >>
    >> <%@ Page language="c#" %>
    >> <%@ Import Namespace="System" %>
    >> <%@ Import Namespace="System.IO" %>
    >>
    >> <script runat="server">
    >> void Page_Load(Object sender, System.EventArgs e)
    >> {
    >> Label1.Text = DateTime.Now.ToString();
    >> StreamWriter SW;
    >> SW=File.AppendText("c:/inetpub/wwwroot/log1.txt");
    >> SW.WriteLine(DateTime.Now);
    >> SW.Close();
    >> }
    >> </script>
    >>
    >> <html>
    >> <head>
    >> <title>Cache Test</title>
    >> <meta http-equiv="refresh" content="2">
    >> </head>
    >> <body>
    >>
    >> <form runat="server">
    >> <asp:label id="Label1" runat="server" />
    >> </form>
    >> </body>
    >> </html>
    >>
    >> I've also set the Application Pool that the site runs under in IIS 6.0 to
    >> Recycle every 1 minute (and set the Idle Timeout on the Performance tab
    >> to 1 minute).
    >>
    >> The page seems to refresh ok for a while in the browser each 2 seconds
    >> but sometimes when the Application Pool recycles the page load hangs for
    >> over one minute and will eventually start going again. On another machine
    >> however it runs continuously without hanging.
    >>
    >> Does anyone have an idea as to what the hanging might be caused by?
    >>
    >> Thanks - Wayne.
    >>

    >
    >
    Wayne Smith, Apr 5, 2006
    #3
  4. Can you explain why changing recycling period will have any effect in your
    scenario?


    Remove the StreamWriter and File.AppendText() calls and see if it still
    hangs.

    If it stops hanging, you have a concurrency issue with the code you wrote.
    One way to address this is to turn off overlapping recycle, where IIS waits
    for the old process to terminate (and release its shared resource) before
    starting the new process to execute (and re-use the shared resource).

    --
    //David
    IIS
    http://blogs.msdn.com/David.Wang
    This posting is provided "AS IS" with no warranties, and confers no rights.
    //

    "Wayne Smith" <> wrote in message
    news:...
    > Even with the application pool set to recycle every 1900 minutes we were
    > getting this issue of the page load hanging....
    >
    >
    > "David Wang [Msft]" <> wrote in message
    > news:...
    >> Application Pool recycling is overlapping by default.
    >>
    >> If your app shares resources, make sure it works with this potential
    >> "concurrency".
    >>
    >> --
    >> //David
    >> IIS
    >> http://blogs.msdn.com/David.Wang
    >> This posting is provided "AS IS" with no warranties, and confers no
    >> rights.
    >> //
    >>
    >> "Wayne Smith" <> wrote in message
    >> news:...
    >>> Hi,
    >>>
    >>> We are having a few problems with ASP.Net pages hanging during load when
    >>> an Application Pool is recycled. To test this we have setup the
    >>> following ASP.net page which refreshes every 2 seconds:
    >>>
    >>> <%@ Page language="c#" %>
    >>> <%@ Import Namespace="System" %>
    >>> <%@ Import Namespace="System.IO" %>
    >>>
    >>> <script runat="server">
    >>> void Page_Load(Object sender, System.EventArgs e)
    >>> {
    >>> Label1.Text = DateTime.Now.ToString();
    >>> StreamWriter SW;
    >>> SW=File.AppendText("c:/inetpub/wwwroot/log1.txt");
    >>> SW.WriteLine(DateTime.Now);
    >>> SW.Close();
    >>> }
    >>> </script>
    >>>
    >>> <html>
    >>> <head>
    >>> <title>Cache Test</title>
    >>> <meta http-equiv="refresh" content="2">
    >>> </head>
    >>> <body>
    >>>
    >>> <form runat="server">
    >>> <asp:label id="Label1" runat="server" />
    >>> </form>
    >>> </body>
    >>> </html>
    >>>
    >>> I've also set the Application Pool that the site runs under in IIS 6.0
    >>> to Recycle every 1 minute (and set the Idle Timeout on the Performance
    >>> tab to 1 minute).
    >>>
    >>> The page seems to refresh ok for a while in the browser each 2 seconds
    >>> but sometimes when the Application Pool recycles the page load hangs for
    >>> over one minute and will eventually start going again. On another
    >>> machine however it runs continuously without hanging.
    >>>
    >>> Does anyone have an idea as to what the hanging might be caused by?
    >>>
    >>> Thanks - Wayne.
    >>>

    >>
    >>

    >
    >
    David Wang [Msft], Apr 5, 2006
    #4
  5. Wayne Smith

    Wayne Smith Guest

    Hi David,

    How do I turn off the overlapping recycle?

    Thanks.


    "David Wang [Msft]" <> wrote in message
    news:%...
    > Can you explain why changing recycling period will have any effect in your
    > scenario?
    >
    >
    > Remove the StreamWriter and File.AppendText() calls and see if it still
    > hangs.
    >
    > If it stops hanging, you have a concurrency issue with the code you wrote.
    > One way to address this is to turn off overlapping recycle, where IIS
    > waits
    > for the old process to terminate (and release its shared resource) before
    > starting the new process to execute (and re-use the shared resource).
    >
    > --
    > //David
    > IIS
    > http://blogs.msdn.com/David.Wang
    > This posting is provided "AS IS" with no warranties, and confers no
    > rights.
    > //
    >
    > "Wayne Smith" <> wrote in message
    > news:...
    >> Even with the application pool set to recycle every 1900 minutes we were
    >> getting this issue of the page load hanging....
    >>
    >>
    >> "David Wang [Msft]" <> wrote in message
    >> news:...
    >>> Application Pool recycling is overlapping by default.
    >>>
    >>> If your app shares resources, make sure it works with this potential
    >>> "concurrency".
    >>>
    >>> --
    >>> //David
    >>> IIS
    >>> http://blogs.msdn.com/David.Wang
    >>> This posting is provided "AS IS" with no warranties, and confers no
    >>> rights.
    >>> //
    >>>
    >>> "Wayne Smith" <> wrote in message
    >>> news:...
    >>>> Hi,
    >>>>
    >>>> We are having a few problems with ASP.Net pages hanging during load
    >>>> when
    >>>> an Application Pool is recycled. To test this we have setup the
    >>>> following ASP.net page which refreshes every 2 seconds:
    >>>>
    >>>> <%@ Page language="c#" %>
    >>>> <%@ Import Namespace="System" %>
    >>>> <%@ Import Namespace="System.IO" %>
    >>>>
    >>>> <script runat="server">
    >>>> void Page_Load(Object sender, System.EventArgs e)
    >>>> {
    >>>> Label1.Text = DateTime.Now.ToString();
    >>>> StreamWriter SW;
    >>>> SW=File.AppendText("c:/inetpub/wwwroot/log1.txt");
    >>>> SW.WriteLine(DateTime.Now);
    >>>> SW.Close();
    >>>> }
    >>>> </script>
    >>>>
    >>>> <html>
    >>>> <head>
    >>>> <title>Cache Test</title>
    >>>> <meta http-equiv="refresh" content="2">
    >>>> </head>
    >>>> <body>
    >>>>
    >>>> <form runat="server">
    >>>> <asp:label id="Label1" runat="server" />
    >>>> </form>
    >>>> </body>
    >>>> </html>
    >>>>
    >>>> I've also set the Application Pool that the site runs under in IIS 6.0
    >>>> to Recycle every 1 minute (and set the Idle Timeout on the Performance
    >>>> tab to 1 minute).
    >>>>
    >>>> The page seems to refresh ok for a while in the browser each 2 seconds
    >>>> but sometimes when the Application Pool recycles the page load hangs
    >>>> for
    >>>> over one minute and will eventually start going again. On another
    >>>> machine however it runs continuously without hanging.
    >>>>
    >>>> Does anyone have an idea as to what the hanging might be caused by?
    >>>>
    >>>> Thanks - Wayne.
    >>>>
    >>>
    >>>

    >>
    >>

    >
    >
    >
    Wayne Smith, Apr 6, 2006
    #5
  6. Wayne Smith

    Wayne Smith Guest

    Ok - i've found how to disable the overlapping recycle which I've done but
    it still seems to hang. It didn't stop either when I removed the
    StreamWriter and File.AppendText() calls.


    "Wayne Smith" <> wrote in message
    news:e$...
    > Hi David,
    >
    > How do I turn off the overlapping recycle?
    >
    > Thanks.
    >
    >
    > "David Wang [Msft]" <> wrote in message
    > news:%...
    >> Can you explain why changing recycling period will have any effect in
    >> your scenario?
    >>
    >>
    >> Remove the StreamWriter and File.AppendText() calls and see if it still
    >> hangs.
    >>
    >> If it stops hanging, you have a concurrency issue with the code you
    >> wrote.
    >> One way to address this is to turn off overlapping recycle, where IIS
    >> waits
    >> for the old process to terminate (and release its shared resource) before
    >> starting the new process to execute (and re-use the shared resource).
    >>
    >> --
    >> //David
    >> IIS
    >> http://blogs.msdn.com/David.Wang
    >> This posting is provided "AS IS" with no warranties, and confers no
    >> rights.
    >> //
    >>
    >> "Wayne Smith" <> wrote in message
    >> news:...
    >>> Even with the application pool set to recycle every 1900 minutes we were
    >>> getting this issue of the page load hanging....
    >>>
    >>>
    >>> "David Wang [Msft]" <> wrote in message
    >>> news:...
    >>>> Application Pool recycling is overlapping by default.
    >>>>
    >>>> If your app shares resources, make sure it works with this potential
    >>>> "concurrency".
    >>>>
    >>>> --
    >>>> //David
    >>>> IIS
    >>>> http://blogs.msdn.com/David.Wang
    >>>> This posting is provided "AS IS" with no warranties, and confers no
    >>>> rights.
    >>>> //
    >>>>
    >>>> "Wayne Smith" <> wrote in message
    >>>> news:...
    >>>>> Hi,
    >>>>>
    >>>>> We are having a few problems with ASP.Net pages hanging during load
    >>>>> when
    >>>>> an Application Pool is recycled. To test this we have setup the
    >>>>> following ASP.net page which refreshes every 2 seconds:
    >>>>>
    >>>>> <%@ Page language="c#" %>
    >>>>> <%@ Import Namespace="System" %>
    >>>>> <%@ Import Namespace="System.IO" %>
    >>>>>
    >>>>> <script runat="server">
    >>>>> void Page_Load(Object sender, System.EventArgs e)
    >>>>> {
    >>>>> Label1.Text = DateTime.Now.ToString();
    >>>>> StreamWriter SW;
    >>>>> SW=File.AppendText("c:/inetpub/wwwroot/log1.txt");
    >>>>> SW.WriteLine(DateTime.Now);
    >>>>> SW.Close();
    >>>>> }
    >>>>> </script>
    >>>>>
    >>>>> <html>
    >>>>> <head>
    >>>>> <title>Cache Test</title>
    >>>>> <meta http-equiv="refresh" content="2">
    >>>>> </head>
    >>>>> <body>
    >>>>>
    >>>>> <form runat="server">
    >>>>> <asp:label id="Label1" runat="server" />
    >>>>> </form>
    >>>>> </body>
    >>>>> </html>
    >>>>>
    >>>>> I've also set the Application Pool that the site runs under in IIS 6.0
    >>>>> to Recycle every 1 minute (and set the Idle Timeout on the Performance
    >>>>> tab to 1 minute).
    >>>>>
    >>>>> The page seems to refresh ok for a while in the browser each 2 seconds
    >>>>> but sometimes when the Application Pool recycles the page load hangs
    >>>>> for
    >>>>> over one minute and will eventually start going again. On another
    >>>>> machine however it runs continuously without hanging.
    >>>>>
    >>>>> Does anyone have an idea as to what the hanging might be caused by?
    >>>>>
    >>>>> Thanks - Wayne.
    >>>>>
    >>>>
    >>>>
    >>>
    >>>

    >>
    >>
    >>

    >
    >
    Wayne Smith, Apr 6, 2006
    #6
  7. To turn off overlapped recycling,
    set the DisallowOverlappingRotation metabase property to true.

    You will need to use the Metabase Explorer to do that.
    It's in the IIS 6.0 Resource Kit.

    Details :
    http://support.microsoft.com/default.aspx?scid=kb;en-us;840671#8

    Download:
    http://www.microsoft.com/downloads/...ee-a71a-4c73-b628-ade629c89499&displaylang=en




    Juan T. Llibre, asp.net MVP
    aspnetfaq.com : http://www.aspnetfaq.com/
    asp.net faq : http://asp.net.do/faq/
    foros de asp.net, en espaƱol : http://asp.net.do/foros/
    ===================================
    "Wayne Smith" <> wrote in message
    news:e$...
    > Hi David,
    >
    > How do I turn off the overlapping recycle?
    >
    > Thanks.
    >
    >
    > "David Wang [Msft]" <> wrote in message
    > news:%...
    >> Can you explain why changing recycling period will have any effect in your scenario?
    >>
    >>
    >> Remove the StreamWriter and File.AppendText() calls and see if it still
    >> hangs.
    >>
    >> If it stops hanging, you have a concurrency issue with the code you wrote.
    >> One way to address this is to turn off overlapping recycle, where IIS waits
    >> for the old process to terminate (and release its shared resource) before
    >> starting the new process to execute (and re-use the shared resource).
    >>
    >> --
    >> //David
    >> IIS
    >> http://blogs.msdn.com/David.Wang
    >> This posting is provided "AS IS" with no warranties, and confers no rights.
    >> //
    >>
    >> "Wayne Smith" <> wrote in message
    >> news:...
    >>> Even with the application pool set to recycle every 1900 minutes we were
    >>> getting this issue of the page load hanging....
    >>>
    >>>
    >>> "David Wang [Msft]" <> wrote in message
    >>> news:...
    >>>> Application Pool recycling is overlapping by default.
    >>>>
    >>>> If your app shares resources, make sure it works with this potential
    >>>> "concurrency".
    >>>>
    >>>> --
    >>>> //David
    >>>> IIS
    >>>> http://blogs.msdn.com/David.Wang
    >>>> This posting is provided "AS IS" with no warranties, and confers no
    >>>> rights.
    >>>> //
    >>>>
    >>>> "Wayne Smith" <> wrote in message
    >>>> news:...
    >>>>> Hi,
    >>>>>
    >>>>> We are having a few problems with ASP.Net pages hanging during load when
    >>>>> an Application Pool is recycled. To test this we have setup the
    >>>>> following ASP.net page which refreshes every 2 seconds:
    >>>>>
    >>>>> <%@ Page language="c#" %>
    >>>>> <%@ Import Namespace="System" %>
    >>>>> <%@ Import Namespace="System.IO" %>
    >>>>>
    >>>>> <script runat="server">
    >>>>> void Page_Load(Object sender, System.EventArgs e)
    >>>>> {
    >>>>> Label1.Text = DateTime.Now.ToString();
    >>>>> StreamWriter SW;
    >>>>> SW=File.AppendText("c:/inetpub/wwwroot/log1.txt");
    >>>>> SW.WriteLine(DateTime.Now);
    >>>>> SW.Close();
    >>>>> }
    >>>>> </script>
    >>>>>
    >>>>> <html>
    >>>>> <head>
    >>>>> <title>Cache Test</title>
    >>>>> <meta http-equiv="refresh" content="2">
    >>>>> </head>
    >>>>> <body>
    >>>>>
    >>>>> <form runat="server">
    >>>>> <asp:label id="Label1" runat="server" />
    >>>>> </form>
    >>>>> </body>
    >>>>> </html>
    >>>>>
    >>>>> I've also set the Application Pool that the site runs under in IIS 6.0
    >>>>> to Recycle every 1 minute (and set the Idle Timeout on the Performance
    >>>>> tab to 1 minute).
    >>>>>
    >>>>> The page seems to refresh ok for a while in the browser each 2 seconds
    >>>>> but sometimes when the Application Pool recycles the page load hangs for
    >>>>> over one minute and will eventually start going again. On another
    >>>>> machine however it runs continuously without hanging.
    >>>>>
    >>>>> Does anyone have an idea as to what the hanging might be caused by?
    >>>>>
    >>>>> Thanks - Wayne.
    >>>>>
    >>>>
    >>>>
    >>>
    >>>

    >>
    >>
    >>

    >
    >
    Juan T. Llibre, Apr 6, 2006
    #7
    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. Jeremy S.
    Replies:
    2
    Views:
    4,032
    Brock Allen
    Mar 28, 2005
  2. Morten Snedker
    Replies:
    2
    Views:
    384
    Morten Snedker
    Oct 18, 2007
  3. Aamir Mahmood
    Replies:
    1
    Views:
    1,451
    Peter Bromberg [C# MVP]
    May 28, 2008
  4. Oriane

    Recycling the pool

    Oriane, Aug 28, 2008, in forum: ASP .Net
    Replies:
    4
    Views:
    362
    Oriane
    Aug 28, 2008
  5. Oriane

    Pool recycling on IIS 6

    Oriane, Apr 1, 2009, in forum: ASP .Net
    Replies:
    11
    Views:
    2,753
    Oriane
    Apr 7, 2009
Loading...

Share This Page