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

Re: Moving /tmp to tmpfs makes it useful



Serge wrote:
> you eat cache memory. Meaning, you store /tmp files in cache even when
> they're not used, so kernel cannot use that memory to store some useful
> files. This increases I/O and makes the system slower.

The tmpfs files will be written to swap if they aren't accessed much and
the kernel wants to cache other files.


> I mean, why would people want that feature? The only case I can think of:
> people with notebooks having SSD-disks, who want to reduce number of disk
> writes. And they usually want to do that for the whole disk, not just
> /tmp. There're a lot of ways to do that (starting from tuning kernel

The reason "normal" filesystems write data to disk relatively soon is
not that it would be good for performance, but to avoid losing data in a
crash. Even if you're willing to accept a somewhat higher risk of data
loss on such a notebook, you'd very rarely want to use settings
appropriate for /tmp where it's OK to lose any or all writes done since
the machine was booted up. Thus your "do that for the whole disk"
comparison is wrong.

Also, nowadays normal filesystems are journaled; using a journal for
writes to /tmp damages the SSD for zero benefit.



Reply to: