Temporary files: RAM or disk?
Posted Jun 7, 2012 15:44 UTC (Thu) by giraffedata
In reply to: Temporary files: RAM or disk?
Parent article: Temporary files: RAM or disk?
At least on our compute servers (running some vaguely recent Ubuntu, IIRC), swap-in is definitely not doing successful readahead
That's probably a good reason to use a regular filesystem instead of tmpfs for large temporary files.
I just checked, and the only readahead tmpfs does is the normal swap readahead, which consists of reading an entire cluster of pages when one of the pages is demanded. A cluster of pages is pages that were swapped out at the same time, so they are likely to be re-referenced at the same time and are written at the same spot on the disk. But this strategy won't effect streaming, like typical filesystem readahead.
And the kernel default size of the cluster is 8 pages. You can control it with /proc/sys/vm/page-cluster, though. I would think on a system with multi-gigabyte processes, a much larger value would be optimal.
to post comments)