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
from
a dedicated machine ((or cluster). The ‘static’ things include
javascript
and style sheets.
The reality is that a UNIX box is caching a lot of things - the pages of
the
files that contain the binary of the Ruby interpreter, the text files
that
make up the code for RoR and the application, and of course the
directory
and i-node information for all those files.
So when you cache fragments or pages, the OS sees them as competing with
all
this.
If the ‘static’ pages are taking up space in the system cache then they
are
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
page
use check algorithm, and so eat CPU cycles.
Please don’t try to tweak the VM caching. I’ve found that even the
“poorer”
(by whatever critiqued) virtual memory systems are better than
application
programmers think.
The best short term solution is to throw more memory on the machine.
You
may need one of the enhanced kernels. Many are built for a 4Gig limit,
but
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
experiment.
Don’t expect to get it right the first time!
–
Follow your inclinations with due regard to the policeman round the
corner.
W. Somerset Maugham, ‘Of Human Bondage’, 1915