Troubleshooting high inode usage


Browse by products and services

  • Applies to: VPS Hosting
    • Difficulty: Medium
    • Time Needed: 10-15
    • Tools Required: Email, FTP, or SSH Access
  • Applies to: Shared Hosting Hosting
    • Difficulty: Medium
    • Time Needed: 10-15
    • Tools Required: Email, FTP, or SSH Access

Overview

Inode is a Linux (and other Unix-like) data structure used to keep information about the files, folders, emails, code, and everything else on your server. The number of inodes corresponds the number of files and folders you have. Therefore, the more files and folders you have on your server, the higher your inode usage will be.

Keep in mind that inode usage differs from disk space usage (KB, MB, GB). For example, let's suppose you are using 20 / 30GB of disk space on your server. This would represent your disk space usage. However, if you have hundreds of thousands of small files within that 20 /30 GB, that could result in high inode usage, which could negatively affect the performance of your server. In such a case, we would advise taking a look at the troubleshooting tips below to see how you can lower your inode usage.

STATEMENT OF SUPPORT:
Please keep in mind that troubleshooting the configuration/functionality of third-party applications is not covered by our statement of support. These resources were provided as a courtesy to assist you to the extent of our abilities. For more information on our statement of support, feel free to click here.

Clear old or spam emails

A good place to start is to examine your email users:

  • Do you have any old users that are no longer in use?
  • Do you have users with large spam folders?
  • Do you have a backlog of old emails?

If you are using cPanel, you can take advantage of the Email Disk Usage feature which will help you to remove emails based on certain criteria. If you prefer to do it manually, you can do so from your Webmail or preferred mail client.

cpanel-email_disk_usage.png

If so, you may want to go through and clear these mailboxes. As a safety measure, you can create backups of these mailboxes before clearing them:

Clearing cache files

Some CMS (WordPress, Joomla, etc) and other third-party applications on your website may have caching systems. These can create cache files that will increase your inode usage. You can attempt to clear these manually, or set up scripts in place to clear these automatically.

If you are unsure if your website uses caching, contact your website developer for more details.

Deleting unnecessary files and folders

Your website can slowly accumulate old or unnecessary files over time, which can ultimately increase your inode usage. To fix this, you will want to locate folders with high innode usage, and then remove any unnecessary files.

If you are unsure which files can be safely removed, it's recommended to contact your website developer for assistance. We also recommend making a backup backup of your server before removing any files.

To find folders with high inode usage, connect to your server via SSH SSH and use the find command. We've provided some generic commands to use, if needed.

View the inode usage of the folders (in the working directory):

find . -printf "%h\n" | cut -d/ -f-2 | sort | uniq -c | sort -rn

View 20 folder paths with the highest inode usage (in the working directory):

find * -xdev -printf '%h\n' | sort | uniq -c | sort -k 1 -n | tail -20

With each command, you'll see a number on the left to indicate the number of inodes, with the folder name on the right. If needed, you can move into sub-folders and run the above commands again to dig deeper.

Example output:

1867 ./wp-includes
580 ./wp-admin
480 ./wp-content
30 .
1 ./data