Skip to content
ENExplore Calculators

Open File Limit Calculator

Work out open file limit instantly with clear inputs, formula shown and shareable results.

About Open File Limit Calculator

There are two separate limits: fs.file-max caps descriptors system-wide, and the nofile rlimit caps them per process. Hitting the system limit returns ENFILE and affects every process; hitting the per-process limit returns EMFILE and affects only one. Each open descriptor also costs kernel memory, so a very high limit has a real cost when actually used.

Formula

Descriptor accounting

total = processes x descriptors per process; kernel memory = total x bytes per descriptor; compare against fs.file-max

Worked example

With the default values below, Open File Limit Calculator returns Total open descriptors system-wide of 33,600. Change any input above and every figure here is recalculated in your browser.

Inputs used

Processes on the hostminimum 1
240
Average open descriptors per processminimum 1
140
Configured fs.file-maxminimum 1,024
1,048,576
Kernel memory per open descriptorminimum 64 bytes
1,024 bytes

Results

Total open descriptors system-wide
33,600
Share of fs.file-max used
3.20%
Kernel memory for open files
32.81 MiB
Assessment
Within safe limits

Step by step

  1. 1Values used
  2. 2Descriptor accounting
  3. 3Total open descriptors system-wide= 33,600
  4. 4Share of fs.file-max used= 3.20
  5. 5Kernel memory for open files= 34,406,400
  6. 6Assessment= Within safe limits

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, fees or charges or compounding frequency into account.
  • Figures are rounded for display to 2 decimal places, 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

What is the difference between EMFILE and ENFILE?

EMFILE means the process hit its own nofile rlimit; ENFILE means the system-wide fs.file-max is exhausted. They need different fixes.

How do I find which process is leaking descriptors?

Compare /proc/PID/fd counts across processes, or use lsof grouped by process. A steadily growing count with no corresponding workload growth is a leak.

Open File Limit Calculator | Calcrivo