I have configured varnish on a Digital Ocean server and installed Drupal varnish module. I have confirmed that varnish is running but once i do a test on my site using blazemeter.com the server CPU goes at 100% during the test duration ( 20 minutes)

root@gtdev:~#  curl -SLIXGET
HTTP/1.1 200 OK
Server: nginx
Date: Wed, 11 May 2016 09:57:53 GMT
Content-Type: text/html; charset=utf-8
Transfer-Encoding: chunked
Connection: keep-alive
Vary: Accept-Encoding
X-Drupal-Cache: MISS
X-Content-Type-Options: nosniff
Content-Language: ar
X-Generator: Drupal 7 (http://drupal.org)
Cache-Control: public, max-age=21600
Expires: Sun, 19 Nov 1978 05:00:00 GMT
Vary: Accept-Encoding
Etag: "1462960672-1"
Last-Modified: Wed, 11 May 2016 09:57:52 GMT
X-Varnish: 373674512
Age: 0
Via: 1.1 varnish

Drupal Varnish Module Configuratoin:

$conf['cache_backends'][] = 'sites/all/modules/varnish/varnish.cache.inc';
$conf['cache_class_cache_page'] = 'VarnishCache';
$conf['page_cache_invoke_hooks'] = false;
$conf['reverse_proxy'] = true;
$conf['cache'] = 1;
$conf['cache_lifetime'] = 0;
$conf['page_cache_maximum_age'] = 21600;
$conf['reverse_proxy_header'] = 'HTTP_X_FORWARDED_FOR';
$conf['reverse_proxy_addresses'] = array('');
$conf['omit_vary_cookie'] = true;

enter image description here

isvarnishworking.com says that it is working as "Sort Of". So if its working then why the CPU is on 100% usage any idea ?

  • Maybe your CPU is very slow and 100% actually isn't much horsepower at all? It's quite difficult to guess at the problem without access to the servers to debug
    – Clive
    May 11 '16 at 10:34
  • Its 8GB Ram, i am paying 80$ a month to Digital Ocean.
    – brainHax
    May 11 '16 at 10:35
  • If i can do some thing to get some value in "X-Drupal-Cache" and "Age" , it might fix the problem.
    – brainHax
    May 11 '16 at 10:36
  • Just noticed the MISS so ignore my comment (at least until that becomes a HIT and you still see the same CPU spike)
    – Clive
    May 11 '16 at 10:45
  • does not show any miss, it means Drupal has the problem somewhere.
    – brainHax
    May 11 '16 at 10:49

Your Answer

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

Browse other questions tagged or ask your own question.