# Putting a request lifetime on fcgi processes

**URL:** <https://www.ruby-forum.com/t/putting-a-request-lifetime-on-fcgi-processes/103730>\
**Category:** Rails\
**Created:** [May 9, 2007, 7:25pm UTC](https://www.ruby-forum.com/t/putting-a-request-lifetime-on-fcgi-processes/103730 "2007-05-09T19:25:03Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![SteveC](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/ecb155/32.png) [@SteveC](https://www.ruby-forum.com/u/SteveC)\
**Post date:** [May 9, 2007, 7:25pm UTC](https://www.ruby-forum.com/t/putting-a-request-lifetime-on-fcgi-processes/103730/1 "2007-05-09T19:25:03Z")

</div>

Hello

We have a big rails app ([openstreetmap.org](http://openstreetmap.org)) which has memory leaks.  
It’s running with the script/process scripts under lighttpd. What  
we’re doing is restarting (killing) the processes every couple of  
hours to stop them swapping and using spawner -r to magically restart  
the threads.

We’d like to restart the threads after 500 requests, or something  
nicer and not lose the process queue. Has anyone done this or have  
any advice on the best way?

(Yes, we’d love to have the time to find the leaks but are  
firefighting right now)

TIA

have fun,

SteveC | removed\_email\_address@domain.invalid | [http://www.asklater.com/steve/](http://www.asklater.com/steve/)
