[Varnish] #897: sess_mem "leak" on hyper-threaded cpu

Varnish varnish-bugs at varnish-cache.org
Wed Apr 13 18:52:42 CEST 2011

#897: sess_mem "leak" on hyper-threaded cpu
 Reporter:  askalski                             |        Type:  defect
   Status:  new                                  |    Priority:  normal
Milestone:                                       |   Component:  build 
  Version:  trunk                                |    Severity:  major 
 Keywords:  sess_mem leak n_sess race condition  |  

Comment(by askalski):

 Attached is a patch that solves the race condition without locking in the
 acceptor thread (thanks to Mithrandir for pointing that out.)  It does so
 by splitting the "n_sess" statistic into "n_sess_new" (no mutex), and
 "n_sess_delete" (mutex, worker).  The worker threads then calculate the
 number of outstanding sessions by subtracting.  I didn't bother checking
 for counter overflow, because it would take 1000 years at a rate of 500+
 million sessions per second for that to happen.

Ticket URL: <http://www.varnish-cache.org/trac/ticket/897#comment:3>
Varnish <http://varnish-cache.org/>
The Varnish HTTP Accelerator

More information about the varnish-bugs mailing list