Every hosting package has a finite amount of disk space, and on top of that individual email accounts or FTP accounts may have disk space quotas. When a disk space quota has been reached you can no longer write data to the server’s file system.
When you have run out of disk space incoming emails can’t be delivered to your inbox. In that case emails will be kept in the mail queue for up to a week, and during that time the mail server will try to deliver emails at set intervals. After a week the mail server gives up, and the emails are bounced back to the sender.
As said, FTP is also affected. When you try to upload files you may see an error 451. For instance, in FileZilla you will see “451-error during write to file” in the message log.
Image: FileZilla showing an error 451 (“Error during write to file”).
Or, when you try to upload a file using cPanel’s file manager you will get the error “Maximum file size allowed for upload: 0 bytes”.
Image: cPanel is not allowing files larger than zero bytes to be uploaded.
You will get a similar error when you try to edit a file via cPanel’s file manager. 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 directly affected by disk space quotas: your data would be corrupted if writes would fail.
Each email address has its own individual quota. The quota can be set to “unlimited”, which sounds ideal. However, changing the quota to “unlimited” only means that the mailbox will never be considered full. It does not mean that you suddenly have unlimited space for email. Once you hit the quota for your hosting package your email will still stop working.
To illustrate the point, let’s imagine that our hosting package has 500MB of disk space. We got email account, and we set the quota 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, the firstname.lastname@example.org email address has a quota of 1GB, and the mailbox is using 500MB.
On cPanel servers you will get a notification when your account is using over 80% of disk space. The emails are 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 will stop working when you suddenly run out of disk space – you wouldn’t receive the warning emai.
You can check how much disk space your account is using via cPanel’s Disk Usage menu. One thing to bear in mind is that the statistics shown are unlikely to be bang up to date. cPanel refreshes the disk usage stats every few hours, which means that it may still show your account is over 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 ./ | 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 ./ -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 is possible to clear some space, and if needed we can temporarily increase the disk space quota. The latter is useful, as even removing files can be difficult when your account has run out of space.
There are two common reasons for disk space issue: backup files and email accounts that have grown very large.
If you are using Softaculous or a WordPress plugin to take backups then you probably want to stop doing so. In particular if your website has lots of images and/or videos backup files will be very large, and keeping those backup 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 make the occasional backups – say, once a month.
Also, we do take full backups on all our servers every night, and we keep backups for seven days. That means that we will always be able to roll back your website when 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 Exchange / Office 365 packages come with mailboxes that are 25 or 50GB in size. By using Exchange 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. This is something you can do via cPanel’s Email Disk Usage feature.
You should also have a look at the default mailbox. Depending on how this mailbox has been configured, this mailbox collects bounce emails for emails that have been sent by a script, cron job messages and emails sent to non-existing users. If the mailbox is very large you can probably delete all the emails. At the same time you probably want to check why the mailbox is collecting lots of emails. Often, a large default mailbox indicates that there is 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.
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 look investigate the issues reported in the file first.
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 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. It is best practice to optimise images before you upload them, for instance by resizing and/or cropping images.
It is also worth noting that some WordPress themes will 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 being created in the theme’s settings.
You can see the size of databases on cPanel’s Databases interface. 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 will sort the tables by size.
Troubleshooting disk space issue is tricky. If you are not quite sure how to deal with a disk space issue, please do contact us.