Varnish is Running out of Control!

A slug walking across a keyboardMy servers now a days run Varnish simply for the speed. On my main site Varnish was getting out of control with the RAM / Memory usage. Varnish would slowly creep up and eat all the memory, even though I was trying to hack Varnish to only use 128MB of ram, especially since the site is hosted on a lowendbox by Frantech (Buyvm.net). The answer, which I am not really sure WHY it works, but inside of vcl_fetch in the /etc/varnish/*.vcl file, I had set beresp.grace to be 30M, I tried this with 2M as well, but ultimately I took out the grace period setting and now my box is running Varnish with Lighttpd and PHP-FPM getting around 15k-30k unique hits a day and not going over 156MB of RAM usage.

In the end, if you were like me and tried everything you could think of to stop your server from running out of memory but nothing seemed to work. Try my little trick of either removing the grace period or setting it to something like 30s-2m and see if that improves your varnish setup.

No Comments

Leave us a comment

No comment posted yet.

Leave a Comment

↑ BACK TO THE TOP ↑