On my ubuntu machine I have squid3 as a daemon which starts at boot. But squid3 takes a long time to start and stop (alomst more than 30 seconds). So it has slowed down my OS startup and shutdown time considerably.
There is a parameter called shutdown_lifetime. It has a default value of 30 seconds.
So when Squid receives a shutdown request, it waits at least 30 seconds before it terminates.
For more info see below.