`/var/log/app/app.log` is 180 GB even though logrotate is configured daily, and the disk is about to fill.
IntermediateTroubleshootingDisk, memory and CPU
Answer
Likely causes → Logrotate isn't running or isn't working: the cron/timer is disabled, the config has a syntax error so the whole file is skipped, or rotation happens but the app keeps writing to the renamed file because nobody signals it to reopen.
Diagnose →
systemctl status logrotate.timer
sudo logrotate -d /etc/logrotate.d/app # dry run shows errors
cat /var/lib/logrotate/status | grep app
ls -lh /var/log/app/
Fix → Truncate the live file to free space now (: > /var/log/app/app.log), fix the config, and run logrotate -f /etc/logrotate.d/app. Example:
/var/log/app/*.log {
daily
rotate 7
compress
missingok
maxsize 1G
copytruncate
}
Prevent → Ship logs to a central system and keep only a few days locally, add maxsize so rotation triggers on size, and investigate why the app is logging so much (debug level left on in production).
More on Disk, memory and CPU
The app fails to write with "No space left on device", but `df -h` shows the volume is only 40% used.Beginner`df -h` says `/` is 100% full, but `du -sh /*` only adds up to 30% of the disk.BeginnerA server shows load average 40 on 8 cores, but `top` shows CPU 60% idle and the app is crawling.BeginnerPods are being evicted with "The node was low on resource: ephemeral-storage. Container app was using 18Gi, which exceeds its request of 0."IntermediateCI build agents running Docker fail with "no space left on device" while pulling images; `/var/lib/docker` is 95% full.IntermediatePostgres on a VM died overnight; `dmesg` shows "Out of memory: Killed process 2314 (postgres) total-vm:..., anon-rss:...".Intermediate