putting "/tmp" to memory

Roberto Ragusa mail at robertoragusa.it
Mon Jan 24 12:43:39 UTC 2011


On 01/23/2011 02:47 PM, kellyremo wrote:
> 
> "to memory" means: mounting a ~2 GByte filesystem [ tmpfs?, or ramfs? ], and put the "/tmp" on it. [ e.g.: 4 GByte ram in the pc ]. what to write in the "/etc/fstab"?
> 
> I would like to collect the [ answers too:P ]:
> 
> Advantages:
> - Memory is way faster then HDD/SSD, so it could speed things up
> - "SSD amortization" is less

Consider that if you create a file in /tmp, then read it, then delete it,
it is likely that nothing was ever written to the disk, as you have
just worked inside the Linux cache.

This happens very easily with "small" files (no DVD) if everything completes
in less than 30 seconds and the system is not under memory pressure.

Using tmpfs will gain you almost nothing.

Without tmpfs: use the disk, but actually just use mem if possible.
With tmpfs: use the mem, but actually use the disk (swap) if necessary.

They are more similar than one would expect.

-- 
   Roberto Ragusa    mail at robertoragusa.it


More information about the users mailing list