File Count – Do I have too many files?
What is inode usage or file count?
An inode is an entry in a file system’s database, and inode usage is the total number of files or directories/folders in your webhosting account. This file count includes everything on your account: emails, files, folders, images etc – anything you store on the server.
Directories with a large file count (regardless of their size) can compromise a server’s performance, and take a long time to back up. For this reason, the maximum number of files per directory, as well as files per hosting account, are restricted.
Our limits are 50 000 files per directory, or 200 000 files per hosting account. As per our Acceptable Usage Policy, accounts exceeding these limits will have those files and/or directories excluded from our backup system.
How will I know if I have too many files?
- Should your account have any directories which exceed this limit, an email notification per domain will be sent to both the Account Owner and the Technical Contact specifying a list of problem directories. This will allow you to take action by reducing your file count and thereby ensuring that your account remains backed up.
- You can use an FTP client to view and manage files on the server (see below).
How to understand the directories
- The home directory is the main folder/directory within which all the other folders are located. Common culprits for folders which contain too many files here are backup folders, which can safely be removed as all site content is within the public_html. They are usually recognized by “backup” and a date in the folder name.
- The public_html is a folder/directory within the home directory, and contains all the publicly visible website content. If this folder has too many files, then it is the site content that needs to be adjusted.
- The users directory contains email. If this directory has too many files, then email needs to be deleted off the server.
How to understand the /users/ directory
The users directory of the hosting account is the directory where all email is stored
The word after users – in this case info, is the name of the email account (i.e. email@example.com).
The last word reflects the particular mail folder within that email account, which can be:
- cur which refers to read mail
- new – unread mail
- .Spambucket – messages that have been marked as spam and automatically diverted to the spambucket
- .Trash – messages sent to the Trash bin by the user
- .Sent – messages that have been sent
In this sample case above, the problem is caused by excess unread mail in the mailbox firstname.lastname@example.org. This mail should be deleted.
How can I reduce the file count?
Delete unnecessary files – many files stored within your hosting account may no longer be necessary and are just adding to both your disk usage and inode count. Use FTP to view, download or delete files.
1. Remove older email
Email accumulating on the server can lead to both disk- and inode-overusage i.e. both large volumes and large numbers of emails. If your email is set up to use IMAP (the default setting), then all mail stays on the server and adds to your file count.
- Within your hosting account, mail is found in the users directory. If this directory or a sub-folder becomes too large, check if the problem is caused by a spambucket or trash folder that needs deleting, or a catch-all mailbox that is ignored. This mail can be deleted:
- If you have accumulated large amounts of legitimate mail, then use your mail client (e.g. Outlook, Thunderbird) to back up or archive your mail, and then delete it from the server. Remember to empty the trash after deleting.
2. Remove backup files
If your site has been restored from a backup via the konsoleH Restore Tool, then a directory called backup_<date> may be left over, which should be deleted.
CMS’s like WordPress or Joomla may use backup extensions or plugins which place backup files in your hosting account. These files, which are usually recognizable as .zip, .gzip, and .tar.gz, can be downloaded via FTP and stored elsewhere, and then deleted from your account.
3. Reduce your cache files
CMS’s such as WordPress and Joomla can generate large numbers of cache files in order to improve site speed through various plugins e.g. W3 Total Cache for WordPress. The problem is that an excess of caching can cause inode overusage.
Use the Purge Cache function inside the administrative area for clearing such files, or suitable plugins.
Note: Excessively high file counts can cause Webmail, FTP or SSH to timeout. If you are not able to delete these files yourself using these methods, contact email@example.com for assistance.
How can I find the number of files per directory?
Use an FTP client, such as FileZilla to view the files within your account on the server.
Clicking on a directory gives a count of the number of files in that directory as well as the total directory size. In the example below, the Log Files directory, www_logs contains 2 764 files.
The public_html directory contains all webfiles, and the users directory contains all email.