You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.
The environment is that Mosquitto 2.0.14 is started via systemd on RHEL8.
It's observed that at most 1015 connections are accepted by default, but if a systemd override with LimitNOFILE is made it can be increased further. This surprised me because systemd on EL8 by default should give a hard limit of 262144 but has a soft limit of 1024. The 1015 connections are surprisingly close to 1024. The 9 other ones can probably be accounted for by stdin/stdout/stderr and some other files like configs.
Note that the soft limit remains at 1024 for compatibility reasons: the
traditional UNIX select() call cannot deal with file descriptors >=
1024 and increasing the soft limit globally might thus result in
programs unexpectedly allocating a high file descriptor and thus
failing abnormally when attempting to use it with select() (of
course, programs shouldn't use select() anymore, and prefer
poll()/epoll, but the call unfortunately remains undeservedly popular
at this time).
Then later:
Programs that want to take benefit of the increased limit have to "opt-in" into
high file descriptors explicitly by raising their soft limit.
So my question is: should Mosquitto attempt to raise its soft limit to, by default, get many more file descriptors or is this unsafe due to select() usage?
The text was updated successfully, but these errors were encountered:
ekohl
changed the title
Attempt to raise the soft limit
Attempt to raise the soft limit to get more file descriptors under systemd
Nov 2, 2022
I'm forwarding this issue from https://bugzilla.redhat.com/show_bug.cgi?id=2132774.
The environment is that Mosquitto 2.0.14 is started via systemd on RHEL8.
It's observed that at most 1015 connections are accepted by default, but if a systemd override with
LimitNOFILEis made it can be increased further. This surprised me because systemd on EL8 by default should give a hard limit of 262144 but has a soft limit of 1024. The 1015 connections are surprisingly close to 1024. The 9 other ones can probably be accounted for by stdin/stdout/stderr and some other files like configs.https://github.com/systemd/systemd/blob/23f3a6f5ff864fd26063c6c35fdaa6d85de566c7/NEWS#L5880-L5914 does have quite a bit to say on this.
Then later:
So my question is: should Mosquitto attempt to raise its soft limit to, by default, get many more file descriptors or is this unsafe due to
select()usage?The text was updated successfully, but these errors were encountered: