I've asked this question over at stackoverflow, but I thought someone here might have insight as well.

I've recently deployed my first Rails application on a Mac mini running Lion 10.7.2 with Apache and Phusion Passenger. It's a quad core machine with 2 gigs of ram on it. The server seems to be fine at first, handling only a handful of requests. However, after the requests start increasing it locks up. This is my first server deployment of ROR and I'm not quit sure what I should be checking. I've looked at the ruby processes running and it has around 5 or 6.

The application is extremely database and AJAX intensive.

I've read through other posts about optimizing Phusion Passenger, but it doesn't seem to help. My httpd.conf file looks like the following:

<VirtualHost *:80>
    ServerName http://domain.com/
    DocumentRoot /Users/lab/WebApplications/next_browse_app/public   
    PassengerSpawnMethod conservative

     # Speeds up spawn time tremendously -- if your app is compatible. 
     # RMagick seems to be incompatible with smart spawning
     RailsSpawnMethod smart

     # Keep the application instances alive longer. Default is 300 (seconds)
     PassengerPoolIdleTime 1000

     # Keep the spawners alive, which speeds up spawning a new Application
     # listener after a period of inactivity at the expense of memory.
     RailsAppSpawnerIdleTime 0

     # Just in case you're leaking memory, restart a listener 
     # after processing 5000 requests
     PassengerMaxRequests 5000
     PassengerMaxPoolSize 4
     PassengerMaxInstancesPerApp 4

 <Directory /Users/lab/WebApplications/next_browse_app/public>
     AllowOverride all              
Allow from all   
    Options -MultiViews            

Any help is very much appreciated! Thanks!


Have done diagnostic on apache and passenger when things starts to crawl ?

Please try tools like




wtop google code link

It should give you ideas what apache was doing realtime !

Passenger comes with nice tool which shows many memory related stuffs about rails server.


Since you mentioned you app is database intensive, have you checked if the database is the bottleneck !

Keep your eye on overall memory and CPU usage to get better ideas.

  • Thanks for your input Kaji, I'll check these tools out to try and diagnose the problem. Also, I've noticed that a few of my httpd processes seem to run wild. Are they suppose to exceed 300 mb? Thanks! – Phillip Whisenhunt Feb 1 '12 at 15:06
  • yeah it could very well happen with apache in prefork mode – kaji Feb 2 '12 at 2:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.