Bug 976815 - file descriptors are hard coded to 16384
Summary: file descriptors are hard coded to 16384
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: squid
Version: 18
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Michal Luscon
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-06-21 14:16 UTC by Zing
Modified: 2013-09-13 11:20 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2013-09-13 11:20:51 UTC
Type: Bug


Attachments (Terms of Use)

Description Zing 2013-06-21 14:16:56 UTC
Version-Release number of selected component (if applicable):
squid-3.2.9-1.fc18.x86_64

It's not possible to change the number of file descriptors available to squid at runtime with either the "max_filedescriptors" option or by specifying the open files limit in systemd squid unit file.

Attempting to use max_filedescriptors option gets an error:
WARNING: max_filedescriptors disabled. Operating System setrlimit(RLIMIT_NOFILE) is missing.

Rebuilding squid without the "--with-filedescriptors=16384" option in the spec file causes squid to inherit the build environments open files limit as its default (i.e. 1024 as a user), but the squid unit file option "LimitNOFILE=16384" is now obeyed and set if systemd is used to start squid.  The max_filedescriptor option also starts working at this point.

Can we get squid built without the "--with-filedescriptors=16384" build option.  Thank you.

Comment 1 Michal Luscon 2013-06-24 17:34:36 UTC
It would make sense to compile squid without the file descriptors limit and treat systemd LimitNOFILE as a boundary for config value, but there is an issue when squid.conf value is higher than LimitNOFILE. In this case squid logs and probably also uses max_filedescriptor value instead of current fd limit.

I will initiate discussion with upstream on the theme of systemd and squid.

Comment 2 Zing 2013-06-24 20:23:10 UTC
Yes.  From my testing (with a squid built without the --with-filedescriptors option), if max_filedescriptors is not set, squid will just inherit the current rlimit setting of nofile (I made an error in my comment 0, it does not come from the build environment).  If max_filedescriptors is set, then that is what squid will use, regardless of the nofile rlimit.

Is that necessarily an issue?  That seems "ok" to me and the effect I'd want (being able to "override" the rlimit in the squid config).

The only kind of maybe unexpected thing here is if one doesn't use systemd to start squid, the default squid configuration is probably going to inherit a filedescriptor limit much smaller (1024) than the systemd LimitNOFILE specified 16384.

Comment 3 Michal Luscon 2013-09-13 11:20:51 UTC
You can find the newest Squid build without "--with-filedescriptors" option in rawhide.


Note You need to log in before you can comment on or make changes to this bug.