pid1: turn memory accounting on by default now

After discussions with @htejun it appears it's OK now to enable memory
accounting by default for all units without affecting system performance
too badly. facebook has made good experiences with deploying memory
accounting across their infrastructure.

This hence turns MemoryAccounting= from opt-in to opt-out, similar to
how TasksAccounting= is already handled. The other accounting options
remain off, their performance impact is too big still.
This commit is contained in:
Lennart Poettering 2018-02-09 19:59:53 +01:00
parent cadc80b873
commit e0c46a7364
5 changed files with 21 additions and 4 deletions

16
NEWS
View File

@ -1,5 +1,21 @@
systemd System and Service Manager
CHANGES WITH 238 in spe:
* The MemoryAccounting= unit property now defaults to on. After
discussions with the upstream control group maintainers we learnt
that the negative impact of cgroup memory accounting on current
kernels is finally relatively minimal, so that it should be safe to
enable this by default without affecting system performance too
much. Besides memory accounting only tasks accounting is turned on by
default, all other forms of resource accounting (CPU, IO, IP) remain
off for now, because it's not clear yet that their impact is small
enough to move from opt-in to opt-out for them, too. We recommend
downstreams to leave memory accounting on by default, however in some
situations it might be wise to revert this change of defaults, in
particular on very resource constrained systems or when support for
old kernels is a necessity.
CHANGES WITH 237:
* Some keyboards come with a zoom see-saw or rocker which until now got

View File

@ -338,8 +338,8 @@
<varname>CPUAccounting=</varname>, <varname>BlockIOAccounting=</varname>, <varname>MemoryAccounting=</varname>,
<varname>TasksAccounting=</varname> and <varname>IPAccounting=</varname>. See
<citerefentry><refentrytitle>systemd.resource-control</refentrytitle><manvolnum>5</manvolnum></citerefentry>
for details on the per-unit settings. <varname>DefaultTasksAccounting=</varname> defaults to on, the other
four settings to off.</para></listitem>
for details on the per-unit settings. <varname>DefaultTasksAccounting=</varname> and
<varname>DefaultMemoryAccounting=</varname> default to on, the other three settings to off.</para></listitem>
</varlistentry>
<varlistentry>

View File

@ -135,7 +135,7 @@ static bool arg_default_cpu_accounting = false;
static bool arg_default_io_accounting = false;
static bool arg_default_ip_accounting = false;
static bool arg_default_blockio_accounting = false;
static bool arg_default_memory_accounting = false;
static bool arg_default_memory_accounting = true;
static bool arg_default_tasks_accounting = true;
static uint64_t arg_default_tasks_max = UINT64_MAX;
static sd_id128_t arg_machine_id = {};

View File

@ -673,6 +673,7 @@ int manager_new(UnitFileScope scope, unsigned test_run_flags, Manager **_m) {
m->unit_file_scope = scope;
m->exit_code = _MANAGER_EXIT_CODE_INVALID;
m->default_timer_accuracy_usec = USEC_PER_MINUTE;
m->default_memory_accounting = true;
m->default_tasks_accounting = true;
m->default_tasks_max = UINT64_MAX;
m->default_timeout_start_usec = DEFAULT_TIMEOUT_USEC;

View File

@ -42,7 +42,7 @@
#DefaultIOAccounting=no
#DefaultIPAccounting=no
#DefaultBlockIOAccounting=no
#DefaultMemoryAccounting=no
#DefaultMemoryAccounting=yes
#DefaultTasksAccounting=yes
#DefaultTasksMax=15%
#DefaultLimitCPU=