v2fly / docker

docker build repo for v2fly
https://hub.docker.com/r/v2fly/v2fly-core
MIT License
726 stars 208 forks source link

Docker 版连接速度和稳定性明显弱于普通安装版本 #10

Closed ZhaoMuwei closed 3 years ago

ZhaoMuwei commented 3 years ago

一周前安装了 Docker 版的 v2r server,观察到这样的现象:

一台国外主机,同时部署了 Docker 版本和普通安装版本,发现 Docker 版明显速度慢(我没有做定量的 benchmark,但是肉眼可见地变慢了)且不稳定(经常性刷不出来页面),切换到普通安装版本立马恢复正常。 二者使用了不同的端口和 id,应该不会发生冲突。 另外,使用多个城市的宽带和手机 4G 都发现了上述问题,因此大概率不是网络原因。

所以,请教一下是什么原因导致的?

还需要提供些什么 debug 信息,以便你们团队追查问题(如果真的是 Docker 版问题的话)?

ZhaoMuwei commented 3 years ago

同时部署了 Docker 版本和普通安装版本

Docker 中 v2ray 版本:4.26.0

普通安装版本:4.22.1(通过 go.sh 安装)

ZhaoMuwei commented 3 years ago

普通安装版本:4.22.1(通过 go.sh 安装)

普通安装更新到 4.26.0 版本,上述问题依然存在。

kslr commented 3 years ago

尝试网络使用Host

ZhaoMuwei commented 3 years ago

尝试网络使用Host

果然要好一些 👍

ZhaoMuwei commented 3 years ago

补充一段刚看到的 Docker 关于 network 的文档,猜测应该和这一点有关(我恰好使用了 v2r 的动态端口):

Host mode networking can be useful to optimize performance, and in situations where a container needs to handle a large range of ports, as it does not require network address translation (NAT), and no “userland-proxy” is created for each port.