public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-dev] systems-246 changes tmpfs default size from 50% to 10% of RAM
@ 2020-07-28 18:50 Zoltan Puskas
  2020-07-28 19:13 ` Mike Gilbert
  2020-07-29  1:10 ` Brian Evans
  0 siblings, 2 replies; 6+ messages in thread
From: Zoltan Puskas @ 2020-07-28 18:50 UTC (permalink / raw
  To: gentoo-dev

Hi,

I've upgraded to and running systemd-246_rc2 on one of my systems and
noticed that tmpfs mounted directories are significantly smaller.

This is because with commit
https://github.com/systemd/systemd/commit/7d85383edbab73274dc81cc888d884bb01070bc2
they have changed them to be 10% of the physical memory instead of the
default of 50%.

This is a potentially breaking, or at least an unexpected behaviour
change, especially for people using tmpfs on /tmp for compiling.

Maybe we should make a news item to let people know that they either
need to add an fstab entry with size option set, or better, create a
systemd local override with relevant content.

Cheers,
Zoltan


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [gentoo-dev] systems-246 changes tmpfs default size from 50% to 10% of RAM
  2020-07-28 18:50 [gentoo-dev] systems-246 changes tmpfs default size from 50% to 10% of RAM Zoltan Puskas
@ 2020-07-28 19:13 ` Mike Gilbert
  2020-07-28 19:19   ` Mike Gilbert
  2020-07-29  0:09   ` Zoltan Puskas
  2020-07-29  1:10 ` Brian Evans
  1 sibling, 2 replies; 6+ messages in thread
From: Mike Gilbert @ 2020-07-28 19:13 UTC (permalink / raw
  To: Gentoo Dev

On Tue, Jul 28, 2020 at 2:50 PM Zoltan Puskas <zoltan@sinustrom.info> wrote:
>
> Hi,
>
> I've upgraded to and running systemd-246_rc2 on one of my systems and
> noticed that tmpfs mounted directories are significantly smaller.
>
> This is because with commit
> https://github.com/systemd/systemd/commit/7d85383edbab73274dc81cc888d884bb01070bc2
> they have changed them to be 10% of the physical memory instead of the
> default of 50%.
>
> This is a potentially breaking, or at least an unexpected behaviour
> change, especially for people using tmpfs on /tmp for compiling.
>
> Maybe we should make a news item to let people know that they either
> need to add an fstab entry with size option set, or better, create a
> systemd local override with relevant content.

Don't use /tmp for PORTAGE_TMPDIR. /tmp is meant for small temporary
storage. If you want to compile in a tmpfs, set up a separate mount
point for it.

I don't intend to create a news item for this, but I would not object
to someone else doing it.


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [gentoo-dev] systems-246 changes tmpfs default size from 50% to 10% of RAM
  2020-07-28 19:13 ` Mike Gilbert
@ 2020-07-28 19:19   ` Mike Gilbert
  2020-07-29  0:25     ` Zoltan Puskas
  2020-07-29  0:09   ` Zoltan Puskas
  1 sibling, 1 reply; 6+ messages in thread
From: Mike Gilbert @ 2020-07-28 19:19 UTC (permalink / raw
  To: Gentoo Dev

On Tue, Jul 28, 2020 at 3:13 PM Mike Gilbert <floppym@gentoo.org> wrote:
>
> On Tue, Jul 28, 2020 at 2:50 PM Zoltan Puskas <zoltan@sinustrom.info> wrote:
> >
> > Hi,
> >
> > I've upgraded to and running systemd-246_rc2 on one of my systems and
> > noticed that tmpfs mounted directories are significantly smaller.
> >
> > This is because with commit
> > https://github.com/systemd/systemd/commit/7d85383edbab73274dc81cc888d884bb01070bc2
> > they have changed them to be 10% of the physical memory instead of the
> > default of 50%.
> >
> > This is a potentially breaking, or at least an unexpected behaviour
> > change, especially for people using tmpfs on /tmp for compiling.
> >
> > Maybe we should make a news item to let people know that they either
> > need to add an fstab entry with size option set, or better, create a
> > systemd local override with relevant content.
>
> Don't use /tmp for PORTAGE_TMPDIR. /tmp is meant for small temporary
> storage. If you want to compile in a tmpfs, set up a separate mount
> point for it.
>
> I don't intend to create a news item for this, but I would not object
> to someone else doing it.

Also, the limit for /tmp is likely to change again before the 246 final release.

https://github.com/systemd/systemd/pull/16576


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [gentoo-dev] systems-246 changes tmpfs default size from 50% to 10% of RAM
  2020-07-28 19:13 ` Mike Gilbert
  2020-07-28 19:19   ` Mike Gilbert
@ 2020-07-29  0:09   ` Zoltan Puskas
  1 sibling, 0 replies; 6+ messages in thread
From: Zoltan Puskas @ 2020-07-29  0:09 UTC (permalink / raw
  To: gentoo-dev

Hi,

> 
> Don't use /tmp for PORTAGE_TMPDIR. /tmp is meant for small temporary
> storage. If you want to compile in a tmpfs, set up a separate mount
> point for it.
> 

I'm not sure I can agree with this. If we are being pedantic then we
should look at FHS3.0, and it does not specify that it's intended only
for small files, only that the contents are essentially ephemeral, see:

https://refspecs.linuxfoundation.org/FHS_3.0/fhs-3.0.html#tmpTemporaryFiles

Even if user does not use it for portage, there are other legitimate
uses to have a large /tmp where user might want to store large amounts
of data for faster processing and also to save a non trivial amount of
SSD write cycles. Some real life example are:
- Firefox stores temporary downloads there like PDF or archive files,
  that were selected to be opened with and application instead of
  permanently saving it, which can pile up if Firefox is not restarted
  for a longer period of time.
- I pointed Hugin (panorama stitcher) to /tmp, which during work
  produces large amount of temporary data in the form of intermediate
  files. Probably similar to other multimedia related work flows.
- Browsing an archive in mc (MidnightCommander) will result in large
  amount of data being unpacked into /tmp.
- During proxy maintenance when patching a source tree, I will actually
  untar 2 copies into /tmp and do the patching, test compiling and
  diffing there.

/tmp in convenient (and IMHO intended) for this kind of use, and users
probably rely on it without even knowing they do. They should not be
required to setup a new tmpfs mount for every use case, especially since
many things implicitly assume /tmp is to be used for temporary storage.
I don't see why portage cannot fit into this formula, especially since
it does not use that much space relative to other potential use cases
(well except for compiling LibreOffice, Firefox and friends).

In today's world machines with 32-64GB of RAM are readily available, and
users probably want to utilize them as much as they can (at least
personally I do). Restricting /tmp to small files only does not make
sense on desktop and laptop environments for at least a decade now if
not more, and is probably even acceptable on home or low traffic servers
too.

Cheers,
Zoltan


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [gentoo-dev] systems-246 changes tmpfs default size from 50% to 10% of RAM
  2020-07-28 19:19   ` Mike Gilbert
@ 2020-07-29  0:25     ` Zoltan Puskas
  0 siblings, 0 replies; 6+ messages in thread
From: Zoltan Puskas @ 2020-07-29  0:25 UTC (permalink / raw
  To: gentoo-dev

On Tue, Jul 28, 2020 at 03:19:26PM -0400, Mike Gilbert wrote:
> On Tue, Jul 28, 2020 at 3:13 PM Mike Gilbert <floppym@gentoo.org> wrote:
> >
> > On Tue, Jul 28, 2020 at 2:50 PM Zoltan Puskas <zoltan@sinustrom.info> wrote:
> > >
> > > Hi,
> > >
> > > I've upgraded to and running systemd-246_rc2 on one of my systems and
> > > noticed that tmpfs mounted directories are significantly smaller.
> > >
> > > This is because with commit
> > > https://github.com/systemd/systemd/commit/7d85383edbab73274dc81cc888d884bb01070bc2
> > > they have changed them to be 10% of the physical memory instead of the
> > > default of 50%.
> > >
> > > This is a potentially breaking, or at least an unexpected behaviour
> > > change, especially for people using tmpfs on /tmp for compiling.
> > >
> > > Maybe we should make a news item to let people know that they either
> > > need to add an fstab entry with size option set, or better, create a
> > > systemd local override with relevant content.
> >
> > Don't use /tmp for PORTAGE_TMPDIR. /tmp is meant for small temporary
> > storage. If you want to compile in a tmpfs, set up a separate mount
> > point for it.
> >
> > I don't intend to create a news item for this, but I would not object
> > to someone else doing it.
> 
> Also, the limit for /tmp is likely to change again before the 246 final release.
> 
> https://github.com/systemd/systemd/pull/16576
>

I volunteer to write the news item. 

It seems other distros also have met the overly restricted /tmp size
issue, due to yet another legitimate use case (see the RedHat bug
referenced in the PR: https://bugzilla.redhat.com/show_bug.cgi?id=1856514).

It's worth noting that above PR only resets only /tmp size, but will
keep /dev/shm, /run, etc. at the lower limit. While we have to wait and
see what the final form will be for systemd-246, I think it'd be useful
to notify users. Systemd changing the age old convention of non
configured tmpfs mount sizes (from a user's perspective non configured)
it means openrc and systemd boxes will end up with different behaviours
(e.g.  /dev/shm will now be sized differently).

Cheers,
Zoltan


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [gentoo-dev] systems-246 changes tmpfs default size from 50% to 10% of RAM
  2020-07-28 18:50 [gentoo-dev] systems-246 changes tmpfs default size from 50% to 10% of RAM Zoltan Puskas
  2020-07-28 19:13 ` Mike Gilbert
@ 2020-07-29  1:10 ` Brian Evans
  1 sibling, 0 replies; 6+ messages in thread
From: Brian Evans @ 2020-07-29  1:10 UTC (permalink / raw
  To: gentoo-dev


[-- Attachment #1.1: Type: text/plain, Size: 730 bytes --]

On 7/28/20 2:50 PM, Zoltan Puskas wrote:
> Hi,
> 
> I've upgraded to and running systemd-246_rc2 on one of my systems and
> noticed that tmpfs mounted directories are significantly smaller.
> 
> This is because with commit
> https://github.com/systemd/systemd/commit/7d85383edbab73274dc81cc888d884bb01070bc2
> they have changed them to be 10% of the physical memory instead of the
> default of 50%.
> 
> This is a potentially breaking, or at least an unexpected behaviour
> change, especially for people using tmpfs on /tmp for compiling.

This could also affect any Gentoo admin running a MySQL/MariaDB database
with the default settings as it will sometimes write temporary tables to
${EPREFIX}/tmp.

Brian


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 981 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2020-07-29  1:10 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-07-28 18:50 [gentoo-dev] systems-246 changes tmpfs default size from 50% to 10% of RAM Zoltan Puskas
2020-07-28 19:13 ` Mike Gilbert
2020-07-28 19:19   ` Mike Gilbert
2020-07-29  0:25     ` Zoltan Puskas
2020-07-29  0:09   ` Zoltan Puskas
2020-07-29  1:10 ` Brian Evans

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox