サーバのメモリ不足
赖洪礼的 blog » Saving memory in Ruby on Rails with fork() and copy-on-write
これを読んでみると,FastCgiでもMogrelでも,1つのRails Processに20MB〜30MBのメモリが食われるらしい.で,筆者は,My web server has “only” 1 GB of RAM.だとおっしゃる.なるほど僕のサーバがSwapしまくるわけだ...
今は,Mogrelで2アプリx3プロセス,計6プロセス起動させているので,最低でも120MBは常にメモリを消費してることになる.サーバのメモリは,256MBしか積んでないのに,これは厳しすぎる.
で,調べてみたらその通りだった.6プロセスで140MB消費してる.
mogrel cluster停止時
total used free shared buffers cached Mem: 255300 101132 154168 0 1516 25976 -/+ buffers/cache: 73640 181660 Swap: 524280 116468 407812