Hacker News new | past | comments | ask | show | jobs | submit
A neat trick I was told is to always have ballast files on your systems. Just a few GiB of zeros that you can delete in cases like this. This won't fix the problem, but will buy you time and free space for stuff like lock files so you can get a working system.
loading story #47684451
loading story #47675165
loading story #47674725
loading story #47675023
loading story #47675159
loading story #47682746
loading story #47674054
loading story #47676782
loading story #47679067
loading story #47674150
loading story #47676611
loading story #47673973
loading story #47674817
loading story #47675877
loading story #47678957
loading story #47673907
loading story #47674886
loading story #47674217
If you run nginx anyway, why not serve static files from nginx? No need for temporary files, no extra disk space.

The authorization can probably be done somehow in nginx as well.

loading story #47676051
loading story #47676178
> I rushed to run du -sh on everything I could, as that’s as good as I could manage.

I recently came across gdu (1) and have installed/used it on every machine since then.

[1]: https://github.com/dundee/gdu

loading story #47683817
loading story #47676049
loading story #47682348
loading story #47675403
loading story #47675546
loading story #47675280
loading story #47685922
Putting limits on folders where information may be added (with partitions or project quotas) is a proactive way to avoid that something misbehaves and fills the whole disk. Filling that partition or quota may still cause some problems, depending on the applications writing there, but the impact may be lower and easier to fix than running out of space for everything.
I've run into that "process still has deleted files open" situation a few times. df shows disk full, but du can't account for all of it, that's your clue to run lsof and look for "deleted" files that are open.

Even more confusing can be cases where a file is opened, deleted or renamed without being closed, and then a different file is created under the orginal path. To quote the man page, "lsof reports only the path by which the file was opened, not its possibly different final path."

I appreciate the last line

> Note: this was written fully by me, human.

loading story #47682658
I'm not sure that his problems are really over if a LOT of people were downloading a 2GB file. It would depend on the plan. Especially if his server is in the US.

But maybe the European Hetzner servers still have really big limits even for small ones.

But still, if people keep downloading, that could add up.

I remember a story of an Oracle Database customer who had production broken for days until an Oracle support escalation led to identifying the problem as mere "No disk space left".
loading story #47676005
Why not implement x send file ?
loading story #47679624
You missed out point five.

5. Implement infrastructure monitoring.

Assuming you're on something like Ubuntu, the monit program is brilliant.

It's open source and self hosted, configured using plain text files, and can run scripts when thresholds are met.

I personally have it configured to hit a Slack webhook for a monitoring channel. Instant notifications for free!

> Plausible Analytics, with a 8.5GB (clickhouse) database

And this is why I tried Plausible once and never looked back.

To get basic but effective analytics, use GoAccess and point it at the Caddy or Nginx logs. It’s written in C and thus barely uses memory. With a few hundreds visits per day, the logs are currently 10 MB per day. Caddy will automatically truncate if logs go above 100 MB.

Didn't root used to have some reserved space (and a bunch of inodes) on file systems just for occasions like this?
loading story #47684636
Never partition 100%. Simple solution here really and should be standard for every sysadmin. Like never worked with one that needed to be told this...
Wait until you run out of inodes!
loading story #47679703
loading story #47679499
{"deleted":true,"id":47674879,"parent":47627217,"time":1775567698,"type":"comment"}