diff options
author | Paul Holzinger <pholzing@redhat.com> | 2021-09-02 14:14:59 +0200 |
---|---|---|
committer | Paul Holzinger <pholzing@redhat.com> | 2021-10-12 21:43:11 +0200 |
commit | 3ba69dccf78194792a4b0156db8c69417b20a713 (patch) | |
tree | 325afc80df95c0b5eb49b74d175cdd0ba1a480ff /contrib/spec | |
parent | c90beedbe160eb6e8094b492091231f3c5838006 (diff) | |
download | podman-3ba69dccf78194792a4b0156db8c69417b20a713.tar.gz podman-3ba69dccf78194792a4b0156db8c69417b20a713.tar.bz2 podman-3ba69dccf78194792a4b0156db8c69417b20a713.zip |
rootlessport: reduce memory usage of the process
Don't use reexec for the rootlessport process, instead make it a
separate binary to reduce the memory usage. The problem with reexec is
that it will import all packages that podman uses and therefore loads a
lot of stuff into the heap. The rootlessport process however only needs
the rootlesskit library.
The memory usage is a concern since the rootlessport process will spawn
two process per container which has ports forwarded. The processes stay
until the container dies. On my laptop the current reexec version uses
47800 KB RSS. The new separate binary only uses 4540 KB RSS. This is
more than a 90% improvement.
The Makefile has been updated to compile the new binary and install it
to the libexec directory.
Fixes #10790
[NO TESTS NEEDED]
Signed-off-by: Paul Holzinger <pholzing@redhat.com>
Diffstat (limited to 'contrib/spec')
-rw-r--r-- | contrib/spec/podman.spec.in | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/contrib/spec/podman.spec.in b/contrib/spec/podman.spec.in index 3a4026038..295a953ef 100644 --- a/contrib/spec/podman.spec.in +++ b/contrib/spec/podman.spec.in @@ -3,18 +3,8 @@ %global with_check 0 %global with_unit_test 0 %bcond_without doc -%bcond_without debug -%if %{with debug} -%global _find_debuginfo_dwz_opts %{nil} -%global _dwz_low_mem_die_limit 0 -%else %global debug_package %{nil} -%endif - -%if ! 0%{?gobuild:1} -%define gobuild(o:) go build -buildmode pie -compiler gc -tags="rpm_crashtraceback ${BUILDTAGS:-}" -ldflags "${LDFLAGS:-} -B 0x$(head -c20 /dev/urandom|od -An -tx1|tr -d ' \n') -extldflags '-Wl,-z,relro -Wl,--as-needed -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld '" -a -v -x %{?**}; -%endif # podman hack directory %define hackdir %{_builddir}/%{repo}-%{shortcommit0} @@ -536,6 +526,8 @@ export GOPATH=%{buildroot}/%{gopath}:$(pwd)/vendor:%{gopath} %{_usr}/lib/systemd/user/podman-auto-update.timer %{_usr}/lib/systemd/user/podman-restart.service %{_usr}/lib/tmpfiles.d/podman.conf +%dir %{_libexecdir}/%{name} +%{_libexecdir}/%{name}/rootlessport %if 0%{?with_devel} %files -n libpod-devel -f devel.file-list |