My Server Is out of Inodes. How Do I Solve It?

Here we are going to explain how and where you can typically free up inodes (deleting files and folders) for our most common applications.

Cloudways Product avatar
Written by Cloudways Product
Updated over a week ago

Inodes are pointers to files and folders on your server. The number of available inodes on a server depends on the disk size and it is limited.

Due to a number of reasons (typically too many log files, session files …) you can run out of inodes. If this happens, no new files/folders can be created and your server will malfunction.

Here we are going to explain how and where you can typically free up inodes (deleting files and folders) for our most common applications.

How to Check Inodes Usage

First, let’s talk about HOW? In order to check the inode usage on your server, you will need to first access it via SSH, this can be done in different ways:

  1. You can access by launching SSH terminal from your Cloudways platform, we have a handy tutorial on how to do this in the link below:

    How to Launch an SSH Terminal from the Cloudways Platform

  2. Or by using PuTTY (Windows) or the SSH command (Linux/macOS) as shown in the link below:

    Guide to Connecting to Your Application Using SSH/SFTP

Once you are logged in, you can first check the overall inode usage on your server’s disk by using the command below:

df -i

This will give you a result similar to the following example:

You can find a very brief explanation of each column below:

Filesystem: Displays the name of the storage.

Inodes: Displays to the total amount of inodes available.

IUsed: Displays the amount of inodes used.

IFree: Displays the amount of free inodes.

IUse%: Displays a percentage of inode usage.

Mounted on: Displays the path where the filesystem was mounted.

The most important thing to keep in mind with this information, is that the value under “IUse%” should always be less than 100%, since reaching that value may cause many issues.

Now, let’s say that your server is about to or has reached the dreaded 100% and you have many applications in it, so you need to know which one of your applications is the one consuming most of the inodes. In this case, first you would go to your applications directory with the command below:

cd /home/master/applications

This will move you to the directory where all of your applications are located as shown below:

Once there, you can run the following command we have prepared for your ease, simply copy, paste and run it:

find -mindepth 1 | cut -d/ -f2 | uniq -c | sort -n

It will give you an ordered list of the inode usage of each of your applications, like shown below:

And the same command can be used inside of each of the applications, by going into the desired directory and running it again, example below:

Below you can find a list of common locations where inodes builds up for popular applications:

Magento

For Magento, most inodes are typically used with session files located inside public_html/var/sessions in your Magento application folder.

We recommend deleting files older than seven days within this folder.

Do not delete all files as this will delete current sessions and will create trouble for your store.

WordPress

For WordPress, normally high number of inodes are consumed in WordPress files located inside public_html/wp-content folder.

Drupal

In the case of Drupal, you’ll find a large number of files inside the cache folder of public_html/cache. We recommend clearing it approximately every month (you can create a cron for it).

Joomla

Like Drupal, the typical location for a large number of files is the public_html/cache folder that should be cleared on regular basis. You can create a cron for this as well.

Other Applications

Other applications don’t have a clear location where you’ll find a lot of files. You will have to look around inside the different folders.

That’s it! We hope this article was helpful. If you need any help, then feel free to search your query on Cloudways Support Center or contact us via chat (Need a Hand > Send us a Message). Alternatively, you can also create a support ticket.

Did this answer your question?