Re: ip_local_port_range

From: Henrik Nordstrom <hno@dont-contact.us>
Date: Tue, 14 Dec 1999 02:14:27 +0100

Chris Conn wrote:

> I have inode-max set to 32767. If I cat
> /proc/sys/net/ipv4/ip_local_port_range, I get "1024 4999".

You may want to lower inode-max somewhat. This is way more than you will
need, with the possible sideeffect that the kernel will use more memory
than neccesary.

Note that setting of file-max is also important, even more so than
inode-max. file-max is a hard limit, while inode-max is only a
recommended limit where the kernel tries to keep it below inode-max if
possible (and does not care much while it is below). The documentation
on inode-max seems to be somewhat out of date with how the kernel
behaves (probably since the change to support many filedescriptors).
file-max should be at least the number of filedescriptors supported by
Squid + a couple of hundred for other stuff.

> HTTP requests per minute: 1016.3

You don't need to tune much then. Fairly low traffic, well within the
limits of the default ip_local_port_range setting (1024-4999).

> I am unsure why, but if I issue your ip_local_port_range command,
> 30-40 minutes later the squid process is still running, no errors
> are generated in cache.log, however clients can no longer connect
> and the access.log simply grinds to a halt. The squid process does
> not die, it simply seems to no longer accept connections.

That sounds like some other error/problem. I don't see how this could be
directly caused by changing ip_local_port_range, but again I do not
fully understand all implications in the kernel.

How have you build your Squid?
libc version?
number of filedescriptors?
Any obvious trend in the FD statistics in the general runtime cachemgr
page?

--
Henrik Nordstrom
Squid hacker
Received on Mon Dec 13 1999 - 18:30:06 MST

This archive was generated by hypermail pre-2.1.9 : Tue Dec 09 2003 - 16:49:53 MST