# High memory use with Rails + Passenger + Apache

**URL:** <https://www.ruby-forum.com/t/high-memory-use-with-rails-passenger-apache/222261>\
**Category:** Deployment\
**Created:** [August 20, 2012, 5:26pm UTC](https://www.ruby-forum.com/t/high-memory-use-with-rails-passenger-apache/222261 "2012-08-20T17:26:17Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![aris](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/258eb7/32.png) [@aris](https://www.ruby-forum.com/u/aris)\
**Post date:** [August 20, 2012, 5:26pm UTC](https://www.ruby-forum.com/t/high-memory-use-with-rails-passenger-apache/222261/1 "2012-08-20T17:26:17Z")

</div>

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.
