Managing the inode count
Learn what an inode count is, how to check it for your account, and how to reduce it if needed.
What is an inode count?
Section titled “What is an inode count?”An inode is an internal data structure that Linux uses to store information about a filesystem object (file or directory). The inode count equals the total number of files and directories in a user account or on a disk. Each file or directory increases the count by 1.
To ensure server reliability and performance, Ruachost.com imposes inode limits on shared hosting accounts. If your account reaches the limit, you need to reduce it by removing files or directories.
Why inode limits exist
Section titled “Why inode limits exist”- High inode counts can cause long filesystem checks, impacting server uptime.
- Large numbers of files slow down backups and restores; many small files take longer to recover than fewer large files.
Determining the inode count
Section titled “Determining the inode count”The method depends on your hosting package:
- Shared or reseller hosting: Use cPanel or the command line.
- Managed VPS, managed dedicated, or unmanaged packages: Use the command line.
Method 1: Using cPanel
Section titled “Method 1: Using cPanel”-
Log in to cPanel.
-
In the STATISTICS sidebar, locate File Usage.
- The first number shows the inodes used.
- The second number shows the maximum allowed.
Method 2: Using the command line
Section titled “Method 2: Using the command line”- Log in to your account via SSH.
- Navigate to your home directory:
cd ~- To see the total inode count:
find . | wc -l- To see inode usage for each top-level directory:
echo "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"Tip: Change to a subdirectory (e.g., cd public_html) and rerun the command to find which folders are using the most inodes.
Reducing the inode count
Section titled “Reducing the inode count”If your inode usage is too high, identify the cause and take action. Common causes include:
- Cron jobs or automated processes: These may create many files quickly. Modify or disable the process, or delete unnecessary files.
- Email messages: Old emails in Trash or Sent folders accumulate. Download if needed, then delete them on the server.