Carl W. said the following on 02/15/2007 01:19 AM:
How optimized is the app? Can you get rails to do less work using caches
page? Is the app public so we can have a look to get some ideas?
Caching is not always a good strategy
It assumes that the items being cached have a high rate of reuse.
There are many circumstances where this does not apply.
Ebay, for example, has factored out the ‘static’ pages and serves them
a dedicated machine ((or cluster). The ‘static’ things include
and style sheets.
The reality is that a UNIX box is caching a lot of things - the pages of
files that contain the binary of the Ruby interpreter, the text files
make up the code for RoR and the application, and of course the
and i-node information for all those files.
So when you cache fragments or pages, the OS sees them as competing with
If the ‘static’ pages are taking up space in the system cache then they
loading down your ability to cache fragments and dynamic pages. Even if
they don’t get flushed, they still present a load t the virtual memory
use check algorithm, and so eat CPU cycles.
Please don’t try to tweak the VM caching. I’ve found that even the
(by whatever critiqued) virtual memory systems are better than
The best short term solution is to throw more memory on the machine.
may need one of the enhanced kernels. Many are built for a 4Gig limit,
its easy to build or procure one for a 64Gig limit - just make sure you
don’t pick the ones built for a laptop or desktop
The longer term solution is to study what Google, Yahoo, EBay and others
have done and written about, make measurements of your own system and
Don’t expect to get it right the first time!
Follow your inclinations with due regard to the policeman round the
W. Somerset Maugham, ‘Of Human Bondage’, 1915