Varnish leaking memory?

Augusto Becciu augusto at jadedpixel.com
Mon Apr 19 16:21:05 CEST 2010


Hey Guys,

I'm running Varnish 2.0.6 in a production linux server with the
following parameters:

varnishd -P /var/run/varnishd.pid -a 0.0.0.0:2000 -T 127.0.0.1:6082 -w
200,2000 -s malloc,14G -p lru_interval=5 -f /etc/varnish/varnish.vcl

The server has a total of 17G of RAM and no swap at all. When the
cache reached its limit of 14G, varnish started nuking objects and
everything looked good. However, it sill continues to allocate more
and more memory without releasing it. Memory usage growth is very slow
though. Also the committed memory is like 24.2G now and keeps growing
steady. Is that normal?

Here's the output of varnishstat -1:

 uptime                 416905          .   Child uptime
client_conn           1445639         3.47 Client connections accepted
client_drop                 0         0.00 Connection dropped, no sess
client_req           10977250        26.33 Client requests received
cache_hit             8316582        19.95 Cache hits
cache_hitpass               2         0.00 Cache hits for pass
cache_miss            2660450         6.38 Cache misses
backend_conn            15761         0.04 Backend conn. success
backend_unhealthy            0         0.00 Backend conn. not attempted
backend_busy                0         0.00 Backend conn. too many
backend_fail          3990792         9.57 Backend conn. failures
backend_reuse         2644716         6.34 Backend conn. reuses
backend_toolate         15693         0.04 Backend conn. was closed
backend_recycle       2660401         6.38 Backend conn. recycles
backend_unused              0         0.00 Backend conn. unused
fetch_head                  0         0.00 Fetch head
fetch_length          2659445         6.38 Fetch with Length
fetch_chunked               0         0.00 Fetch chunked
fetch_eof                   0         0.00 Fetch EOF
fetch_bad                   0         0.00 Fetch had bad headers
fetch_close                 0         0.00 Fetch wanted close
fetch_oldhttp               0         0.00 Fetch pre HTTP/1.1 closed
fetch_zero                  0         0.00 Fetch zero len
fetch_failed                0         0.00 Fetch failed
n_srcaddr                   0          .   N struct srcaddr
n_srcaddr_act               0          .   N active struct srcaddr
n_sess_mem                 98          .   N struct sess_mem
n_sess                      9          .   N struct sess
n_object               547004          .   N struct object
n_objecthead           547002          .   N struct objecthead
n_smf                       0          .   N struct smf
n_smf_frag                  0          .   N small free smf
n_smf_large                 0          .   N large free smf
n_vbe_conn       18446744073709551613          .   N struct vbe_conn
n_bereq                    73          .   N struct bereq
n_wrk                     400          .   N worker threads
n_wrk_create              400         0.00 N worker threads created
n_wrk_failed                0         0.00 N worker threads not created
n_wrk_max                   0         0.00 N worker threads limited
n_wrk_queue                 0         0.00 N queued work requests
n_wrk_overflow              0         0.00 N overflowed work requests
n_wrk_drop                  0         0.00 N dropped work requests
n_backend                   5          .   N backends
n_expired              213948          .   N expired objects
n_lru_nuked           1899467          .   N LRU nuked objects
n_lru_saved                 0          .   N LRU saved objects
n_lru_moved           8001207          .   N LRU moved objects
n_deathrow                  0          .   N objects on deathrow
losthdr                   155         0.00 HTTP header overflows
n_objsendfile               0         0.00 Objects sent with sendfile
n_objwrite            9855464        23.64 Objects sent with write
n_objoverflow               0         0.00 Objects overflowing workspace
s_sess                1445638         3.47 Total Sessions
s_req                10977251        26.33 Total Requests
s_pipe                      2         0.00 Total pipe
s_pass                     27         0.00 Total pass
s_fetch               2660410         6.38 Total fetch
s_hdrbytes         4952053163     11878.13 Total header bytes
s_bodybytes      185370067623    444633.83 Total body bytes
sess_closed           1144421         2.75 Session Closed
sess_pipeline               1         0.00 Session Pipeline
sess_readahead              0         0.00 Session Read Ahead
sess_linger          10660820        25.57 Session Linger
sess_herd             3188841         7.65 Session herd
shm_records         608766401      1460.20 SHM records
shm_writes           22498443        53.97 SHM writes
shm_flushes               487         0.00 SHM flushes due to overflow
shm_cont                 9651         0.02 SHM MTX contention
shm_cycles                244         0.00 SHM cycles through buffer
sm_nreq                     0         0.00 allocator requests
sm_nobj                     0          .   outstanding allocations
sm_balloc                   0          .   bytes allocated
sm_bfree                    0          .   bytes free
sma_nreq              7220096        17.32 SMA allocator requests
sma_nobj              1093874          .   SMA outstanding allocations
sma_nbytes        15032380353          .   SMA outstanding bytes
sma_balloc        68029864865          .   SMA bytes allocated
sma_bfree         52997484512          .   SMA bytes free
sms_nreq                  213         0.00 SMS allocator requests
sms_nobj                    0          .   SMS outstanding allocations
sms_nbytes                  0          .   SMS outstanding bytes
sms_balloc              99681          .   SMS bytes allocated
sms_bfree               99681          .   SMS bytes freed
backend_req           2660474         6.38 Backend requests made
n_vcl                       1         0.00 N vcl total
n_vcl_avail                 1         0.00 N vcl available
n_vcl_discard               0         0.00 N vcl discarded
n_purge                     1          .   N total active purges
n_purge_add                 1         0.00 N new purges added
n_purge_retire              0         0.00 N old purges deleted
n_purge_obj_test            0         0.00 N objects tested
n_purge_re_test             0         0.00 N regexps tested against
n_purge_dups                0         0.00 N duplicate purges removed
hcb_nolock                  0         0.00 HCB Lookups without lock
hcb_lock                    0         0.00 HCB Lookups with lock
hcb_insert                  0         0.00 HCB Inserts
esi_parse                   0         0.00 Objects ESI parsed (unlock)
esi_errors                  0         0.00 ESI parse errors (unlock)


Thanks in advance.

Augusto




More information about the varnish-dev mailing list