DEV Community

loading...

Discussion on: The day our web server reached 100% capacity 💾

Collapse
therealkevinard profile image
Kevin Ard • Edited

Hi 👋! I'll be quiet about any of my observations that mirror what's already noted here :) One single character to add that may help you out: du -sh *. That * behaves like the * in ls and most others - it'll give you itemized, summarized, human-readable useage for all of the contents of $PWD.

You can start from / and work yoour way down.

Bonus: du -sh * | sort -h will organize the list - but I wouldn't recommend running that at / with 100% du. It could take some time. There are some other pipes that will limit the results to the x heaviest items, too (for busy dirs).

Collapse
dmahely profile image
Doaa Mahely Author

Hello Kevin! Thanks for that lol.

Yes, du / took forever. I remember experimenting with a few different flags and parameters, but I'm not sure which combination I ended up using to figure out the root cause. Thanks a lot for your suggestions, I'll keep them in mind 👍

Collapse
therealkevinard profile image
Kevin Ard • Edited

Oh another one for clearing du, if you're logrotating and don't need the archives: find /var/log -type f -name "*.gz" -exec "rm -f {} ;"

I typed that on mobile, please don't copy paste lol.

Finds all the rotated .gz logs and nukes em - those add up to A LOT (esp if you're running mod_security lol)