systemd: Introduce systemd_service_tasksmax_extra_in

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
Andrea Bolognani 2023-09-28 12:07:15 +02:00
parent 3b16a13f14
commit 13de087237
10 changed files with 11 additions and 20 deletions

View File

@ -63,6 +63,7 @@ if conf.has('WITH_CH')
'service_extra_in': [ 'service_extra_in': [
files('virtchd.service.extra.in'), files('virtchd.service.extra.in'),
systemd_service_limitnofile_extra_in, systemd_service_limitnofile_extra_in,
systemd_service_tasksmax_extra_in,
], ],
} }

View File

@ -5,11 +5,6 @@ After=remote-fs.target
[Service] [Service]
KillMode=process KillMode=process
# The cgroups pids controller can limit the number of tasks started by
# the daemon, which can limit the number of domains for some hypervisors.
# A conservative default of 8 tasks per guest results in a TasksMax of
# 32k to support 4096 guests.
TasksMax=32768
# With cgroups v2 there is no devices controller anymore, we have to use # With cgroups v2 there is no devices controller anymore, we have to use
# eBPF to control access to devices. In order to do that we create a eBPF # eBPF to control access to devices. In order to do that we create a eBPF
# hash MAP which locks memory. The default map size for 64 devices together # hash MAP which locks memory. The default map size for 64 devices together

View File

@ -168,6 +168,7 @@ if conf.has('WITH_LXC')
'service_extra_in': [ 'service_extra_in': [
files('virtlxcd.service.extra.in'), files('virtlxcd.service.extra.in'),
systemd_service_limitnofile_extra_in, systemd_service_limitnofile_extra_in,
systemd_service_tasksmax_extra_in,
], ],
} }

View File

@ -5,11 +5,6 @@ After=remote-fs.target
[Service] [Service]
KillMode=process KillMode=process
# The cgroups pids controller can limit the number of tasks started by
# the daemon, which can limit the number of domains for some hypervisors.
# A conservative default of 8 tasks per guest results in a TasksMax of
# 32k to support 4096 guests.
TasksMax=32768
# With cgroups v2 there is no devices controller anymore, we have to use # With cgroups v2 there is no devices controller anymore, we have to use
# eBPF to control access to devices. In order to do that we create a eBPF # eBPF to control access to devices. In order to do that we create a eBPF
# hash MAP which locks memory. The default map size for 64 devices together # hash MAP which locks memory. The default map size for 64 devices together

View File

@ -195,6 +195,7 @@ guest_unit_files = []
# snippets that are shared by multiple units # snippets that are shared by multiple units
# can be used in service_extra_in/socket_extra_in (see below) # can be used in service_extra_in/socket_extra_in (see below)
systemd_service_limitnofile_extra_in = files('virtd.service.limitnofile.extra.in') systemd_service_limitnofile_extra_in = files('virtd.service.limitnofile.extra.in')
systemd_service_tasksmax_extra_in = files('virtd.service.tasksmax.extra.in')
# virt_daemon_units: # virt_daemon_units:
# generate libvirt daemon systemd unit files # generate libvirt daemon systemd unit files

View File

@ -187,6 +187,7 @@ if conf.has('WITH_QEMU')
'service_extra_in': [ 'service_extra_in': [
files('virtqemud.service.extra.in'), files('virtqemud.service.extra.in'),
systemd_service_limitnofile_extra_in, systemd_service_limitnofile_extra_in,
systemd_service_tasksmax_extra_in,
], ],
} }

View File

@ -9,11 +9,6 @@ After=remote-fs.target
[Service] [Service]
KillMode=process KillMode=process
# The cgroups pids controller can limit the number of tasks started by
# the daemon, which can limit the number of domains for some hypervisors.
# A conservative default of 8 tasks per guest results in a TasksMax of
# 32k to support 4096 guests.
TasksMax=32768
# With cgroups v2 there is no devices controller anymore, we have to use # With cgroups v2 there is no devices controller anymore, we have to use
# eBPF to control access to devices. In order to do that we create a eBPF # eBPF to control access to devices. In order to do that we create a eBPF
# hash MAP which locks memory. The default map size for 64 devices together # hash MAP which locks memory. The default map size for 64 devices together

View File

@ -33,11 +33,6 @@ ExecStart=@sbindir@/libvirtd $LIBVIRTD_ARGS
ExecReload=/bin/kill -HUP $MAINPID ExecReload=/bin/kill -HUP $MAINPID
KillMode=process KillMode=process
Restart=on-failure Restart=on-failure
# The cgroups pids controller can limit the number of tasks started by
# the daemon, which can limit the number of domains for some hypervisors.
# A conservative default of 8 tasks per guest results in a TasksMax of
# 32k to support 4096 guests.
TasksMax=32768
# With cgroups v2 there is no devices controller anymore, we have to use # With cgroups v2 there is no devices controller anymore, we have to use
# eBPF to control access to devices. In order to do that we create a eBPF # eBPF to control access to devices. In order to do that we create a eBPF
# hash MAP which locks memory. The default map size for 64 devices together # hash MAP which locks memory. The default map size for 64 devices together

View File

@ -193,6 +193,7 @@ if conf.has('WITH_REMOTE')
'service_in': files('libvirtd.service.in'), 'service_in': files('libvirtd.service.in'),
'service_extra_in': [ 'service_extra_in': [
systemd_service_limitnofile_extra_in, systemd_service_limitnofile_extra_in,
systemd_service_tasksmax_extra_in,
], ],
'name': 'legacy monolithic', 'name': 'legacy monolithic',
'sockets': [ 'main', 'ro', 'admin', 'tcp', 'tls' ], 'sockets': [ 'main', 'ro', 'admin', 'tcp', 'tls' ],

View File

@ -0,0 +1,6 @@
[Service]
# The cgroups pids controller can limit the number of tasks started by
# the daemon, which can limit the number of domains for some hypervisors.
# A conservative default of 8 tasks per guest results in a TasksMax of
# 32k to support 4096 guests.
TasksMax=32768