Hacker News new | ask | show | jobs
by MichaelGG 3242 days ago
What if you're using a program that fsyncs? And the filesystem isn't just keeping writes cached and flushing only when full. So if I'm writing GB of temp files, I'm causing tons of disk load which may impact other programs. Can't seek to read while writing all my temp data...
2 comments

> What if you're using a program that fsyncs?

Remove the fsync or use libeatmydata.

> So if I'm writing GB of temp files

The kind that won't fit on a ramdisk in the first place? And this particular use case shouldn't need that.

The scenario is I'm running a DB on the same system as temp program. Also, machines with many GB of ram are popular these days.
If fsync on one file forces all other files to disk, then it is 100% an OS performance problem.

If your temp files fit in ram along with running programs, then they should stay cached. A ramdisk should only be needed in edge cases where you want to manually force other things out of memory, or because you particularly want to avoid extra writes to disk. In general performance is supposed to be boosted just as much by caching.

If your disk head is writing the temp file, then it can't be sitting idle waiting to fsync. And it'll eventually write as part of checkpointing.
That's actually a good point.