Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CPU usage? #288

Open
jmpolom opened this issue Mar 17, 2022 · 2 comments
Open

CPU usage? #288

jmpolom opened this issue Mar 17, 2022 · 2 comments
Labels
libslirp question Further information is requested

Comments

@jmpolom
Copy link

jmpolom commented Mar 17, 2022

What is a normal amount of CPU usage/overhead to see with slirp4netns? I have a rootless container running with podman that uses a very small amount of network bandwidth (<100Mb/s) on a low power system and I'm seeing 17% CPU usage for the slirp4netns thread. The actual workload process consumes 13% CPU or less per thread. Is this normal?

@AkihiroSuda AkihiroSuda added the question Further information is requested label Mar 18, 2022
@AkihiroSuda
Copy link
Member

Seems quite normal.
bypass4netns can save the CPU usage significantly (experimental): https://github.com/rootless-containers/bypass4netns

@Szwendacz99
Copy link

I have whole stack of rootless podman containers on a raspberry pi 4, and since I switched from directly opening port for front container to using Rathole as a reverse proxy for NAT traversal, I started to see that slirp4netns is not only using much more cpu, but also the cpu usage is increasing over time (matter of days), and since I host it on rpi, and slirp4netns seem to work mainly with one thread, it is highly bottlenecking the transfer speed as it quickly reach near 100% of 1 cpu thread usage, even tho podman stats shows that no container is currently working hard.
My versions are the newest for today on Fedora 37:
podman-4.3.1,
slirp4netns-1.2.0

My stack currently have two networks, but I tried using one, and it behaved the same way. Also I struggle to set network parameters through docker-compose.yml, but that is topic for different issue I guess.

slirp4netns is configured by podman-compose to run like this:
/usr/bin/slirp4netns --disable-host-loopback --mtu=65520 --enable-sandbox --enable-seccomp --enable-ipv6 -c -r 3 --netns-type=path /run/user/1000/netns/rootless-netns-c5b94360335bbba9c9a4 tap0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
libslirp question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants