[Varnish] #1490: Is not release destroyed thread

Varnish varnish-bugs at varnish-cache.org
Mon Apr 28 14:31:44 CEST 2014


#1490: Is not release destroyed thread
-------------------+----------------------
 Reporter:  xcir   |       Type:  defect
   Status:  new    |   Priority:  normal
Milestone:         |  Component:  varnishd
  Version:  4.0.0  |   Severity:  normal
 Keywords:         |
-------------------+----------------------
 Hi,
 I'm testing Varnish4 on my site.

 I noticed the thread is to continue to increase.

 {{{
 [root at gw02 varnish]# ps aux -L|grep varnish|wc -l
 1702
 [root at gw02 varnish]# varnishstat -1|grep threads
 MAIN.threads                     200          .   Total number of threads
 MAIN.threads_limited               0         0.00 Threads hit max
 MAIN.threads_created            1678         0.00 Threads created
 MAIN.threads_destroyed          1478         0.00 Threads destoryed
 MAIN.threads_failed                0         0.00 Thread creation failed
 }}}

 How to reproduce(artificially). And my log.

 {{{
 root at varnish4:~# varnishd -V
 varnishd (varnish-4.0.0 revision 2acedeb)
 Copyright (c) 2006 Verdens Gang AS
 Copyright (c) 2006-2011 Varnish Software AS

 root at varnish4:~# uname -a
 Linux varnish4 3.2.0-60-generic #91-Ubuntu SMP Wed Feb 19 03:54:44 UTC
 2014 x86_64 x86_64 x86_64 GNU/Linux

 root at varnish4:~# /etc/init.d/varnish restart
  * Stopping HTTP accelerator varnishd
    ...done.
  * Starting HTTP accelerator varnishd
    ...done.
 root at varnish4:~# varnishadm param.set thread_pool_timeout 10

 root at varnish4:~# varnishadm param.show|grep thread
 cc_command                 "exec gcc -std=gnu99 -g -O2 -fstack-protector
 --param=ssp-buffer-size=4 -Wformat -Wformat-security -Wall -Werror -Wno-
 error=unused-result -pthread -fpic -shared -Wl,-x -o %o %s" (default)
 thread_pool_add_delay      0.000 [seconds] (default)
 thread_pool_destroy_delay  1.000 [seconds] (default)
 thread_pool_fail_delay     0.200 [seconds] (default)
 thread_pool_max            5000 [threads] (default)
 thread_pool_min            100 [threads] (default)
 thread_pool_stack          48k [bytes] (default)
 thread_pool_timeout        10.000 [seconds]
 thread_pools               2 [pools] (default)
 thread_queue_limit         20 (default)
 thread_stats_rate          10 [requests] (default)
 workspace_thread           2k [bytes] (default)

 root at varnish4:~# varnishstat -1|grep thread
 MAIN.pools                         2          .   Number of thread pools
 MAIN.threads                     200          .   Total number of threads
 MAIN.threads_limited               0         0.00 Threads hit max
 MAIN.threads_created             200         3.03 Threads created
 MAIN.threads_destroyed             0         0.00 Threads destoryed
 MAIN.threads_failed                0         0.00 Thread creation failed
 MAIN.thread_queue_len              0          .   Length of session queue
 MAIN.sess_queued                   0         0.00 Sessions queued for
 thread
 MAIN.sess_dropped                  0         0.00 Sessions dropped for
 thread
 MAIN.exp_mailed                              0         0.00 Number of
 objects mailed to expiry thread
 MAIN.exp_received                            0         0.00 Number of
 objects received by expiry thread

 root at varnish4:~# ps aux -L |grep varnishd|grep nobody|wc -l
 217

 root at varnish4:~# varnishadm param.set thread_pool_min 5

 root at varnish4:~# varnishadm param.show|grep thread
 cc_command                 "exec gcc -std=gnu99 -g -O2 -fstack-protector
 --param=ssp-buffer-size=4 -Wformat -Wformat-security -Wall -Werror -Wno-
 error=unused-result -pthread -fpic -shared -Wl,-x -o %o %s" (default)
 thread_pool_add_delay      0.000 [seconds] (default)
 thread_pool_destroy_delay  1.000 [seconds] (default)
 thread_pool_fail_delay     0.200 [seconds] (default)
 thread_pool_max            5000 [threads] (default)
 thread_pool_min            5 [threads]
 thread_pool_stack          48k [bytes] (default)
 thread_pool_timeout        10.000 [seconds]
 thread_pools               2 [pools] (default)
 thread_queue_limit         20 (default)
 thread_stats_rate          10 [requests] (default)
 workspace_thread           2k [bytes] (default)

 root at varnish4:~# varnishstat -1|grep thread
 MAIN.pools                         2          .   Number of thread pools
 MAIN.threads                      10          .   Total number of threads
 MAIN.threads_limited               0         0.00 Threads hit max
 MAIN.threads_created             200         0.90 Threads created
 MAIN.threads_destroyed           190         0.85 Threads destoryed
 MAIN.threads_failed                0         0.00 Thread creation failed
 MAIN.thread_queue_len              0          .   Length of session queue
 MAIN.sess_queued                   0         0.00 Sessions queued for
 thread
 MAIN.sess_dropped                  0         0.00 Sessions dropped for
 thread
 MAIN.exp_mailed                              0         0.00 Number of
 objects mailed to expiry thread
 MAIN.exp_received                            0         0.00 Number of
 objects received by expiry thread

 root at varnish4:~# ps aux -L |grep varnishd|grep nobody|wc -l
 217 ##is not release

 root at varnish4:~# varnishadm param.set thread_pool_min 200

 root at varnish4:~# varnishstat -1|grep thread
 MAIN.pools                         2          .   Number of thread pools
 MAIN.threads                     400          .   Total number of threads
 MAIN.threads_limited               0         0.00 Threads hit max
 MAIN.threads_created             590         2.09 Threads created
 MAIN.threads_destroyed           190         0.67 Threads destoryed
 MAIN.threads_failed                0         0.00 Thread creation failed
 MAIN.thread_queue_len              0          .   Length of session queue
 MAIN.sess_queued                   0         0.00 Sessions queued for
 thread
 MAIN.sess_dropped                  0         0.00 Sessions dropped for
 thread
 MAIN.exp_mailed                              0         0.00 Number of
 objects mailed to expiry thread
 MAIN.exp_received                            0         0.00 Number of
 objects received by expiry thread

 root at varnish4:~# ps aux -L |grep varnishd|grep nobody|wc -l
 607

 root at varnish4:~# varnishadm param.set thread_pool_min 5

 root at varnish4:~# varnishstat -1|grep thread
 MAIN.pools                         2          .   Number of thread pools
 MAIN.threads                      10          .   Total number of threads
 MAIN.threads_limited               0         0.00 Threads hit max
 MAIN.threads_created             590         1.09 Threads created
 MAIN.threads_destroyed           580         1.07 Threads destoryed
 MAIN.threads_failed                0         0.00 Thread creation failed
 MAIN.thread_queue_len              0          .   Length of session queue
 MAIN.sess_queued                   0         0.00 Sessions queued for
 thread
 MAIN.sess_dropped                  0         0.00 Sessions dropped for
 thread
 MAIN.exp_mailed                              0         0.00 Number of
 objects mailed to expiry thread
 MAIN.exp_received                            0         0.00 Number of
 objects received by expiry thread

 root at varnish4:~# ps aux -L |grep varnishd|grep nobody|wc -l
 607

 root at varnish4:~# varnishadm param.set thread_pool_min 200

 root at varnish4:~# varnishstat -1|grep thread
 MAIN.pools                         2          .   Number of thread pools
 MAIN.threads                     400          .   Total number of threads
 MAIN.threads_limited               0         0.00 Threads hit max
 MAIN.threads_created             980         1.73 Threads created
 MAIN.threads_destroyed           580         1.02 Threads destoryed
 MAIN.threads_failed                0         0.00 Thread creation failed
 MAIN.thread_queue_len              0          .   Length of session queue
 MAIN.sess_queued                   0         0.00 Sessions queued for
 thread
 MAIN.sess_dropped                  0         0.00 Sessions dropped for
 thread
 MAIN.exp_mailed                              0         0.00 Number of
 objects mailed to expiry thread
 MAIN.exp_received                            0         0.00 Number of
 objects received by expiry thread

 root at varnish4:~# ps aux -L |grep varnishd|grep nobody|wc -l
 997

 root at varnish4:~# ps aux -L |grep varnishd|grep nobody
 nobody   28377 28377  0.0  997  4.6 1086176 91840 ?       Sl   20:46
 0:00 /usr/sbin/varnishd -P /var/run/varnishd.pid -a :80 -T localhost:6082
 -f /etc/varnish/default.vcl -S /etc/varnish/secret -s malloc,256m
 nobody   28377 28378  0.0  997  4.6 1086176 91840 ?       Sl   20:46
 0:00 /usr/sbin/varnishd -P /var/run/varnishd.pid -a :80 -T localhost:6082
 -f /etc/varnish/default.vcl -S /etc/varnish/secret -s malloc,256m
 nobody   28377 28379  0.0  997  4.6 1086176 91840 ?       Sl   20:46
 0:00 /usr/sbin/varnishd -P /var/run/varnishd.pid -a :80 -T localhost:6082
 -f /etc/varnish/default.vcl -S /etc/varnish/secret -s malloc,256m
 ...
 nobody   28377 28592  0.0  997  4.6 1086176 91840 ?       Sl   20:46
 0:00 /usr/sbin/varnishd -P /var/run/varnishd.pid -a :80 -T localhost:6082
 -f /etc/varnish/default.vcl -S /etc/varnish/secret -s malloc,256m
 nobody   28377 28593  0.0  997  4.6 1086176 91840 ?       Sl   20:46
 0:00 /usr/sbin/varnishd -P /var/run/varnishd.pid -a :80 -T localhost:6082
 -f /etc/varnish/default.vcl -S /etc/varnish/secret -s malloc,256m
 nobody   28377 28856  0.0  997  4.6 1086176 91840 ?       Sl   20:51
 0:00 /usr/sbin/varnishd -P /var/run/varnishd.pid -a :80 -T localhost:6082
 -f /etc/varnish/default.vcl -S /etc/varnish/secret -s malloc,256m
 nobody   28377 28855  0.0  997  4.6 1086176 91840 ?       Sl   20:51
 0:00 /usr/sbin/varnishd -P /var/run/varnishd.pid -a :80 -T localhost:6082
 -f /etc/varnish/default.vcl -S /etc/varnish/secret -s malloc,256m
 ...
 nobody   28377 29242  0.0  997  4.6 1086176 91840 ?       Sl   20:51
 0:00 /usr/sbin/varnishd -P /var/run/varnishd.pid -a :80 -T localhost:6082
 -f /etc/varnish/default.vcl -S /etc/varnish/secret -s malloc,256m
 nobody   28377 29243  0.0  997  4.6 1086176 91840 ?       Sl   20:51
 0:00 /usr/sbin/varnishd -P /var/run/varnishd.pid -a :80 -T localhost:6082
 -f /etc/varnish/default.vcl -S /etc/varnish/secret -s malloc,256m
 nobody   28377 29244  0.0  997  4.6 1086176 91840 ?       Sl   20:51
 0:00 /usr/sbin/varnishd -P /var/run/varnishd.pid -a :80 -T localhost:6082
 -f /etc/varnish/default.vcl -S /etc/varnish/secret -s malloc,256m
 nobody   28377 29656  0.0  997  4.6 1086176 91840 ?       Sl   20:55
 0:00 /usr/sbin/varnishd -P /var/run/varnishd.pid -a :80 -T localhost:6082
 -f /etc/varnish/default.vcl -S /etc/varnish/secret -s malloc,256m
 nobody   28377 29657  0.0  997  4.6 1086176 91840 ?       Sl   20:55
 0:00 /usr/sbin/varnishd -P /var/run/varnishd.pid -a :80 -T localhost:6082
 -f /etc/varnish/default.vcl -S /etc/varnish/secret -s malloc,256m
 ...
 }}}

-- 
Ticket URL: <https://www.varnish-cache.org/trac/ticket/1490>
Varnish <https://varnish-cache.org/>
The Varnish HTTP Accelerator



More information about the varnish-bugs mailing list