-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
gVisor failed to use host network silently #9657
Comments
you docker command doesn't expose 9090 port of the container. instead,
should work for you At the host, you will be able to see
From the container, I assume you will also something like
But i think there is nothing it has to do with network here, they are some socket protocol not implemented by gVisor for syscall getsockopt. If you are interested, please feel free to enable strace and implement the protocol. Let me know how it works for you |
Thanks for your kindly help. I'm sorry for the beginner's mistake I made due to my unfamiliarity with Docker. It led me to suspect that the reason for the failure in using the Host network might be the degraded performance of Redis compared to not using the Host network. Specifically, when using runsc as the runtime, the Redis Ping performance decreased from 3101 ops/sec to 2504 ops/sec when using the Host network. In contrast, when using runc as the runtime, the Redis Ping performance increased from 6218 ops/sec to 10369 ops/sec when using the Host network. I'm trying to identify the cause and suspect that it might be related to successfully using the Host network. Could you provide some guidance on this issue? |
Did you by any chance flip runc and runsc in the above comment? |
@hbhasker No, runsc as runtime, redis performance is even worse when using host network. Could you reproduce it? |
I expect that with runsc especially for ping pong traffic. The reason is host network support is implemented by proxying system calls straight to the host kernel which involves a VMEXIT in runsc making it very expensive. Host mode is useful for high throughout but not for low latency ping pong traffic. Also your comment has runsc flipped with runc. "when using runsc as the runtime, the Redis Ping performance decreased from 3101 ops/sec to 2504 ops/sec when using the Host network. In contrast, when using runc as the runtime, the Redis Ping performance increased from 6218 ops/sec to 10369 ops/sec when using the Host network." |
I believe some of the confusion in this thread is because Docker also has a flag
When you use This means that if you want to compare unsandboxed Docker performance with Now, one more thought about Redis benchmarking. When you run a Redis benchmark, it matters a lot how you run it. If you run both client and server on the same machine, then the comparison will not be fair when you use unsandboxed containers. This is because Linux will get to skip much of the network-related overhead it has to do, because packets get relayed entirely in the local network stack. By contrast, when running with I will close this issue since there is no gVisor bug here as far as I can tell. If you have more questions around benchmarking or are finding abnormal results, feel free to open a different issue or email the gvisor-users mailing list. |
Description
Hi, I'm trying to use gVisor to run redis and use
--network=host
to improve network performance. Here is my daemon.json:Then I tried boot a gvisor docker:
[Host: Raspi 3b+, debian] $ sudo docker run --runtime=runsc-kvm-host -v /home/test_suite:/home --rm -it ubuntu sh [gVisor] $ apt update && apt install netcat-traditional $ netcat -v -l -p 9090 listening on [any] 9090 ... [Host] $ telnet localhost 9090 Trying ::1... Connection failed: Connection refused
gVisor failed to use host network silently.
I've checked #issue97, it seems not to work for me.
Thanks in advance for community's kind help.
runsc.log.20231108-161455.351768.boot.txt
runsc.log.20231108-161455.291708.create.txt
Steps to reproduce
See my description.
runsc version
docker version (if using docker)
uname
Linux raspberrypi 5.15.92-v8+ #337 SMP PREEMPT Wed Nov 8 10:09:33 CST 2023 aarch64 GNU/Linux
kubectl (if using Kubernetes)
No response
repo state (if built from source)
No response
runsc debug logs (if available)
No response
The text was updated successfully, but these errors were encountered: