Knowledgebase

Understanding File Descriptors and Open Files Print

  • 0

Why deleted files still use space.

WHAT A FILE DESCRIPTOR IS

A process's handle to an open file.

WHY IT MATTERS PRACTICALLY

Space is only released when the last handle closes, not when the name is deleted.

WHAT THAT PRODUCES

A disk reporting full while the files appear gone.

HOW TO SEE IT

lsof filtered for deleted entries.

WHAT TO DO

Restart the process holding it, or truncate the file through its handle.

WHY RESTARTING WORKS

It closes the handle, releasing the space.

WHAT COMMONLY CAUSES THIS

Deleting a log file without telling the service to reopen it.

WHAT TO DO INSTEAD OF DELETING A LIVE LOG

Truncate it, which keeps the handle valid.

WHAT AN OPEN FILE LIMIT IS

A cap on how many files a process may hold at once.

WHAT EXCEEDING IT PRODUCES

Errors about too many open files.

WHERE THAT ARISES

Busy web servers and databases.

HOW TO SEE THE LIMIT

The limits for a running process, or the configured value.

WHAT TO RAISE

Both the system-wide maximum and the service's own limit.

WHY BOTH

Raising one without the other has no effect.

WHAT TO CHECK AFTER RAISING IT

That it actually applied to the running service.


Was this answer helpful?
Back

Are you happy with your experience? Leave us a review on Trustpilot.


Trustpilot