views:

93

answers:

2

How does one control the application recycle settings for an ASP.NET application runnin on mod_mono & Apache ?

On IIS6 & 7 there was an option to specify either a time period, a number of requests, etc. when the AppDomain would be recycled and the application would basically do an Application_End() / Application_Start().

I am seeing the same behaviour on mod_mono & Apache ,but I can't find where to change the settings.

A: 

Judging by this link that explains the Fast CGI module, I would guess there would need to be a script that is run periodically by the cron job to kill the process and restart it... I do not know if this would be of any help to you. You did not state what OS, I am making an assumption that this is on a Win Platform? If you are on a Windows platform, then it would be easy enough to schedule a script to restart the Mod_Mono extension in effect "recycling"...

tommieb75
A: 

Here it is, from http://www.mono-project.com/Mod_mono#Automatic_restart_of_the_mod-mono-server_backend

SO formatting is a little off, but basically you can restart mod-mono-server process ( running under apache ) by time or requests using this configuration.

Automatic restart of the mod-mono-server backend

mod_mono can automatically restart the Mono (mod-mono-server) backend that is handling requests after a certain amount of time. This is useful if you find that the mono process is growing indefinitely over time, or if you just need to make sure you clean house every so often.

There are two automatic restart methods: one based on time, and one based on the number of requests served. You can active them as follows:

Auto-restart after three hours. 1 MonoAutoRestartMode Time 2 MonoAutoRestartTime 00:03

The time format above is DD[:HH[:MM[:SS]]].

Auto-restart after 10,000 requests served. 1 MonoAutoRestartMode Requests 2 MonoAutoRestartRequests 10000

As with most other mod_mono directives, the first parameter to a directive can be the name or alias of a mod-mono-server. This is always optional and is omitted in the examples above.

kervin