Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
rgw/sfs: Increase RLIMIT_NOFILE soft limit to hard limit
We potentially need at least 4 FDs per worker thread (two for the sqlite db and its WAL, and another two to accommodate files that may be being read or written), plus about 40 for various pipes and sockets and things that appear in in /proc/$(pgrep radosgw)/fd before anything interesting happens. That's more than two thousand FDs, but the default soft FD limit is only 1024. The most straightforward and probably safest thing to do is just bump the RLIMIT_NOFILE soft limit (1024) to the hard limit (which these days should be 524288) on startup. In case the hard limit is somehow low, this commit also includes a check to see if it's at least as high as what we imagine we need. See https://0pointer.net/blog/file-descriptor-limits.html for discussion on bumping RLIMIT_NOFILE. Fixes: https://github.com/aquarist-labs/s3gw/issues/752 Signed-off-by: Tim Serong <[email protected]>
- Loading branch information