4 ms·
It's a lot slower to write a large file to a ram based /tmp and let it swap out, vs writing that file to disk directly. If they want to do this they need to mo
by ars 2y ago
It's a lot slower to write a large file to a ram based /tmp and let it swap out, vs writing that file to disk directly.
If they want to do this they need to modify tmpfs to do a better job of shifting data to disk when full, instead of letting swap handle it.
- throwaway984393 2y agoYou can specify the size of the tmpfs and keep it well below the size of RAM, which will greatly reduce the likelihood of a long-lived tmpfs from causing swapping. But more importantly, don't write large files to /tmp/. Back in the day we gave /tmp/ its own partition just so those files didn't fill up the root mount. Write big files there and it would fill up. Plus, big files benefit more from a faster drive, and back in the day we used to put the root mount on a slow disk, and have a fast big data disk which is better for large files. I think an option to prevent tmpfs from getting shifted to swap (or disk) at all would be great.
- MrDrMcCoy 2y agoNot true if you enable zswap. The pages stay compressed in a RAM pool, and are only sent to the real swap on disk in their compressed states when that gets full. This significantly reduces I/O overall.