5

I'm using Ubuntu 11.04 and when calling "/etc/init.d/squid3 restart", it spends about half a minute to restart. What is it doing?

The output looks like this:

* Restarting Squid HTTP Proxy 3.x squid3
*  Waiting...
* ...
* ...
* ...
* ...
* ...
* ...                                                                   [ OK ]
* Creating Squid HTTP Proxy 3.x cache structure
Shimmy Weitzhandler
  • 101,809
  • 122
  • 424
  • 632
speedogoo
  • 2,828
  • 2
  • 17
  • 19

4 Answers4

13

Lower your shutdown_lifetime setting. It's set to 30 seconds by default.

http://www.squid-cache.org/Doc/config/shutdown_lifetime/

lbiegaj
  • 330
  • 2
  • 8
0

Because it closes all the file descriptors, sockets before stop.

Diego Woitasen
  • 32,892
  • 1
  • 18
  • 20
0

Maybe this does not apply to you.. since this assumes that squid is broken.

I had a running/working squid on Ubuntu 14 and after 2 upgrades to Ubuntu 18, where the config files and folders happily changed, it would not properly start - but only visible in the log, no error thrown, systemctl also reported it started and stopped successfully.

After fixing the startup problem, a medium-high cpu load is gone, long restart time is gone, and I assume the proxy is working, too.

All I had to do in my case was copy the missing config file (squid_passwd in my case) from old config folder to new config folder.

Andreas Reiff
  • 7,961
  • 10
  • 50
  • 104
0

Add to your /etc/squid/squid,conf

shutdown_lifetime 0 seconds
PYK
  • 3,674
  • 29
  • 17