[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Idea: mount /tmp to tmpfs depending on free space and RAM



2012/6/12 Bjørn Mork wrote:

> I still think that the easy tmpfs resizing makes it superior for /tmp.

Why do people repeat that tmpfs is easy to resize? Yes, you need about 3
commands to resize tmpfs, but you need 0 (zero!) commands to resize /tmp on
disk, because it's large by default and you don't need to resize it. It's
easier to NOT resize /tmp on disk then resize /tmp on tmpfs, isn't it? ;)

And there's more. You can't separate application data from your files
on tmpfs in swap. But you can do that on a regular filesystem. You can
dedicate /tmp directory to a separate partition/disk. Or you can balance
it among several partitions (see `mhddfs`). You can't do that with tmpfs.

> we might need a daemon monitoring /tmp and doing ondemand resizing.

Since tmpfs+swap is mostly slower than regular filesystem and may generate
more writes... I can't think of any cases where such daemon would be better
than a usual /tmp on disk. But if you need it somewhy... check swapd.

PS: I'm curious can swap-files break suspend-to-disk even for users
having a separate swap partition?

-- 
  Serge


Reply to: