What is an Inode Count and how to check it

Overview of your hosting account's Inode Count

In this tutorial, we will review what inode count is and two methods on how to check the inode count via your cPanel and our specifically made for this job tool.

 

Inode is the internal data structure that Linux use to store information about the file system object. The inode count is equal to the count of all files and directories in the user account. This includes everything on your account, emails, files, folders and anything you store on the server, for example, each new file or directory add a 1 to the total inode count.   

 

In order to maintain high performance and to provide our clients with enough inodes, we from FastComet provide our clients with up to 500,000 inodes with our shared hosting packages.

 

To manage your Inode Count, you will need to:

Step 1 Check the Inode Count

In this step, we will review how to check the inode count via cPanel .

 

• If you are using our shared hosting packages, the inode count can be easily checked via the cPanel's Stats column which is placed on the right side of the page. At the Stats column check the File Usage row. On the left side of the slash ( / ) is indicated the inode usage for the account and on the right side of the slash character, the numbers indicate the maximum allowed inode usage for the account. in other words, 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. In our example image, you can see that we are using 71,992 out of 350,000 maximum allowed for the ScaleRight package.

 

Inode Count viewed in cPanel

 

For a detailed check on your inode count, you can use our tool which available again via your cPanel with us. More on the functionality of the tool can be found in our Inode Usage tutorial.

If for some reason, you are operating on a cloud SSD VPS or Dedicated server without cPanel (ot many cPanels which will make checking them all a lot of hassle), the inode count can be checked via SSH. To do this, you will have to have SSH access and assure that the SSH connection is established.  Then, to get a list of the inode count for every directory in the directory you are currently in, execute the following command:

echo "Detailed Inode usage for: $(pwd)" ; for d in `find -maxdepth 1 -type d |cut -d\/ -f2 |grep -xv . |sort`; do c=$(find $d |wc -l) ; printf "$c\t\t- $d\n" ; done ; printf "Total: \t\t$(find $(pwd) | wc -l)\n"

 

Note

The execution this command could take some time if you have a large number of files.

 

Step 2 Reduce the Inode Count

If you are at the inode count limit or you are close to reaching it, you should have already be notified by our Observer Monitoring System. This means that you should check the most common causes for the high inode usage:

 

• Cron jobs and other automated process. The cron jobs which are considered for automated process can create a large number of files. Check the cron jobs and modify or disable the unnecessary and delete the files generated by the same.

 

Cron Jobs

You can check all of your cron jobs via the cPanel account -> Cron Jobs. Also, check our article How to disable the mail alert by cron job command for further guidance.

• As we have mentioned the email messages also are part of the inode count, check your Trash and Sent folders of all email accounts and delete the unnecessary messages. If you would like to save those messages, you can download them on your local computer and delete them from the server.

• Check for old backups and unused files, once you locate such remove them.

 

All of this explained in further details and more on how to maintain a healthy Inode count can be found in our respective tutorial series on the matter.