What would be the system tunables to enhance serving static content? Like increase/decrease swappines, how to max out disk caching and so on...

  • 1
    small or large files? – Karoly Horvath Jun 27 '11 at 22:50
  • Are you seeing much swap traffic with vmstat 1? – sarnold Jun 27 '11 at 22:51
  • I'm betting an untuned server, even a not very grunty one, could push out more content than a gigabit ethernet could take. Just make sure you've got enough memory so you're not swapping. – Paul Tomblin Jun 27 '11 at 23:36
  • The main optimization for static content would be to do some benchmarks to see if lighttpd is faster than apache. – Paul Tomblin Jun 27 '11 at 23:37
  • Just a few notes: I'm using nginx to serve that content; the average object size is 25k. My question is if you have some tips for optimizing the OS - have it to cache more aggressively, reduce the time to first byte sent over TCP, so on. Thanks. – Calin Don Jun 28 '11 at 11:31

If you're looking for hardcore static performance, look into nginx. A web server that specializes specifically in serving static content.

You will find that Apache can serve static content quite quickly too if you don't use complex features or .htaccess files, etc.

Caching and connection handling are best left to the tunable features of the service daemon you choose.

Technically for any form of IO/general performance you want 0 swappiness - as that correlates to a memory problem (either too little memory, poor use, or legitimate consumption).


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.