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

后端健康检查连接不释放 #267

Open
huangyonghome opened this issue Apr 7, 2023 · 1 comment
Open

后端健康检查连接不释放 #267

huangyonghome opened this issue Apr 7, 2023 · 1 comment

Comments

@huangyonghome
Copy link

huangyonghome commented Apr 7, 2023

Nginx会一直维持后端服务器的8个ESTABLISHED长连接,并且永不释放

tcp    ESTAB      0      0      172.16.103.138:63775              172.16.102.241:9001
tcp    ESTAB      0      0      172.16.103.138:26924              172.16.102.241:9001
tcp    ESTAB      0      0      172.16.103.138:10390              172.16.102.241:9001
tcp    ESTAB      0      0      172.16.103.138:16368              172.16.102.241:9001
tcp    ESTAB      0      0      172.16.103.138:32328              172.16.102.241:9001
tcp    ESTAB      0      0      172.16.103.138:37996              172.16.102.241:9001
tcp    ESTAB      0      0      172.16.103.138:5014               172.16.102.241:9001
tcp    ESTAB      0      0      172.16.103.138:21452              172.16.102.241:9001

upstream配置

upstream  sqlreview2-server {
#我这里把检查间隔改成了30秒
check interval=30000 rise=1 fall=3 timeout=3000 type=tcp;
   server 172.16.102.241:9001;

nginx locaiton配置文件

location /sqlreview
   {
        proxy_next_upstream http_502 http_504 error timeout invalid_header;
        proxy_set_header Host  $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_pass http://sqlreview2-server;
   }

Nginx版本: nginx/1.20.1

@yswang0927
Copy link

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