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

发现gost 2有个小bug, #1049

Open
chacha20 opened this issue Oct 30, 2024 · 2 comments
Open

发现gost 2有个小bug, #1049

chacha20 opened this issue Oct 30, 2024 · 2 comments

Comments

@chacha20
Copy link

chacha20 commented Oct 30, 2024

做了纯tcp转发,功能类似iptables。比如:

{
            "Name": "node-1001",
            "ServeNodes": [
                "tcp://:10170/10.0.0.1:10170",
                "udp://:10170/10.0.0.1:10170"
            ]
}

少量请求没问题,当请求量达到一定规模后,会出现卡死状态,目前已测试过这几种环境:

  1. 配置为/etc/systemd/system/gost.service,宿主用户为gost,分配ulimit均为ulimited,或者改为用root均能复现:
[Unit]
Description=gost
After=network-online.target
Wants=network-online.target systemd-networkd-wait-online.service

[Service]
Type=simple
User=gost
Restart=always
RestartSec=5
DynamicUser=true
ExecStart=/usr/bin/gost -C /etc/gost/config.json

[Install]
WantedBy=multi-user.target
  1. docker方式运行,使用ginuerzh/gost镜像,执行下面语句,在请求达到一定规模后,容器会自动重启:
    docker run -d -it --name=relay --restart=always --net=host --log-opt max-size=128k --log-opt max-file=3 --mount type=bind,source=/opt/services/gost,target=/etc/gost ginuerzh/gost -C /etc/gost/config.json

开始以为与句柄数有关,或者与内存有关,换成4G内存,句柄数均配置为unlimited也能复现

复现时没法判断是打到什么请求规模,大约在50-100并发吧。

@ginuerzh
Copy link
Owner

有什么错误信息吗?

@chacha20
Copy link
Author

chacha20 commented Nov 4, 2024

他算不上报错,我也不太了解怎么获取更多信息,systemd方式在gost服务挂掉后,整个系统是假死状态,只能硬关机开机。docker方式挂掉倒是会被宿主自动将容器重启。我是看容器运行时间时不小心发现的,大约连续跑几周不到一个月会有一两次复现,只能我再仔细研究日志,等复现时,在docker日志里详细刨一下。

问题倒是不大,我自己觉得可能是某个函数的内存回收没有太及时导致微小泄露逐渐积累导致的,或者TCP会话窗口关闭不及时逐渐积累导致。大概是这俩原因。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants