nently stop accepting connections
To adjust to system limits Squid automatically reduces the amount of
filedescriptors when it detects a system wide shortage. However, this
reduction might go so far that Squid completely stops accepting new
connections.
This patch adds a limit causing Squid to restart if the limit gets way
too low, in an attempt to recover if the situation is temporary.
/*
- * $Id: fd.cc,v 1.57 2007/04/28 22:26:37 hno Exp $
+ * $Id: fd.cc,v 1.58 2007/06/25 14:38:14 hno Exp $
*
* DEBUG: section 51 Filedescriptor Functions
* AUTHOR: Duane Wessels
newReserve = x;
}
+ if (Squid_MaxFD - newReserve < XMIN(256, Squid_MaxFD / 2))
+ fatalf("Too few filedescriptors available in the system (%d usable of %d).\n", Squid_MaxFD - newReserve, Squid_MaxFD);
+
debugs(51, 0, "Reserved FD adjusted from " << RESERVED_FD << " to " << newReserve << " due to failures");
RESERVED_FD = newReserve;
}