Name
sleep_after_fork
Synopsis
Squid uses the fork( )
system call to spawn helper processes, such as redirectors,
authenticators, and DNS resolvers. On some systems, a rapid sequence
of fork( )
calls consumes all available
real and virtual memory. Thus, a fork(
)
call may fail with an “out of memory” error. Note that
this isn’t necessarily a fatal error. Squid continues running as long
as at least 50% of helper processes are successfully started.
To alleviate this problem, you can instruct Squid to sleep for a
small amount of time after each fork( )
call. This gives
the recently forked process time to complete its exec( )
call and free up the
memory.
Don’t set this value too high, especially if you have a large number of helper processes. Squid doesn’t service any client requests until all helpers have been started.
Syntax | sleep_after_fork |
Default | sleep_after_fork 0 |
Example | sleep_after_fork 10000 |
Get Squid: The Definitive Guide now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.