public inbox for gentoo-user@lists.gentoo.org
 help / color / mirror / Atom feed
From: Rich Freeman <rich0@gentoo.org>
To: gentoo-user@lists.gentoo.org
Subject: Re: [gentoo-user] tmp on tmpfs
Date: Wed, 24 May 2017 05:34:09 -0400	[thread overview]
Message-ID: <CAGfcS_mNnhQ-Ek71FOpCTFGFdG7yN+eDG6ACz3H9k9=W2xXf+w@mail.gmail.com> (raw)
In-Reply-To: <20170524051002.12325.12B52329@matica.foolinux.mooo.com>

On Wed, May 24, 2017 at 1:16 AM, Ian Zimmerman <itz@primate.net> wrote:
>
> I have long been in the camp that thinks tmpfs for /tmp has no
> advantages (and may have disadvantages) over a normal filesystem like
> ext3, because the files there are normally so small that they will stay
> in the page cache 100% of the time.
>

The file being in the page cache only speeds up reads of the file.  On
a conventional filesystem the file will still be forced to be
committed to disk within 30 seconds, or whatever you've set your max
writeback delay to.  That means guaranteed disk write IO.  If the
drive is mostly idle it will have no impact on performance, but if the
disk is fairly busy then it will, especially for spinning disks.  For
an SSD /tmp would be a source of erase cycles (which also have
performance implications, but there it is more of a wear issue).  When
the file is removed that would also generate write IO.

The flip side is that on most systems /tmp probably doesn't get THAT much IO.

On Gentoo doing your builds in tmpfs definitely has a large
performance impact, because there are a lot of files created during
the build process that are sizable but which don't end up getting
installed (object files mostly).  Plus you have the extraction of the
source itself.  For a typical build that is many MB of data being
extracted and then deleted after maybe a minute, which is a lot of
useless IO, especially when the actual install is probably creating a
fairly sizable IO queue on its own.

To avoid a reply, I'll also note that tmpfs does NOT require swap to
work.  It does of course require plenty of memory, and as with any
situation where lots of memory is required swap may be useful, but it
is not a requirement.

Others have mentioned zram.  I've used it, but unless something has
changed one of its limitations is that it can't give up memory.  That
is less of an issue if you're using swap since it can be swapped out
if idle.  However, if you're not using swap then you're potentially
giving up a chunk of RAM to do it, though less RAM than a tmpfs if it
is full most of the time (which I doubt is typically the case).

-- 
Rich


  parent reply	other threads:[~2017-05-24  9:34 UTC|newest]

Thread overview: 45+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-24  5:16 [gentoo-user] tmp on tmpfs Ian Zimmerman
2017-05-24  5:34 ` gentoo-user
2017-05-24  6:00   ` [gentoo-user] " Kai Krakow
2017-05-24 17:05     ` Kai Krakow
2017-05-25 18:46       ` [gentoo-user] Puzzled by zswap [Was: tmp on tmpfs] Ian Zimmerman
2017-05-25 19:16         ` [gentoo-user] " Martin Vaeth
2017-05-26  6:00         ` Kai Krakow
2017-05-24 18:34     ` [gentoo-user] Re: tmp on tmpfs Ian Zimmerman
2017-05-24 19:30       ` Rich Freeman
2017-05-24 21:16         ` Andrew Savchenko
2017-05-24 22:40           ` Rich Freeman
2017-05-25  6:34             ` J. Roeleveld
2017-05-25 11:04               ` Kai Krakow
2017-05-25 12:23                 ` Rich Freeman
2017-05-25 14:16                 ` J. Roeleveld
2017-05-25 16:06                   ` Rich Freeman
2017-05-25 16:28                     ` J. Roeleveld
2017-05-25 16:41                       ` Rich Freeman
2017-05-25  3:38         ` Kai Krakow
2017-05-25  7:19           ` J. Roeleveld
2017-05-25  3:36       ` Kai Krakow
2017-05-24 17:00   ` [gentoo-user] " R0b0t1
2017-05-24  6:03 ` Andrew Tselischev
2017-05-24  9:34 ` Rich Freeman [this message]
2017-05-24  9:43   ` gentoo-user
2017-05-24  9:54     ` Rich Freeman
2017-05-24 12:45   ` Andrew Savchenko
2017-05-25  4:45     ` [gentoo-user] " Martin Vaeth
2017-05-25  7:24       ` Mick
2017-05-25 15:46         ` Martin Vaeth
2017-05-25 22:36     ` [gentoo-user] " Kent Fredric
2017-05-28 10:07       ` Mick
2017-05-31  0:36         ` Kent Fredric
2017-05-31  7:33           ` Mick
2017-05-24 18:46 ` [gentoo-user] " Nikos Chantziaras
  -- strict thread matches above, loose matches on Subject: below --
2017-05-29 11:09 [gentoo-user] Kernel did not finding root partition Raphael MD
2017-05-29 11:19 ` Rasmus Thomsen
2017-05-29 17:48 ` [gentoo-user] " Kai Krakow
2017-05-29 18:07   ` Raphael MD
2017-05-29 18:16     ` Neil Bothwick
2017-05-29 19:42       ` Kai Krakow
2017-05-30  8:26         ` Peter Humphrey
2017-05-30 17:08           ` Raphael MD
2017-05-30 18:05             ` Mick
2017-05-30 19:28           ` Kai Krakow

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAGfcS_mNnhQ-Ek71FOpCTFGFdG7yN+eDG6ACz3H9k9=W2xXf+w@mail.gmail.com' \
    --to=rich0@gentoo.org \
    --cc=gentoo-user@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox