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!
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.
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!
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.