Experience with Varnish!

When Mellowhost first launched her servers, all of them were using “DSO” module for serving php. I can remember, one of the most commonly used caching plugin was either Eaccelerator or Xcache. Eaccelerator was preferable as cpanel Easyapache have this in their option and can be compiled automatically while rebuilding apache. As time passed, we had to choose suphp instead of dso due to many factors involved. I hope to write them down at later time why we had to move to suphp. But that actually cut the idea of using dynamic cacher in the server. Suphp kills the php process after serving, this allows all the opcode cacher to be valueless. Due to cutting off a dynamic cacher, the server started showing pretty good load average. Although it was a good trade off of IO and CPU usage in cost of security. I was searching for a cacher that would work with suphp in the same technique Litespeed (A paid web server software) does.

I was looking at the varnish and it seems the varnish was designed just as I was expecting to solve the problem with an on memory caching. I tried “Memcache” before, but to achieve the maximum of Memcache, it is essential to design the script for Memcache. Expecting which is pretty unusual in a shared hosting server.

I finally tried Varnish with one of our heaviest server with a TTL set for php scripts at 60 seconds. It was returning approximately 20% hit rate which is pretty low to be honest. Although, in different times the hit rate increases to 40%. I was concerned about the cache miss penalty although, it doesn’t seem to be hurting a lot to the server in contrast with the hit rate. The biggest benefit I can see using Varnish in this server is the stable load average. The load average remains very stable for a long time. I am still in the process of assessing whether this small software can really improve the performance of shared servers or not which would lead the hoster to consider this as a viable solution and I am quite optimistic after seeing the experience till far.

Kudos to Kamp for developing such a nice software.  Happy Hosting!

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.