Application seems fine on VS2005 development server but randomly resets the production server

Discussion in 'ASP.NET / ASP.NET Core' started by dcinematoda, Jul 27, 2006.

Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.
  1. Hi-

    I?m looking for guidance debugging a problem I?m having with my ASP.Net application when running on DiscountASP.net servers.

    Problem and observations:

    The application appears to run fine on my VS 2005 development server but frequently resets the production server at DiscountASP.net. When the server resets itself, I loose the session states and frequently encounter an exception of some sorts ? object not found or such. The production server reset seems to randomly occur during database updates.

    It seems something in my code is eating memory (as if it was a memory leak ASP.NET?) and going over the server?s 100MB per application limit, and causing IIS6 to reset the application. I do use lots of tables and the application is quite complex. Still, I can?t get it to fail when running locally with the development server in VS 2005.

    I need help and suggestions as to the technique and general approach to solving this problem. I?ve not done much remote debugging on this level and need a place to start.

    - What performance counters or measurement tools can I set locally to track this?

    - Can I set up my VS2005 dev. server so it is operating with the same memory constraints as the production IIS6 server?

    - What can be done as far as diagnostics on the server side to help get a handle on what is going wrong?

    Any suggestions will be appreciated


    Bill
     
  2. Bruce

    Bruce DiscountASP.NET Staff

    1) All you need to do is check the W3WP.exe process's memory usage

    2) No. I don't think Cassini web server allows you to restrict mem usage.

    3) Memory leak is one of the hardest thing to trace. Some common cause are

    a) You load a large text file (xml, text,eetc.) into memory
    b) You have a large MS Access DB. This is why we do not recommend MS Access because it gets loaded into memory.
    c) you load a lot of assemblies.

    If you are experiencing recycling that cause your application to fail (session lost, etc.), I recommend you switch your application to use MS SQL session. See http://kb.discountasp.net/article.aspx?id=10350

    Hope this helps!!



    Bruce

    DiscountASP.NET
    www.DiscountASP.NET
     
  3. Bruce

    Bruce DiscountASP.NET Staff

    IMHO, 115MB is too much. Just pop up your task manager, even the notoriously demanding IE process do not use as much memory. Most website (ASP.NET) we host uses about 30 -60 MB.

    It is not possible for us to increase the memory usage on a per site basis because it will affect other users. We host each website in its own application pool and thus we have to restrict usage.


    nope. IIS 5.0 do not have the notion of Application Pool.



    Billmead said...
    3. RE: memory leak: I am using MSSQL2000 DB, all is managed code and so I thought the memory usage was dynamically allocated, and therefore wouldn't be a problem. My general question is how do I make a big asp.net application run in a smaller memory footprint?

    Not really. You can manually invoke the garbage collection process after you are done with the resource. Microsoft promised that ASP.NET has automatic garbage collection but in my experience, the GC kicks in too slowly (I am not sure what is the algorithm behind it but it seems like it runs in a preset interval).

    Some references:

    http://www.codeproject.com/dotnet/garbagecollection.asp
    http://msdn.microsoft.com/msdnmag/issues/05/01/ASPNETPerformance/(this a good article that talks about how to increase performance. See tip #3)
    http://www.codeproject.com/managedcpp/garbage_collection.asp
    http://www.codecomments.com/archive289-2004-3-160554.html



    Billmead said...
    . Re MS SQL session. Will change to sql session, but seems like a band-aid if real problem is either not enough menory or excessive memory consumption. I'm concerned about the performance hit. Can I use existing database account?

    Yes. You should be able to use your existing database unless you have name conflicts (which is highly unlikely)

    Hope this helps[/quote][/quote]

    Bruce

    DiscountASP.NET
    www.DiscountASP.NET
     
  4. Thanks Bruce,
    That was quite helpful and I would like to ask a few more questions. It appears my application is exceeding the 100MB limit and recycling the server.
    Re: ASP Memory usage measurement. I'm dealing with a dozen or so fairly large SQL tables. Some of the tables are cached in the applications object. My WebDev.WedServer.exe memory usage starts at around 50 Megs when I start the application and it grows after more tables are opened. It seems to stabilize around 90Megs with peaks to over 115 Meg. Is that way too much? If I got it right, that explains the server resets. Is it possible I just need more memory?
    2. Restricting memory usage on dev server. It seems a basic flaw in the IDE if you can't simulate memory restrictions on the production server. Can it be done with IIS5 ?
    3. RE: memory leak: I am using MSSQL2000 DB, all is managed code and so I thought the memory usage was dynamically allocated, and therefore wouldn't be a problem. My general question is how do I make a big asp.net application run in a smaller memory footprint?
    4. Re MS SQL session. Will change to sql session, but seems like a band-aid if real problem is either not enough menory or excessive memory consumption. I'm concerned about the performance hit. Can I use existing database account?
    Thanks again for your help!

    Bill
     
Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.

Share This Page