Webapplications quits without matter in ASP.NET 2.0

  • Thread starter Thread starter Sebastian Loncar
  • Start date Start date
S

Sebastian Loncar

Hallo NG,
i've big online game with a lots of requests per second and it uses a lot of
memory. the game runs as an ASP.NET application and holts all the game data
in the memory. The game has 1600 players.

Since a changed the server (from Windows 2003 32 Bit, 2GB RAM) to a new
Server "Windows 2003 64 Bit, 4 CPU's, 8 GB RAM) and upgraded the game from
Framework 1.1 to 2.0(its compiled als class library as in 1.1), there is a
big problem now.

Everything works fine, but sometimes, the ASP.NET application quits without
matter and theres no information in the Event Log of Windows. All recycling
options in the own apppool are disabled, of course!

The applications is designed for only one instance at the same time. If my
application receives a "Application_Quit"-Event in the Global.asax, the i
save alle data to disk and terminate the process(w3wp.exe) with a kill,
because sometimes, some threads hangs. But the kill is not the problem, on
the old server all works very fine.

But on the new Server, the application receives a Application_Quit without
matter and then, bevor the data is saved and the process terminated, a
second child-process is created whitin the same w3wp.exe. I down know if
first the process is created and than first process will be quitted, or if
the applications quits and iis starts a second child-process(appdomain),
while the first applications is quitting to save time. it happens at the
same time.

Here is a reconstruction:

[26.02.2006 16:40:00] App1: My Applications starts
[26.02.2006 17:03:13] App1: My Application logs the recieved Quit-Event to
the own application log. Why does it quit???
[26.02.2006 17:03:13] App2: My Applications starts a second time, but the
first app isn't terminated jet!
[26.02.2006 17:09:42] App1: My Application has saved all data know in will
now execute the Kill.
[26.02.2006 17:09:42] App2: Theres now response in the Logfile at this time.
Matter: The kill of app 1
[26.02.2006 17:09:47] A new application will be startet now...

My Problem is NOT, that two apps runs at the same time, i know how i could
work arround that. The problem is, why quits the application without matter
and starts a second application!

Please help me und you help 1600 players...

For Information: My application uses more than 3 GB of Memory, this should
not be the Problem because it's Windows 2003 64 Bit with 8 GB RAM(in Windows
2003 64 each Process "could" have 8 TB of Memory).
 
My Problem is NOT, that two apps runs at the same time, i know how i could
work arround that. The problem is, why quits the application without
matter and starts a second application!

Please help me und you help 1600 players...


I had a simular problem, and solved it by change the way IIS recycles the
application.

-> in the IIS manager, go to "Application pools" and create a fresh pool.
-> under "recycling" manually set the Max. Memory to the value of your
desire.

If you don't specify maximum memory, the pool seems to recycle it self
whenever it hits around 200MB or so (maybe diffrent for your machine).

Unless your application is very well tested for memory leaks, it is
recommended that you allow it to recycle at least once in a while.

Rune
 
To add to that,(this seems likely to be the cause) there are other metrics
that IIS uses to monitor the health of the application pool that your app is
running in. If an unhealthy pool is detected, IIS automatically recycles the
pool. Were you ever running out of memory on the previous version? Why did
you switch to a newer server with more ram?

--
Regards,
Alvin Bruney [MVP ASP.NET]

[Shameless Author plug]
The Microsoft Office Web Components Black Book with .NET
Now Available @ www.lulu.com/owc
Forth-coming VSTO.NET - Wrox/Wiley 2006
 
Hallo Alvin,
my old Server had 2 GB Memory - my Application shared it with MSSQL-Server
and some other Programms. I received a out-of-memory exception, when my
application uses more than 1.1 GB of Memory.

The new Server is 64 Bit(windows server 2003 64bit) and has 8 GB RAM, my
Application uses 2-3 GB of Memory, because it uses now .NET 2.0 - in .NET
2.0 the DataTable uses more than 60% of Memory. But Memory is not the
Problem, the server has a lot of Memory.

What could be the unhealthy? Where can i see it? Nothing is logged in the
Event Log. I've deactivated the Kill on Application_Quit, to see, if the
Host-Process want to write some important information in to the event log -
nothing.

Because the game has 1600 players(it's a massive multiplayer online game), i
had to handle very fast, so i decided to use .NET 1.1 in a 32-Bit-IIS-Mode.
But i have to use 2.0 soon, because of the memory usage.

Is it true, if i remove alle check-boxes in the recycling tab of the app
pool, the IIS stil recycles pool? And the workarround is to set a very high
value? I aks this because "Rune B" said this in this topic.

Sebastian

Alvin Bruney - ASP.NET MVP said:
To add to that,(this seems likely to be the cause) there are other metrics
that IIS uses to monitor the health of the application pool that your app
is
running in. If an unhealthy pool is detected, IIS automatically recycles
the
pool. Were you ever running out of memory on the previous version? Why did
you switch to a newer server with more ram?

--
Regards,
Alvin Bruney [MVP ASP.NET]

[Shameless Author plug]
The Microsoft Office Web Components Black Book with .NET
Now Available @ www.lulu.com/owc
Forth-coming VSTO.NET - Wrox/Wiley 2006
-------------------------------------------------------



Rune B said:
I had a simular problem, and solved it by change the way IIS recycles the
application.

-> in the IIS manager, go to "Application pools" and create a fresh pool.
-> under "recycling" manually set the Max. Memory to the value of your
desire.

If you don't specify maximum memory, the pool seems to recycle it self
whenever it hits around 200MB or so (maybe diffrent for your machine).

Unless your application is very well tested for memory leaks, it is
recommended that you allow it to recycle at least once in a while.

Rune
 
I assume thru all this that you are using the appropriate /gigabyte switches
for the application server right?
But Memory is not the
Problem, the server has a lot of Memory.
That conclusion is not necessarily correct. The only thing I can think of at
this time is for you to start adding some performance counters to the
application to determine what the problem is.
Is it true, if i remove alle check-boxes in the recycling tab of the app
pool, the IIS stil recycles pool? And the workarround is to set a very high
value? I aks this because "Rune B" said this in this topic.
Not necessarily, there are about 3 tabs that relate to health and
application pools. You'd need to set each tab appropriately for the
application pool property dialog.

--
Regards,
Alvin Bruney [MVP ASP.NET]

[Shameless Author plug]
The Microsoft Office Web Components Black Book with .NET
Now Available @ www.lulu.com/owc
Forth-coming VSTO.NET - Wrox/Wiley 2006
-------------------------------------------------------



Sebastian Loncar said:
Hallo Alvin,
my old Server had 2 GB Memory - my Application shared it with MSSQL-Server
and some other Programms. I received a out-of-memory exception, when my
application uses more than 1.1 GB of Memory.

The new Server is 64 Bit(windows server 2003 64bit) and has 8 GB RAM, my
Application uses 2-3 GB of Memory, because it uses now .NET 2.0 - in .NET
2.0 the DataTable uses more than 60% of Memory. But Memory is not the
Problem, the server has a lot of Memory.

What could be the unhealthy? Where can i see it? Nothing is logged in the
Event Log. I've deactivated the Kill on Application_Quit, to see, if the
Host-Process want to write some important information in to the event log -
nothing.

Because the game has 1600 players(it's a massive multiplayer online game), i
had to handle very fast, so i decided to use .NET 1.1 in a 32-Bit-IIS-Mode.
But i have to use 2.0 soon, because of the memory usage.

Is it true, if i remove alle check-boxes in the recycling tab of the app
pool, the IIS stil recycles pool? And the workarround is to set a very high
value? I aks this because "Rune B" said this in this topic.

Sebastian

Alvin Bruney - ASP.NET MVP said:
To add to that,(this seems likely to be the cause) there are other metrics
that IIS uses to monitor the health of the application pool that your app
is
running in. If an unhealthy pool is detected, IIS automatically recycles
the
pool. Were you ever running out of memory on the previous version? Why did
you switch to a newer server with more ram?

--
Regards,
Alvin Bruney [MVP ASP.NET]

[Shameless Author plug]
The Microsoft Office Web Components Black Book with .NET
Now Available @ www.lulu.com/owc
Forth-coming VSTO.NET - Wrox/Wiley 2006
-------------------------------------------------------



Rune B said:
My Problem is NOT, that two apps runs at the same time, i know how i could
work arround that. The problem is, why quits the application without
matter and starts a second application!

Please help me und you help 1600 players...


I had a simular problem, and solved it by change the way IIS recycles the
application.

-> in the IIS manager, go to "Application pools" and create a fresh pool.
-> under "recycling" manually set the Max. Memory to the value of your
desire.

If you don't specify maximum memory, the pool seems to recycle it self
whenever it hits around 200MB or so (maybe diffrent for your machine).

Unless your application is very well tested for memory leaks, it is
recommended that you allow it to recycle at least once in a while.

Rune
 
Back
Top