High memory use with Rails + Passenger + Apache


#1

I’ve got a server to host a basic Rails app ( < 2MB in total size). The
server is running Apache 2.2.14 and Passenger 2.2.7

Testing on my web server goes like this:

  • Apache stopped: 8% memory allocated (of 1GB)

  • Apache started: 51% memory now allocated, ~400MB gets allocated after
    starting apache

  • Visit my server to look at my app: memory allocation goes from 51% to
    90% from just that one request, causes a 10 second delay on the first
    page load, spikes CPU use up to 100% for a number of seconds, and memory
    allocation sits at 90%.

  • The site is then really responsive and runs fine. Once passenger
    processes start to time out due to inactivity memory allocation goes
    back down to 51%.

  • Re-visit app after an hour or so: Another large sustained spike in
    memory use, short burst of CPU use

Is this normal? I’ve tried to find some good resources on Passenger +
Apache and memory use yet nothing really seems to explain both why
passenger sucks up every drop of available memory and how to limit the
memory passenger consumes.