In time, you might notice that the disk space is getting critically low on your machine and you start receiving alerts.

We recommend that you do not ignore them and act promptly to ensure that your server is 100% operational.

Here are some tips from the Bunnyshell Team:

  1. Install ncdu (sudo apt install ncdu) and try to see what is using up most of the space using the command: sudo ncdu /

  2. If you are using OpenLiteSpeed and /var/log/lsws is taking too much space please run the following script as root (sudo su)

    # to reduce verbosity of the logs
    find /usr/local/lsws/conf/ -name '*.conf' -exec sed -i 's/logLevel DEBUG/logLevel INFO/g' {} \;
    find /usr/local/lsws/conf/ -name '*.conf' -exec sed -i 's/logLevel 9/logLevel 0/g' {} \;
    systemctl restart lsws
    grep -R logLevel /usr/local/lsws/conf/
    cd /var/log/lsws/

    # now you can delete the logs that are taking too much space
    rm *2021_*
  3. Make sure you flush the journald logs as they tend to grow over time (/var/log/journal)

    journalctl --disk-usage
    journalctl --vacuum-time=2d
  4. If you are using your own backup solution, you will need to ensure that you clean them up as they can take up a lot of space over time. These backups are usually present in the application folders: /var/www/<name_of_application>/app/

  5. If you are using WPReset (WordPress plugin) our recommendation is to remove it. That plugin is known to cause excessive writes to the MySQL database which can easily fill up your disk space. You can tell if this is the case if you have an excessive number of binlog files in /var/lib/mysql/. Do NOT delete them by hand. Please refer to the MySQL documentation for the clean-up procedure.

  6. If you are using rank math pro (WordPress plugin) please remove it. Customers reported that this plugin filled their databases and thus lead to space exhaustion.

  7. Check the logs. It can be that your logs are not being rotated correctly, therefore it is good to check if they are taking too much space. In order to check this, you will have to take a look in /var/log. If you need to clean the logs follow the steps listed in this article.

    1. If you are using OpenLiteSpeed check that the logLevel is set to INFO or 0 depending on the configuration.

    2. You can empty some files such as bunnyshell.log or discovery.log using the command: echo '' > /var/log/bunnyshell.log

Generally, you can expect your server to consume at least 6GB of space on the OS and the needed tools and up to 4GB of space for swap usage (in some scenarios). This means that, just for your server to function, 10GB are used by the server itself.

Furthermore, if enabled, the backups for the database or applications, you can expect even more space to be used by those operations.

If you wish to learn more about backups and restore, please be sure to give this article a read.

If you find that the remaining space is not sufficient after cleaning your server, then we recommend that you either increase the disk size or change your instance type to something more suitable for your needs.

This article might help you if you wish to learn how to add more storage to your VM.

Did this answer your question?