7

I'm looking for a way to have a tmpfs-like file system that can be unlimited in size, but will use a specified amount of RAM after which the "oversize" data will be stored on another disk-backed filesystem

tmpfs

I'm running on a SSD-only system, with low available space (usually < 3 GB), so I don't want to reserve any space for SWAP or similar (that's my main requirement)

Do you know of any solution that would fit my use-case ?

mickael9
  • 171
  • 3
  • 1
    The functionality you desire is already the default behaviour. Linux automatically caches files in RAM for you. Maybe you should describe your use case in more detail. – frostschutz Apr 22 '16 at 22:32
  • If Linux already does this then why do some distros use the tmpfs file system for `/tmp/`? I'm assuming Linux's default cache behavior is designed for persistent files and won't handle this use case that well – Heath Mitchell Jan 11 '22 at 20:48
  • @HeathMitchell tmpfs is used to help *writes*: no reason to waste SSD wear (or tie up HDD writing) on a temporary file. It also probably makes it likely to stay in RAM for longer (although it still *could* get swapped to disk). – DimeCadmium Jul 20 '22 at 21:22
  • As far as a use-case: I have 32GB of RAM, most of which is unused most of the time. I can not max out my download speed when writing to my SSD. I *can*, and would like to, max out my download speed when writing to RAM. (This would also avoid unnecessary wear and trims.) However, not all files will be <32GB, and I won't always have enough RAM available either. (In either case, the file must be copied to HDD after being downloaded - usually also extracted etc - so the fact that a tmpfs has no persistence has only upsides). But, since when does SO require a use case? The question is clear. – DimeCadmium Jul 20 '22 at 21:27

0 Answers0