Skip to content
hostcomplex

Inode Limit

Maarten Soetens 2 min read

What an Inode Is in a File System

An inode limit is the maximum number of files and folders a file system can hold, because each one needs its own inode. An inode is a record that stores a file's metadata, including its owner, permissions, size, timestamps and the location of its data blocks. A file's name is kept separately, inside a directory, so the inode is what the system uses to find the file's contents. Directories also use inodes.

Many Linux file systems, such as ext4, fix the number of inodes when the file system is created. Others, such as XFS, allocate inodes as they are needed. A file system with a fixed inode count can run out of inodes while disk space remains free.

How file systems are organised in general is covered in file systems.

Why Many Small Files Use Up Inodes First

Inode use depends on the number of files, not their size. A 1 KB file and a 1 GB file each take up one inode. A site can therefore reach its limit while using very little disk space. Common sources include:

  • Session files, with one file for each visitor session
  • Cache directories holding thousands of generated pages or thumbnails
  • Email stored in Maildir format, where each message is its own file
  • Dependency folders from software packages, which contain many small files

When the limit is reached, the system cannot create new files, even if there is free space. Applications then fail with the error No space left on device, which is misleading because the disk is not full.

Why Shared Hosts Cap Inode Usage

Shared hosts place many accounts on the same file system. Every file adds metadata that the server must manage, and backups, malware scans and file indexing all slow down as file counts grow into the millions. A cap on inodes keeps one account from consuming resources that others need.

The cap also protects the server from runaway scripts that create files in a loop. Without it, one faulty process could exhaust the shared file system for every account on it. Inode limits are set per plan and are separate from the storage space allowance.

Frequently asked questions

How can I tell if I am running out of inodes?

Watch for No space left on device errors even when the disk shows free space. The number of inodes used compared with the total available shows how close you are to the limit. Clearing old sessions, caches and logs usually frees inodes quickly, and reducing the number of small files helps prevent the problem from returning.

Do inode limits apply to every hosting plan?

Many shared and virtual hosting plans have some form of file count limit, though the details vary by provider. Check the plan documentation for the file or inode allowance. For how storage limits are enforced alongside these caps, see disk quotas.

  • Two-Factor Authentication

    Two factor authentication hosting adds a second check to control panel, domain and CMS logins. Learn which methods are strongest and why 2FA helps.

  • What Is an A Record?

    What is an A record? Learn how this DNS record maps a hostname to an IPv4 address, why domains use several A records and the root and www pattern.

  • Billing and Automation Platforms

    What is WHMCS? Learn how this commercial billing and automation platform helps hosts sell plans, collect payments and create accounts automatically.