Skip to content
Calcrivo

Open File Descriptor Calculator

Calculate open file descriptor usage against system and per-process ulimit thresholds.

Inputs

Per-Process FD Usage

80.00%

System-Wide FD Usage

2.25%

Per-Process FDs Remaining

2,000

System-Wide FDs Remaining

1,955,000

Status

Warning — approaching FD limit

Step by step

  1. Values used

    Currently Open File Descriptors = 8,000; Per-Process Max FDs (ulimit -n) = 10,000; System-Wide Max FDs (fs.file-max) = 2,000,000; System-Wide Currently Open FDs = 45,000

  2. FD usage percentage

    usage% = open_fds / max_fds × 100

  3. Per-Process FD Usage

    = 80.00

  4. System-Wide FD Usage

    = 2.25

  5. Per-Process FDs Remaining

    = 2,000

  6. System-Wide FDs Remaining

    = 1,955,000

  7. Status

    = Warning — approaching FD limit

How it works

Linux enforces two separate file descriptor ceilings: a per-process soft/hard limit set by ulimit -n (or /etc/security/limits.conf), and a system-wide ceiling set by the fs.file-max sysctl. A process hitting its per-process limit gets 'too many open files' errors even if the system as a whole has plenty of headroom, and vice versa — both usage percentages should be watched independently.

Formula

FD usage percentage

usage% = open_fds / max_fds × 100

Frequently Asked Questions

What causes 'too many open files' errors?

This error occurs when a process attempts to open a new file, socket, or pipe after already reaching its file descriptor limit (ulimit -n) — common in high-concurrency servers handling many simultaneous connections.

How do I raise the per-process file descriptor limit?

Set soft/hard limits in /etc/security/limits.conf (or a systemd unit's LimitNOFILE= directive for services), then have the process re-login or restart to pick up the new ulimit -n value.

How do I raise the system-wide file descriptor limit?

Increase fs.file-max via sysctl (sysctl -w fs.file-max=<value>, persisted in /etc/sysctl.conf), which caps the total file descriptors available to all processes on the host combined.

You might also need