Ulimit File Descriptors Calculator
Work out ulimit file descriptors instantly with clear inputs, formula shown and shareable results.
About Ulimit File Descriptors Calculator
Each connection consumes at least one descriptor, and a proxy needs two — one client-side and one upstream. Dividing by worker count gives the per-process requirement, and a 50 percent margin covers bursts and lingering sockets in TIME_WAIT. For systemd services the limit must be set with LimitNOFILE in the unit file; the default of 1024 is the classic cause of accept failures under load.
Formula
Descriptor budget
per worker = connections x descriptors per connection / workers + other files; recommended = per worker x 1.5; fs.file-max = recommended x workers x 1.2
Worked example
With the default values below, Ulimit File Descriptors Calculator returns Recommended per-process limit of 8,250. Change any input above and every figure here is recalculated in your browser.
Inputs used
- Concurrent connectionsminimum 1
- 20,000
- Descriptors per connectionminimum 1
- 2
- Other open files and socketsminimum 0
- 500
- Worker processes sharing the loadminimum 1
- 8
Results
- Recommended per-process limit
- 8,250
- Descriptors each worker needs
- 5,500
- Recommended fs.file-max
- 79,200
- Configuration note
- Set LimitNOFILE in the systemd unit; shell ulimit settings do not apply to services
Step by step
- 1Values used
- 2Descriptor budget
- 3Recommended per-process limit= 8,250
- 4Descriptors each worker needs= 5,500
- 5Recommended fs.file-max= 79,200
- 6Configuration note= Set LimitNOFILE in the systemd unit; shell ulimit settings do not apply to services
Assumptions and limits
- The result is derived only from the 4 inputs listed above. Anything not among them is not part of the calculation.
- In particular, this calculator does not take inflation, tax or compounding frequency into account.
- Figures are rounded for display to whole numbers, so totals built from several rounded parts can differ slightly from the unrounded arithmetic.
How these calculators are built and tested is described on the Methodology page. If a figure looks wrong, please report it.
Frequently Asked Questions
Why is my service still limited to 1024 descriptors?
Because ulimit in a login shell does not affect systemd-managed services. Set LimitNOFILE in the unit or a drop-in override and reload the daemon.
Is there a cost to a very high limit?
The limit itself is cheap; each actually-open descriptor costs kernel memory. Setting a high ceiling is safe, but monitor actual usage.
Related Calculators
- File Permission (chmod) Calculator
- Open File Limit Calculator
- Account Lockout Policy Calculator
- Backup Size With Retention Calculator
- Bare Metal Sizing Calculator
- Bash Script Runtime Calculator
- Block Size Overhead Calculator
- Compression Ratio Savings Calculator
- Container vs VM Overhead Calculator
- Context Switch Rate Calculator
You might also need
- File Permission (chmod) CalculatorAlso in Linux & System Administration
- Open File Limit CalculatorAlso in Linux & System Administration
- Container vs VM Overhead CalculatorAlso in Linux & System Administration
- CPU Utilisation CalculatorAlso in Linux & System Administration
- Free Memory Estimate CalculatorAlso in Linux & System Administration
- Group Quota CalculatorAlso in Linux & System Administration
