Report this

What is the reason for this report?

Droplet Disk Space Slowly Filling?

Posted on March 19, 2018

Apologies if this is a noobish issue, but I’ve noticed that according to my graphs, my disk space is slowly filling up, at the rate of about 0.01% an hour. I know that rate is pretty slow, but I’m still confused as to why it’s happening. For context, I’m using my droplet as a webserver, with apache, PHP, and Let’s Encrypt. Could it have anything to do with Apache logs? Clearing them doesn’t seem to do anything, but restarting the droplet brought the used disk space down from 6.08% to 5.88%.



This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

It is most likely log files as you suspected.

If there is a running process, like Apache, that is writing to a log file, and you delete the log file the space will not be freed up. This is because though the links to the file are gone from your file system and you won’t see them when you do a directory listing there is a still a running process that has a pointer to that file which is open.

That is why if you delete the log file and then reboot the running process, like Apache, the space is freed up.

Alternatively if you want to clear out space from a log file without restarting the application you can do:

# cat /dev/null > /path/to/log.file

I would also assume the issue can be caused from large log files. What you can do is implement logrotate to prevent log files to consume large portions of your available disk space.

https://www.digitalocean.com/community/tutorials/how-to-manage-logfiles-with-logrotate-on-ubuntu-22-04

You can also check this article:

https://docs.digitalocean.com/support/how-do-i-fix-disk-space-issues-on-my-droplet/

Hope that this helps!

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.