Reputation: 2881
I am hosting a rails 3 app on a cloud VPS using apache passenger which talks to memcached and redis. For simplicity, let us assume all these services are running on the machine.
I have the ability to dynamically add more memory to this server without rebooting the VPS. I was wondering what is the best practice in "telling" apache passenger/memcached/redis that new memory is available to be used. Is this something these services detect automatically? Do I have to restart my server/memcached/redis for the new memory to be useful? I hope not...
Would appreciate any thoughts.
Upvotes: 2
Views: 326
Reputation: 2244
Not sure on all the pieces of your stack, but passenger threads simply grow as they need more memory and your box will start hitting swap when it runs out. So basically it views your box as having infinite memory anyway. In the case of passenger threads adding memory should be fine and will be used if each of your passenger threads keep growing in memory footprint. But to increase the max number of threads passenger will run, in order to really use the new memory you add, you will need to restart apache, as that is set in your httpd configuration.
For things like memcached, the size of the cache is determined when you start memcached so adding memory will not increase your memcached size. Same goes for anything which you configure its max memory usage, they will all most likely require you to change the configuration and restart.
Upvotes: 2