This article explains what an inode count is, how to determine it for your account, and how to reduce it if necessary.

WHAT IS THE INODE COUNT?

An inode is simply an internal data structure that Linux uses to store information about a filesystem object. The inode count equals the total number of files and directories in a user account or on a disk. Each file or directory adds 1 to the inode count.

To maintain the reliability and performance of CloudyHost.com servers for all users, there are inode limits in place for shared hosting accounts. If the inode count for your account reaches this limit, you must decrease the count by removing some files or directories.

Here are some reasons why CloudyHost.com limits inode counts on shared hosting accounts:

  • High inode counts on a server can cause excessive downtime during file system checks, because the system has to check every single inode. For example, if a customer account were to have a million cache files, a file system check could take hours and impact availability for all customers on the server.
  • A large number of files slows down backups and restores considerably. In the event of disaster recovery, it can take much longer to recover if a lot of files need to be restored. For example, it is much slower to restore many small files than a few larger files.

DETERMINING THE INODE COUNT

The method you should use to determine the inode count depends on the type of hosting package that you have:

  • If you have a shared hosting or reseller hosting package, you can use cPanel or the command line to determine the current inode usage for your account.
  • For all other types of hosting packages (including managed VPS, and all unmanaged packages), you must use the command line to determine current inode usage.
Method #1: Use cPanel

To determine the current inode count using cPanel, follow these steps:

  1. Log in to cPanel.
  2. In the Statistics column of the cPanel home screen, locate the Inodes row. The first number indicates how many inodes your account is using, and the second number indicates the maximum number of inodes allowed for your account. For example, the following image shows an account that is using 1.345 inodes out of a maximum of 200,000 allowed:

Method #2: Use the command line

To determine the current inode count for directories in your account using the command line, follow these steps:

  1. Log in to your account using SSH.
  2. To make sure you are in your home directory, type the following command:
    cd ~
  3. To determine the total inode count for your account, type the following command:

    find . | wc -l
    If you have a large number of files and directories in your account, this command may take some time to complete.
  4. To view a breakdown of inode usage for all directories located in the current directory, type the following command:

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

    While the command in step 3 displays the total inode usage for your account, this command displays which directories are using the most inodes. The output is sorted, with the most inode usage at the top, and the least inode usage at the bottom.

    To view the inode usage for a particular subdirectory, change to the directory (for example, type cd public_html), and then rerun this command. You can progressively step into subdirectories, run this command, and determine where exactly your account is using the most inodes.

REDUCING THE INODE COUNT

If the inode count for your account is too high, you should try to determine the cause as soon as possible so you can bring it back down to an acceptable level. Some common causes of high inode usage are:

  • Cron jobs or other automated processes: Automated processes, such as cron jobs, can create a large number of files very quickly. Either modify or disable the cron job, or delete the unwanted files.
  • E-mail messages: Old messages in the Trash and Sent folders of users' mailboxes often accumulate. You can download these messages to your local computer (if you want to save them), and then delete them on the server.
If your web site's storage needs are increasing, please contact our support department at [email protected] to discuss upgrade options.
Was this answer helpful? 0 Users Found This Useful (1 Votes)