Your VPS your dedicated server has run out of disk space Print

  • 0

Problem Description

You've run out of disk space on your dedicated server or virtual private server (VPS)

This could exhibit itself in many ways, like:

  • Your website is not responding
  • Plesk does not open with a database server error indicating insufficient disk space
  • If you're using mail services hosted with Postfix on the server, one of the first things you'll probably see is emails with the subject "Postfix SMTP Errors" and body like this:

Transcript of session follows. Out: 220 [YOUR_SERVER] ESMTP Postfix In: EHLO [SENDING_SERVER] Out: 250-[YOUR_SERVER] Out: 250-PIPELINING Out: 250-SIZE 51200000 Out: 250-ETRN Out: 250-STARTTLS Out: 250-AUTH CRAM-MD5 LOGIN PLAIN Out: 250-ENHANCEDSTATUSCODES Out: 250-8BITMIME Out: 250 DSN In: MAIL FROM:<FROM_ADDRESS> BODY=8BITMIME Out: 452 4.3.1 Insufficient system storage

Problem Resolution

To bring things back online as quickly as possible we strongly recommend upgrading resources now (option 1 below), then you can sift through storage with option 2.

Tip: after you've completed one or both of the options below, occasionally system services will continue to misbehave. To prevent this from being a problem a quick reboot of your VPS is recommended. This can be done from within the Client Centre.

Option 1: Upgrade your storage resources

You can do that from within the Websavers Client Centre. Once logged in, select Settings for your VPS, then under Configuration, choose edit, and select the next largest storage option and complete your order. If things do not return to normal within 5 minutes, you may need to choose the option to reboot your VPS -- this is on the same page as the configuration listing and edit button.

Option 2: Find the cause / remove larger data

If you don't have any information to go on as to what might have caused your storage to fill up so abruptly, then you'll need to find the source of the problem first. Here's how.

If you have Plesk Control Panel:

Login to Plesk as admin/root and navigate to Extensions > Search for "Diskspace Usage Viewer" > Get it Free to install it. Press Open when done. It will take some time to analyze larger directories, which typically means /var. Scrolling to the very bottom shows a pie chart breakdown of the largest directories.

If you host websites, /var/www/vhosts will likely be your largest directory. If you host large mail accounts /var/qmail/mailnames will likely be your largest directory.

Command Line Only:

If you aren't using a control panel or if Plesk isn't showing everything clearly enough for you, then you'll need to do some command line sleuthing. Connect via console / ssh and proceed as follows for CentOS. Other package managers will likely have the ncdu program as well:

yum install ncdu --enablerepo-epel

Once installed, run it:

ncdu /

It will quick scan your system and provide you with a breakdown of storage usage on the system. From there you can navigate through the folder structure with the arrow keys on your keyboard, looking for anything unusually large. Note: If you're using Plesk, it's *always* best to try using Plesk to find the large files first prior to falling back to command line options. This is because removing files out from under Plesk can cause inconsistencies in the Plesk database.

Common Storage Usage Causes

Backups

Look at your backups and perhaps remove some older ones, or set your backup solution to store your backups in cloud storage like Dropbox. If you're using Plesk, you can learn how to do that here.

Large Log Files

If you've identified large log files are taking up space, look over the logs to learn why. The errors within usually indicate why they're being reported in the log file with a rough indication as to where the log entry is coming from in the code - you can then look at the code to repair the issue generating the log entry.

Warnings not needed in logs? If the reason for the excessive logging is because of numerous warnings that are not critical errors, it's still recommended to try to fix whatever teh warning is indicating because in future updates, these warnings may become critical errors. However if you prefer not to do this future-forward approach, you could read the manual for the application and learn how to turn down the types of logging - often application config files allow you to choose this.

Rotation not occurring? If you've found one large log file, or a bunch of files that are not compressed, and you use Plesk on your server, you can configure Plesk to force log rotation to solve this. Once you make that change, within 24 hours the existing large log files will be compressed and rotated. If you wish to force them to compress and rotate now, you can run the following commands via shell:

/usr/local/psa/admin/sbin/statistics --calculate-all
/usr/local/psa/logrotate/sbin/logrotate /usr/local/psa/etc/logrotate.d/*

 


Why didn't I receive a notification about disk space usage?

This is a commonly related question.

We do have alerts that go out for disk space as you approach the storage limit, however our system only obtains the disk usage for notifications once daily. In some cases the disk hasn't yet reached the alert limit when our disk space usage checks are run, and then it quickly fills up before such a notification could be generated 24 hours later.

One example of this happening is if a backup process is backing up 50% of your total used disk space, it needs roughly that same qty of space available to create the backup and it uses it pretty fast (in less than an hour typically). That's the kind of situation where our notifications aren't able to work fast enough to alert in time.


Was this answer helpful?

← Back