You are not logged in.

#1 2018-11-16 02:14:50

ngoonee
Forum Fellow
From: Between Thailand and Singapore
Registered: 2009-03-17
Posts: 7,354

How to debug why squid can't shutdown immediately?

Nov 16 09:20:43 ngoonee-envy systemd[1]: Stopping Squid Web Proxy Server...
Nov 16 09:20:43 ngoonee-envy squid[29623]: Preparing for shutdown after 2180 requests
Nov 16 09:20:43 ngoonee-envy squid[29623]: Waiting 30 seconds for active connections to finish
Nov 16 09:20:43 ngoonee-envy squid[29623]: Closing HTTP(S) port [::]:3128
Nov 16 09:21:14 ngoonee-envy squid[29623]: Shutdown: NTLM authentication.
Nov 16 09:21:14 ngoonee-envy squid[29623]: Shutdown: Negotiate authentication.
Nov 16 09:21:14 ngoonee-envy squid[29623]: Shutdown: Digest authentication.
Nov 16 09:21:14 ngoonee-envy squid[29623]: Shutdown: Basic authentication.
Nov 16 09:21:14 ngoonee-envy squid[29623]: Shutting down...
Nov 16 09:21:14 ngoonee-envy squid[29623]: storeDirWriteCleanLogs: Starting...
Nov 16 09:21:14 ngoonee-envy squid[29623]:   Finished.  Wrote 0 entries.
Nov 16 09:21:14 ngoonee-envy squid[29623]:   Took 0.00 seconds (  0.00 entries/sec).
Nov 16 09:21:14 ngoonee-envy squid[29623]: Logfile: closing log daemon:/var/log/squid/access.log
Nov 16 09:21:14 ngoonee-envy squid[29623]: Logfile Daemon: closing log daemon:/var/log/squid/access.log
Nov 16 09:21:14 ngoonee-envy squid[29623]: Open FD UNSTARTED    14 IPC UNIX STREAM Parent
Nov 16 09:21:14 ngoonee-envy squid[29623]: Squid Cache (Version 4.4): Exiting normally.
Nov 16 09:21:14 ngoonee-envy squid[29621]: Squid Parent: squid-1 process 29623 exited with status 0
Nov 16 09:21:14 ngoonee-envy squid[29621]: Removing PID file (/run/squid.pid)
Nov 16 09:21:14 ngoonee-envy systemd[1]: Stopped Squid Web Proxy Server.

I have a NetworkManager dispatcher script which stops squid and starts cntlm when I get to my office (and the reverse when I get home).

For some reason this always takes 30 seconds. The above is the journalctl for squid. In particular it always has to wait for active connections to finish.

How do I figure out what these active connections are?


Allan-Volunteer on the (topic being discussed) mailn lists. You never get the people who matters attention on the forums.
jasonwryan-Installing Arch is a measure of your literacy. Maintaining Arch is a measure of your diligence. Contributing to Arch is a measure of your competence.
Griemak-Bleeding edge, not bleeding flat. Edge denotes falls will occur from time to time. Bring your own parachute.

Offline

#2 2018-11-16 22:29:58

B1omman
Member
Registered: 2016-02-16
Posts: 36

Re: How to debug why squid can't shutdown immediately?

You could try reading the  documentation

Offline

#3 2018-11-16 23:18:21

ngoonee
Forum Fellow
From: Between Thailand and Singapore
Registered: 2009-03-17
Posts: 7,354

Re: How to debug why squid can't shutdown immediately?

B1omman wrote:

You could try reading the  documentation

Thanks for your answer. I'm aware of that config (and that could just modify squid.service with a different kill line, possibly by systemd drop-in), but the linked page doesn't answer my main question:-

ngoonee wrote:

How do I figure out what these active connections are?

which is also mentioned in my thread title. I can of course force squid to shutdown in 10 seconds instead, but I'd still have to wait (wifi only takes less than a second to re-connect wher eI am, so it's a pointless wait).


Allan-Volunteer on the (topic being discussed) mailn lists. You never get the people who matters attention on the forums.
jasonwryan-Installing Arch is a measure of your literacy. Maintaining Arch is a measure of your diligence. Contributing to Arch is a measure of your competence.
Griemak-Bleeding edge, not bleeding flat. Edge denotes falls will occur from time to time. Bring your own parachute.

Offline

#4 2018-11-18 04:18:05

B1omman
Member
Registered: 2016-02-16
Posts: 36

Re: How to debug why squid can't shutdown immediately?

ngoonee wrote:

How do I figure out what these active connections are?

Title wrote:

How to debug why squid can't shutdown immediately?

These are not the same and from reading your post it seemed as though you only wanted to know why the wait was 30s, but now I don't really understand what you wish to achieve. If you just want to see active sockets you could use ss from the iproute2 package or use a tool like webmin to parse logs and monitor squid, or take a look at the cache log. If you don't want to wait at all there is the squid -k interrupt command, but I don't know how good/bad that would be in the long run if used always, otherwise just set shutdown_lifetime to something small.

Offline

Board footer

Powered by FluxBB