High cpu when cache is full

Olivier Beau olivier at qalpit.com
Sun Jul 27 21:29:56 CEST 2008


Hi,

I'm running trunk on rhel5 64 bit and have a 30G cache storage.
When the cache went 100% full, varnish started to do some cleaning.
-> is this a heavy operation or locking something up ?
(the number of workers jump from 20 to 500 for a minute or so)

The cache went down to 80% full in a couple minutes and still going down two
hours later
-> when will the cleaning stop ?

We had relative high cpu load (went up to 5 load average instend of under 1
normaly..)

I saw lots of logs like those in varnishlog:
104 VCL_call     c discard
104 VCL_return   c discard
0 ExpKill      - 1316381337 LRU

And this in varnishtop:
1614.08 VCL_retur discard
1611.10 VCL_call  discard
722.34 VCL_retur deliver

-> i guess the cleaning is cpu intensive; is there a way to control it or is it
done automagicaly ?


i'm attaching a graph of a couple metrics from varnishstat
(i pretty sure the number of workers going up and down right now is caused by
the cleaning/cpu load)

here's some more info if needed :

# varnishstat  -1  | grep object
n_object              1097629          .   N struct object
n_objecthead          1097631          .   N struct objecthead
n_expired                7335          .   N expired objects
n_lru_nuked            305646          .   N LRU nuked objects
n_lru_saved                 0          .   N LRU saved objects
n_lru_moved           1330623          .   N LRU moved objects
n_deathrow                  0          .   N objects on deathrow
#

# ps auxw |grep varnishd
root     15585  0.0  0.0  61124   724 pts/0    S+   19:18   0:00 grep varnishd
root     22799  0.0  0.0 105468   636 ?        Ss   Jul25   0:00
/usr/sbin/varnishd -a :80 -T localhost:6082 -f /etc/varnish/default.vcl -u
varnish -g varnish -p lru_interval 3600 -h classic,150001 -s
file,/data/varnish/tmp/varnish_storage.bin,30G -P /var/run/varnish.pid
varnish  22802  1.2 79.0 33679432 3200060 ?    Sl   Jul25  46:35
/usr/sbin/varnishd -a :80 -T localhost:6082 -f /etc/varnish/default.vcl -u
varnish -g varnish -p lru_interval 3600 -h classic,150001 -s
file,/data/varnish/tmp/varnish_storage.bin,30G -P /var/run/varnish.pid
# 


one hour after the previous snip above :
# varnishstat  -1  | grep object
n_object               964181          .   N struct object
n_objecthead           964185          .   N struct objecthead
n_expired                7534          .   N expired objects
n_lru_nuked            480448          .   N LRU nuked objects
n_lru_saved                 0          .   N LRU saved objects
n_lru_moved           1378748          .   N LRU moved objects
n_deathrow                  0          .   N objects on deathrow
#



Olivier 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: varnish.png
Type: image/png
Size: 38211 bytes
Desc: not available
URL: <https://www.varnish-cache.org/lists/pipermail/varnish-misc/attachments/20080727/99c66bb7/attachment-0002.png>


More information about the varnish-misc mailing list