Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW

Re: Forcing modperl processes to restart after N requests

by McA (Priest)
on Oct 12, 2012 at 18:03 UTC ( #998760=note: print w/replies, xml ) Need Help??

in reply to Forcing modperl processes to restart after N requests


The simplest solution is to let Apache handle it: There is a configuration parameter MaxRequestsPerChild. On default installations it's set relativly high. Tweak it for you mod_perl centric processes.

Look at for some hints on memory usage.

Look for documentation of $r->child_terminate. With that method you can force the Apache child to exit gracefully at the end of the whole request lifetime. Combined with a process global counter you could implement an own controlled way of exiting after an certain count of requests. With this way you could be sure that a certain amount of perl handled requests were served (using Apache for static and dynamic content).

Best regards

P.S.: mod_perl mailing list is the right target for these questions. Thorsten Förtsch regularly answer fast and very competent. (

Replies are listed 'Best First'.
Re^2: Forcing modperl processes to restart after N requests
by alain_desilets (Beadle) on Oct 12, 2012 at 19:57 UTC

    Sounds like MaxRequestsPerChild is what I need. Thx.

    Strangely enough, I didn't come across it, even after 30 mins of google for things like "mod_perl forcing process to restart".

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://998760]
[Corion]: First World Problems - on my new desk, the sun shines in my face :)
[LanX]: damn sun ...blame Ophelia!
[choroba]: Yesterday, I gave Ramirez a headshot through the gate in Aztec. LOL. What happened to you? WTF? Sun. There was a hole in the window foil.

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (14)
As of 2017-10-18 13:58 GMT
Find Nodes?
    Voting Booth?
    My fridge is mostly full of:

    Results (245 votes). Check out past polls.