I am running a rails app (Passenger and nginx with mongodb and memcached) app on a ubuntu VPS (1GB RAM)- from a couple of days, I see that after starting nginx, ruby process slowly takes up all the memory of the box even though there are no requests on the server. new_relic shows the following
top Output
top - 12:02:23 up 2:47, 1 user, load average: 0.03, 0.02, 0.00
Tasks: 16 total, 1 running, 15 sleeping, 0 stopped, 0 zombie
Cpu(s): 0.1%us, 0.0%sy, 0.0%ni, 99.9%id, 0.0%wa, 0.0%hi, 0.0%si, 0.0%st
Mem: 1048576k total, 1048576k used, 0k free, 0k buffers
Swap: 0k total, 0k used, 0k free, 0k cached
9993 mongodb 18 0 128m 29m 21m S 0 2.9 0:17.06 mongod
1135 nobody 18 0 71664 18m 856 S 0 1.8 0:00.55 memcached
14310 passenge 15 0 500m 434m 4660 S 0 42.5 0:13.59 ruby
15496 passenge 15 0 425m 360m 4648 S 0 35.3 0:13.06 ruby
I think there is some code leaking memory - or I need to somehow kill costly ruby processes on passenger whenever they reach some threshold. Please share some thoughts on both these issues.