Professional Web Applications Themes

COM+ app does not shut down when idle if created from an ASP page - ASP

Our web application is layered broadly as follows: - Classic ASP pages: accept HTTP requests, forward them on to the Web App COM+ components and output the response. - Web App COM+ components: processes requests forwarded onto them by ASP pages, invoke the relevant business rule and data access methods, generate responses using XSLT and return them to the ASP pages for output. -Business Rule and Data Access COM+ components: implement the business rule and data access methods. The Web App, Business Rules and Data Access COM+ components are grouped together into separate COM+ applications (a.k.a. packages). Each application is ...

  1. #1

    Default COM+ app does not shut down when idle if created from an ASP page

    Our web application is layered broadly as follows:

    - Classic ASP pages: accept HTTP requests, forward them on to the Web App
    COM+ components and output the response.
    - Web App COM+ components: processes requests forwarded onto them by ASP
    pages, invoke the relevant business rule and data access methods, generate
    responses using XSLT and return them to the ASP pages for output.
    -Business Rule and Data Access COM+ components: implement the business rule
    and data access methods.

    The Web App, Business Rules and Data Access COM+ components are grouped
    together into separate COM+ applications (a.k.a. packages). Each application
    is configured to shut down after 3 minutes of being idle (using the server
    process shut down option in Component Services).

    The problem we are experiencing is that the Web App COM+ application is
    never shutting down (the business rule and data access applications are).
    Bizarrely, however, the problem goes away once the Web App COM+ application
    has been shut down manually using Component Services—and returns when the
    server is next rebooted. Windows 2000, 2003 and XP all seem to be affected.

    Obviously there could be any number of causes; however, I have managed to
    reproduce this behaviour with a few very simple test cases.

    Test 1
    ------

    1. Create a new COM+ server application named TestApp1. Use default values
    for all settings except idle shutdown time which should be set to 1 minute
    2. Create a new ActiveX DLL named Test1.dll containing a single, empty,
    multiuse class named CTest1
    3. Compile Test1.dll and add it to the TestApp1 COM+ application
    4. Create a new virtual directory
    5. Create a new ASP page named test1.asp in the new virtual directory. This
    page should contain the following code:

    <% Language=VBScript %>
    <%
    Dim obj
    Set obj = Server.CreateObject("Test1.CTest1")
    Set obj = Nothing
    %>

    6. Reboot the server
    7. Browse to Running Processes in Component Services
    8. Load test1.asp > TestApp1 will start up
    9. Wait two minutes > TestApp1 will still be running (it shouldn’t)
    10. Manually shut down TestApp1
    11. Load test1.asp > TestApp1 will start up
    12. Wait just over one minute > TestApp1 will shut down

    Conclusions

    - The problem has nothing to do with the code in our COM+ components
    - The problem only manifests itself from the moment the server is booted up
    until the first time the affected COM+ application is shut down

    Test 2:

    1. Create a new COM+ application named TestApp2. Again, use default values
    for all settings except idle shutdown time which should be set to 1 minute
    2. Create a new ActiveX DLL named Test2.dll containing a single multiuse
    class named CTest2 with the following public method:

    Public Sub Test()
    Dim objTest1 As CTest1
    Set objTest1 = CreateObject("Test1.CTest1")
    Set objTest1 = Nothing
    End Sub

    3. Compile Test2.dll and add it to the TestApp2 COM+ application
    4. Create a new ASP page named test2.asp in the virtual directory created
    for test 1. This page should contain the following code:

    <% Language=VBScript %>
    <%
    Dim obj
    Set obj = Server.CreateObject("Test2.CTest2")
    Call obj.Test
    Set obj = Nothing
    %>

    5. Reboot the server
    6. Browse to Running Processes in Component Services
    7. Load test2.asp > TestApp1 and TestApp2 will start up
    8. Wait just over one minute > TestApp1 will shut down, TestApp2 will not
    (it should)
    9. Manually shut down the TestApp2
    10. Load test2.asp > TestApp1 and TestApp2 will start up
    11. Wait just over one minute > TestApp1 and TestApp2 will shut down

    Conclusions:

    - COM+ applications whose components are created by other components are
    unaffected.

    Test 3:

    1. Create a standard executable containing only the following code:

    Sub Main()
    Dim obj As CTest2
    Set obj = CreateObject("Test2.CTest2")
    obj.Test
    Set obj = Nothing
    End Sub

    2. Reboot the server
    3. Browse to Running Processes in Component Services
    4. Run the executable > TestApp1 and TestApp2 will start up
    5. Wait just over one minute > TestApp1 and TestApp2 will shut down

    Conclusions:

    - This issue does not affect applications whose components are created by
    standard executables.

    Putting this all together it seems that:

    - Only applications whose components are created directly by ASP pages are
    affected (so perhaps more of an IIS or ASP issue than a COM+ issue)
    - The problem only manifests itself when the server is first booted up
    - The problem exists in Windows 2000 and 2003.
    Has anyone else been experiencing the same issues? And if so, does anyone
    have a solution?
    Stephen F Guest

  2. #2

    Default RE: COM+ app does not shut down when idle if created from an ASP page

    I should also add that we have found a workaround for Windows 2003 server
    which is to use COM+ application recycling with the following parameters:

    For testing:
    - Idle shutdown time: 1 minute
    - Lifetime limit: 1 minute
    - Expiration time: 1 minute
    (The COM+ application will shut down after a maximum of 2 minutes from the
    moment it is started)

    For production
    - Idle shutdown time: 3 minutes (default)
    - Lifetime limit: 120 minutes
    - Expiration time: 720 minutes

    Unfortunately, Windows 2000 (which is used by a significant proportion of
    our clients) does not support application recycling, so we're still no closer
    to a solution for those systems.
    Stephen F Guest

  3. #3

    Default RE: COM+ app does not shut down when idle if created from an ASP p

    Hi,

    I am too getting the same problem. The COM+ components are not cleared
    either from classic ASP or even when using it as an interop from .Net
    applications.

    But your post gave me some insight, how it could be a problem in the
    ASP/COM/MTS implemenetation from Microsfot.

    Can any one please help on this.

    Ragards,
    Madan

    "Stephen F" wrote:
    > I should also add that we have found a workaround for Windows 2003 server
    > which is to use COM+ application recycling with the following parameters:
    >
    > For testing:
    > - Idle shutdown time: 1 minute
    > - Lifetime limit: 1 minute
    > - Expiration time: 1 minute
    > (The COM+ application will shut down after a maximum of 2 minutes from the
    > moment it is started)
    >
    > For production
    > - Idle shutdown time: 3 minutes (default)
    > - Lifetime limit: 120 minutes
    > - Expiration time: 720 minutes
    >
    > Unfortunately, Windows 2000 (which is used by a significant proportion of
    > our clients) does not support application recycling, so we're still no closer
    > to a solution for those systems.
    Madan Guest

Similar Threads

  1. .LCK file created for every page in my site.
    By vsc171x2jj in forum Macromedia Contribute Connection Administrtion
    Replies: 2
    Last Post: October 6th, 07:34 AM
  2. Page kick off if idle more than 10 minutes
    By samkry in forum Dreamweaver AppDev
    Replies: 1
    Last Post: May 20th, 12:36 AM
  3. COM+ Application will not shut down after idle shutdown time
    By Tony Goncalves in forum ASP Components
    Replies: 1
    Last Post: November 12th, 07:21 PM
  4. Change web page not created in Publisher
    By David Bartosik - MS MVP in forum Web Design
    Replies: 0
    Last Post: December 12th, 03:29 AM
  5. Resizing a flash page already created
    By Dixon webforumsuser@macromedia.com in forum Macromedia Flash Sitedesign
    Replies: 1
    Last Post: September 18th, 01:21 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139