Every hosting plan has a finite amount of disk space. On top of that, individual email or FTP accounts may also have quotas. When a quota has been reached you can no longer write data to the server’s file system, and you will therefore see an error.
When you run out of disk space incoming emails can’t be delivered to your inbox. The emails are kept in the mail queue for up to a week, and during that time the server tries to deliver the emails at set intervals. After a week the server gives up, and the emails are bounced back to the sender.
As said, FTP is also affected. When you upload files via FTP you may see an error 451. For instance, in FileZilla you typically see “451-error during write to file” in the message log.
Image: FileZilla showing an error 451 (“Error during write to file”).
Similarly, when you upload a file using cPanel’s file manager you get the error “Maximum file size allowed for upload: 0 bytes”.
Image: cPanel is not allowing files larger than zero bytes to be uploaded.
In short, when you run out of disk space pretty much everything stops working. The only exception are databases. There is a good reason why databases are not affected by disk space quotas: your data gets corrupted if writes fail.
Each email address has a disk space quota. You can change the quota, and you can even set it to “unlimited”. That sounds ideal, but it doesn’t give you unlimited space for your email. Changing the quota to “unlimited” only means that the mailbox is never be considered full. If you hit the quota for your hosting plan your email still stops working.
To illustrate the point, let’s imagine that your hosting package has 500MB of disk space. You got one mailbox, and the quota is set to 1GB. When the mailbox is 500MB in size the hosting package has run out of disk space, even though the mailbox is only half-full.
Image: the ‘Email Accounts’ overview in cPanel. Here, email@example.com has a quota of 1GB, and the mailbox is using 500MB.
On cPanel servers you get a notification email when your account uses over 80% of its disk space quota. The email is sent to the email address(es) shown under Preferences » Contact Information. It is a good idea to have at least one email address that is not hosted on the server. That is because your email stops working when you suddenly run out of disk space – you wouldn’t receive the warning email.
You can check how much disk space your account uses via cPanel’s Disk Usage interface. One thing to bear in mind is that the statistics shown are unlikely to be bang up to date. The disk usage stats are refreshed every few hours, so cPanel may still show that your account is over its quota after you have cleared some space.
If you got SSH access then you can get more accurate data. The following command lists the 20 largest files and directories, sorted by size:
$ du -ah /path/to/directory/ | sort -hr | head -20
You might also want to look for backup files. This command lists all .gz, .wpress and .zip files that are larger than 5MB:
$ find /path/to/directory/ \ -type f \ -name *gz$ -or -name *wpress$ -or -name *zip$ \ -size +5M \ -ls
Please feel free to contact us when your account has reached its disk space quota. We can check if it is possible to clear some space, and if needed we can temporarily increase the quota. The latter is useful, as even removing files can be difficult when your account has run out of space.
The two most common reasons for disk space issues are large backup files and large email accounts. There can be other reasons though, such as large log files or databases.
If you use Softaculous or a WordPress plugin to take regular backups then you probably want to stop doing so. The backups can be very large, in particular if your website has lots of binary files (such as images). Keeping those backups on the server doesn’t make a lot of sense. You can instead use cPanel’s Backup tool. Doing so has two advantages:
A downside of cPanel’s backup feature is that you need to make the backups manually. In general, it is good practice to make a backup before you do any major work on your website. That way you can always roll back any changes you made. In addition you may want to do the occasional backup – say, once a month. You don’t really have to make backups more often, as we already make a full backup of all our servers every night. The backups are retained for seven days, so we can always roll back your website if disaster strikes.
Email accounts can grow very quickly. If you are using an email client such as Outlook, Mac Mail or Thunderbird then you can archive old emails locally. Emails you archive are moved from the mail server to your email client, which means that you still got access to your emails.
If you prefer to store all your emails on the mail server then you may want to consider separating your website and email hosting. For instance, our Office 365 plans come with 50GB mailboxes. By using Office 365 you are unlikely to ever need to worry about disk space quotas, and you get some other benefits as well, such as shared contacts and calendars.
Another option may be to delete emails that are older than a certain date. You can do so via cPanel’s Email Disk Usage feature.
You can also have a look at the default mailbox. This mailbox collects bounce emails for emails that have been sent by a script, cron job messages and, depending on how the mailbox is set up, emails sent to non-existing users. If the mailbox is very large then you can probably empty it. At the same time you may want to check why the mailbox is collecting lots of emails. Often, a large default mailbox points to an issue with your account. For instance, lots of bounce emails in the inbox may indicate that a lot of spam is being submitted via forms on your website. Or, lots of cron emails may indicate that one or more cron jobs aren’t working correctly.
There are other possible reasons why your website is using a lot of disk space. If your website is generating lots of PHP notices, warnings and/or errors then there may be very large error_log files. You can safely delete these files, but we strongly suggest to first investigate the errors.
When you upload an image via WordPress it will, by default, create three additional image files: a thumbnail, medium-sized and large-sized image. That is useful, as it enables your WordPress install to serve relatively small images (which makes web pages load faster). It also means that you don’t have to worry about the size of the original image you upload.
Uploading really large images does mean, however, that you are wasting disk space. The original images are stored on the server, even if they are not used. It is therefore best practice to optimise images before you upload them, for instance by cropping and/or resizing them.
It is also worth noting that some WordPress themes create lots of additional images files from images you upload. Most of these image sizes may never be used, but the images do of course take up space. You may be able to limit the number of images that are created in the theme’s settings.
You can see the size of databases via cPanel’s Databases interface, and if you got a large database then you can check the size of individual tables via phpMyAdmin. If you click on the database name in the left-hand pane you get an overview of all tables. The last two columns show the Size and Overhead. You can click on the header to sort the tables. For instance, clicking on the Size header sorts the tables by size.
Troubleshooting disk space issues can be tricky. If you are not quite sure how to deal with a disk space issue, please do contact us.