On Sat, 12 May 2018 06:31:23 +0200 Alain Knaff wrote: > Package: squid > Version: 3.5.23-5+deb9u1 > > Hi, > > The comment about on shutdown_lifetime in the sample squid.conf file > says the following: > > # TAG: shutdown_lifetime time-units > # When SIGTERM or SIGHUP is received, the cache is put into > # "shutdown pending" mode until all active sockets are closed. > # This value is the lifetime to set for all open descriptors > # during shutdown mode. Any active clients after this many > # seconds will receive a 'timeout' message. > > > However, in reality, squid waits the shutdown_lifetime regardless of > whether there are any active clients currently connected to or not. > > Even if no clients are connected (squid freshly started, in the middle > of the night, verified using lsof and netstat), it still takes 30 > seconds to shutdown. > > So either the code (preferably...) or that comment needs to be fixed. > > ... or did I just misunderstand the documentation? ;^) >
Yes and no. This is a common misunderstanding of the documentation. "active sockets" is not the same as "client connections". Sockets are used for many things other than clients and some of those may continue for a while after clients are gone. That said Squid currently does not abort those other socket connections until shutdown_lifetime completes. So effectively shutdown_lifetime always happens. FWIW; current Squid (3.4+) solve a lot of the issues older Squid had with very short shutdown_lifetime so you can set it to whatever short duration you are happy with now. Amos