I am running my own webserver on a 384MB VPS from Slicehost to serve two Ruby on Rails applications on separate Virtual Hosts. I am running Phusion Passenger with Apache2. The following is the contents of my Passenger.conf

<IfModule passenger_module>

PassengerRoot /opt/ruby-enterprise-1.8.6-20090610/lib/ruby/gems/1.8/gems/passenger-2.2.11
PassengerLogLevel 0
PassengerRuby /usr/local/bin/ruby
PassengerUserSwitching on
PassengerDefaultUser nobody
PassengerMaxPoolSize 3
PassengerMaxInstancesPerApp 2 
PassengerPoolIdleTime 300

# Ruby on Rails Options

RailsAutoDetect on
RailsSpawnMethod smart

NameVirtualHost *:80
</IfModule>

If i do a 'top' on my server I have 314MB used on average, this seems like too much? Am I mistaken and if not what possible steps can I take to reduce the Memory usage?

Thanks!

link|improve this question
feedback

1 Answer

It all depends on the applications you are trying to host. The more models / controllers an application has the bigger the application will be. To get a better feel for how much the rails application itself is using try issuing the command.

passenger-memory-stats

My medium-sized application at this moment is using:

### Total private dirty RSS: 68.93 MB

According to passenger. If you have a bunch of sites running on the same passenger instance it could look more like:

### Total private dirty RSS: 1489.46 MB

Also consider that if you run a stock mysql-server the settings are not really optimized for VPS (and thus low memory) usage.

link|improve this answer
### Total private dirty RSS: 79.12 MB – Hamish Oct 1 '10 at 10:13
I do have 11 Apache processes running though it that normal? – Hamish Oct 1 '10 at 10:14
Yeah that's possible, you can edit your apache.conf to make it use less proccesses. I would check out top and sort by memory usage to find out what's really using your memory. – Naram Oct 1 '10 at 10:31
Mem: 405612k total, 356656k used, 48956k free, 81848k buffers Swap: 786424k total, 22832k used, 763592k free, 74124k cached – Hamish Oct 1 '10 at 11:43
16865 app_esta 20 0 269m 69m 2608 S 0 17.6 01.13 ruby 16830 root 20 0 71684 16m 2552 S 0 4.1 00.18 ruby 18138 www-data 20 0 100m 15m 5592 S 0 3.9 00.12 php – Hamish Oct 1 '10 at 11:44
feedback

Your Answer

 
or
required, but never shown

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