1. Accelerating 417east

    Recently I’ve been experimenting with methods for decreasing load on 417east. Currently it hosts 38 virtual hosts running on nginx: a few Rack applications passed through mod_rack; half are passed through PHP-FPM; the rest being static HTML sites. The server also runs sshd and afpd (so Mac users smile), and tends to run low on memory if applications leak.

    • First, I switched from Apache to Nginx.

      Nginx is much faster at serving static assets, and since there are so many simple sites running on the server, this immediately speeds up the environment for those users.

    • PHP5-FPM

      Rather than use a more traditional fast-cgi solution for nginx, I went with PHP-FPM, which has the ability to spawn and scale back instances of PHP applications with greater flexibility. Typically performance is just below apache+mod_php, but that’s alright since the static assets those sites are working with become much faster.

    • Varnish

      Just recently I decided to add an additional caching layer atop nginx. nginx now listens on 8000 and receives filtered requests from Varnish, so that often a website won’t hit the web server layer at all. Imeplementing this is literally as easy as installing Varnish and changing your web server’s ports. I found some help on StackOverflow with writing a basic VCL.