Does "containerized socket activation" improve network performance? #14068
-
A reflection regarding using podman and socket activation: The data communication in a "socket activated" socket does not go through slirp4netns when running rootless Podman. I haven't done any benchmarking to verify this theory yet. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
I did a test with Test: download an ISO file (736 MB) 13 times
Technical detailsHardwareComputer: MacBook Pro (13-inch, M1, 2020) InstallationI booted up a Fedora CoreOS image with QEMU and installed the systemd user service.
The big ISO file was bind-mounted into the container by adding |
Beta Was this translation helpful? Give feedback.
-
Yes I think socket activation provides a better network bandwidth than slirp4netns. However network bandwidth is not everything, some applications require low latency. Waiting for the container to start takes time which can be problematic. Also often your application still requires extra outgoing connections so you still would need slirp4netns for that. Also take a look at https://github.com/rootless-containers/bypass4netns which also opens sockets on the host namespace to improve speed. |
Beta Was this translation helpful? Give feedback.
Yes I think socket activation provides a better network bandwidth than slirp4netns.
The reason is simple, with socket activation systemd opens the socket in the host network namespace and then passes the fd down ito the container. Therefore all connections using this socket should have the same network performance as other applications on the host. There is no extra process involved.
However network bandwidth is not everything, some applications require low latency. Waiting for the container to start takes time which can be problematic.
Also often your application still requires extra outgoing connections so you still would need slirp4netns for that.
Also take a look at https://github.com…