Just added Varnish to the config of this server and the blog should now be loading within 30ms 🙂
This is just a test post to see if cache is purged on new posts.

UPDATE: Works just fine! Now to minify css & js and add expire headers to all statics (if they aren’t set yet) in nginx.
UPDATE2: So the blog is fully minified and expire headers are being set. Varnish is running in front of it and if you’re lucky you will see response times of around 12ms 🙂

So I just ditched my previous VPS at TransIP and setup my new one at DigitalOcean since they are cheaper, faster and still have a location in Amsterdam. For the same price as TransIP I also get a backup service and a really, really nice interface to handle my server. The disk bandwidth is insane, all the way up to 340MB/s compared to my old 70MB/s max.

So far I’m very happy! Note to self on setting up nginx though, check the fastcgi_params file to make sure it looks like the block below, otherwise it won’t work:

Specifically the SCRIPT_FILENAME, otherwise you will just get white pages.

Just need to store this somewhere in case I need it again for work. This config will sync a (Magento) website to another server and exclude a few directories as well.

Lsyncd.conf

Lsyncd.exclude

Then we need to increase inotify.max_user_watches since we are dealing with a huge site (for after reboot):

And add at the end:

To change the running server without rebooting (this is not permanent unless to you changed sysctl.conf as well!)

UPDATE: This is now outdated. You should have a look at /etc/default/hhvm which will point to /etc/hhvm/server.ini. It’s a lot easier and upgrade-safe than the post below.


 

Turns out HHVM (HipHop Virtual Machine, made by Facebook) is fairly usable in it’s current state. To quickly get up and running with something that works you don’t even need to install a webserver (although it is recommended if you want to offload static files and add gzip compression).

For Debian 7 you can use the following lines of code:

I strong recommend editing the /etc/init.d/hvvm to allow it to listen to port 9000 so we can use it as FastCGI (like PHP-FPM). If you are familiar with PHP-FPM in Nginx for example this should strike you as ideal: it’s basically a drop-in replacement for PHP-FPM! This blog is now running on hhvm but the other sites on this VPS are still running under PHP-FPM through socket.

Open your /etc/init.d/hhvm and add the following to the command:

Mind you this will break with each update, Facebook is still looking into making a FastCGI version of Nightly which does not change this file.

Here’s a complete copy of my /etc/init.d/hhvm