Exceeded disc space quota is a common reason for the improper functioning of services on VPS or dedicated servers. Main symptoms: websites on the server don’t answer or connection with the database is lost. The first thing you need to do when web server services or database servers are down is checking the disc space. To do this, connect to the server via SSH and enter the following command:
You will see all partitions and how much space they take up. Based on the partition size, you can see what it is responsible for. If your main partition is 100% occupied, you need to clear up some space. To find out, which folders take up the most disc space, use the following command:
du -sh /*
If you see that a certain folder takes up too much space, use this command and check the size of the subfolders in this folder. For example, if the var folder takes up the most space, run this command:
du -sh /var/*
Repeat this process until you find specific files that take up the most disc space. Most often, these are log files. You can delete them with no consequences and thus bring your disc space back to the norm.
After clearing your disc space, restart web server services and database server:
service httpd restart (for CentOS)
service apache2 restart (for Ubuntu)
service mysqld restart
If you want logs to be deleted automatically, we recommend using logrotate package. With it, you can forget about this issue for good.