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

Re: Moving /tmp to tmpfs makes it useful



On Fri, 25 May 2012 21:56:55 -0400
Ted Ts'o <tytso@mit.edu> wrote:

> 
> The major difference is that tmpfs pages only get written out to swap
> when the system is under memory pressure.  In contrast, pages which
> are backed by a filesystem will start being written to disk after 30
> seconds _or_ if the system is under memory pressure.
> 

I still think the major difference is that page cache -> ext2 can be quota'd while tmpfs -> swap cannot (AFAIK; has that changed in the past couple of years?). This may be good or bad depending on your use case.

> 
> And if you consider how much memory most desktop/laptops have, and how
> often people **really** are downloading multi-gigabyte files to /tmp
> (note that browsers tend to default downloads to ~/Downloads)

Browsers write files to ~/Downloads (or ~/Desktop) *when the user selects "Save As"*. On Iceweasel and Chrome at least, if you click a link to a content-type the browser cannot natively display, it downloads it to /tmp while it's waiting for you to tell it what to do with it. These files can be arbitrarily large.

Weldon


Reply to: