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

disable http keep alives #971

Closed
wants to merge 2 commits into from
Closed

disable http keep alives #971

wants to merge 2 commits into from

Conversation

jomenxiao
Copy link
Contributor

disable http keep alives for port reuse

[pingcap@x-1 ~]$ sudo netstat -antlp |grep "bin/pd-server" |grep 2379 |wc -l && date
10975
Fri Mar  2 15:22:35 CST 2018
[pingcap@xi-1 ~]$ sudo netstat -antlp |grep "bin/pd-server" |grep 2379 |wc -l && date
11760
Fri Mar  2 15:22:40 CST 2018
[pingcap@x-1 ~]$ sudo netstat -antlp |grep "bin/pd-server" |grep 2379 |wc -l && date
13318
Fri Mar  2 15:22:50 CST 2018
[pingcap@x-1 ~]$ sudo netstat -antlp |grep "bin/pd-server" |grep 2379 |tail
tcp        0      0 10.1.0.4:2379           10.1.0.5:42738          ESTABLISHED 12643/bin/pd-server
tcp        0      0 10.1.0.4:2379           10.1.0.5:41476          ESTABLISHED 12643/bin/pd-server
tcp        0      0 10.1.0.4:2379           10.1.0.6:57098          ESTABLISHED 12643/bin/pd-server
tcp        0      0 10.1.0.4:2379           10.1.0.6:57648          ESTABLISHED 12643/bin/pd-server
tcp        0      0 10.1.0.4:2379           10.1.0.6:60650          ESTABLISHED 12643/bin/pd-server
tcp        0      0 10.1.0.4:2379           10.1.0.6:56802          ESTABLISHED 12643/bin/pd-server
tcp        0      0 10.1.0.4:2379           10.1.0.5:45748          ESTABLISHED 12643/bin/pd-server
tcp        0      0 10.1.0.4:2379           10.1.0.6:57454          ESTABLISHED 12643/bin/pd-server
tcp        0      0 10.1.0.4:2379           10.1.0.6:59680          ESTABLISHED 12643/bin/pd-server
tcp        0      0 10.1.0.4:2379           10.1.0.6:35206          ESTABLISHED 12643/bin/pd-server

pd.log

2018/03/01 19:09:26.558 redirector.go:106: [error] Get http://10.1.0.5:2379/pd/api/v1/stores: dial tcp 10.1.0.5:2379: connect: cannot assign requested address
2018/03/01 19:09:26.583 redirector.go:106: [error] Get http://10.1.0.5:2379/pd/health: dial tcp 10.1.0.5:2379: connect: cannot assign requested address
2018/03/01 19:09:26.604 redirector.go:106: [error] Get http://10.1.0.5:2379/pd/api/v1/stores: dial tcp 10.1.0.5:2379: connect: cannot assign requested address
2018/03/01 19:09:26.629 redirector.go:106: [error] Get http://10.1.0.5:2379/pd/ping: dial tcp 10.1.0.5:2379: connect: cannot assign requested address
2018/03/01 19:09:26.648 redirector.go:106: [error] Get http://10.1.0.5:2379/pd/api/v1/stores: dial tcp 10.1.0.5:2379: connect: cannot assign requested address
2018/03/01 19:09:26.656 redirector.go:106: [error] Get http://10.1.0.5:2379/pd/health: dial tcp 10.1.0.5:2379: connect: cannot assign requested address
2018/03/01 19:09:26.691 redirector.go:106: [error] Get http://10.1.0.5:2379/pd/api/v1/stores: dial tcp 10.1.0.5:2379: connect: cannot assign requested address
2018/03/01 19:09:26.700 redirector.go:106: [error] Get http://10.1.0.5:2379/pd/ping: dial tcp 10.1.0.5:2379: connect: cannot assign requested address

disable http keep alives for port reuse
```
[pingcap@x-1 ~]$ sudo netstat -antlp |grep "bin/pd-server" |grep 2379 |wc -l && date
10975
Fri Mar  2 15:22:35 CST 2018
[pingcap@xi-1 ~]$ sudo netstat -antlp |grep "bin/pd-server" |grep 2379 |wc -l && date
11760
Fri Mar  2 15:22:40 CST 2018
[pingcap@x-1 ~]$ sudo netstat -antlp |grep "bin/pd-server" |grep 2379 |wc -l && date
13318
Fri Mar  2 15:22:50 CST 2018
[pingcap@x-1 ~]$ sudo netstat -antlp |grep "bin/pd-server" |grep 2379 |tail
tcp        0      0 10.1.0.4:2379           10.1.0.5:42738          ESTABLISHED 12643/bin/pd-server
tcp        0      0 10.1.0.4:2379           10.1.0.5:41476          ESTABLISHED 12643/bin/pd-server
tcp        0      0 10.1.0.4:2379           10.1.0.6:57098          ESTABLISHED 12643/bin/pd-server
tcp        0      0 10.1.0.4:2379           10.1.0.6:57648          ESTABLISHED 12643/bin/pd-server
tcp        0      0 10.1.0.4:2379           10.1.0.6:60650          ESTABLISHED 12643/bin/pd-server
tcp        0      0 10.1.0.4:2379           10.1.0.6:56802          ESTABLISHED 12643/bin/pd-server
tcp        0      0 10.1.0.4:2379           10.1.0.5:45748          ESTABLISHED 12643/bin/pd-server
tcp        0      0 10.1.0.4:2379           10.1.0.6:57454          ESTABLISHED 12643/bin/pd-server
tcp        0      0 10.1.0.4:2379           10.1.0.6:59680          ESTABLISHED 12643/bin/pd-server
tcp        0      0 10.1.0.4:2379           10.1.0.6:35206          ESTABLISHED 12643/bin/pd-server
```

pd.log 
```
2018/03/01 19:09:26.558 redirector.go:106: [error] Get http://10.1.0.5:2379/pd/api/v1/stores: dial tcp 10.1.0.5:2379: connect: cannot assign requested address
2018/03/01 19:09:26.583 redirector.go:106: [error] Get http://10.1.0.5:2379/pd/health: dial tcp 10.1.0.5:2379: connect: cannot assign requested address
2018/03/01 19:09:26.604 redirector.go:106: [error] Get http://10.1.0.5:2379/pd/api/v1/stores: dial tcp 10.1.0.5:2379: connect: cannot assign requested address
2018/03/01 19:09:26.629 redirector.go:106: [error] Get http://10.1.0.5:2379/pd/ping: dial tcp 10.1.0.5:2379: connect: cannot assign requested address
2018/03/01 19:09:26.648 redirector.go:106: [error] Get http://10.1.0.5:2379/pd/api/v1/stores: dial tcp 10.1.0.5:2379: connect: cannot assign requested address
2018/03/01 19:09:26.656 redirector.go:106: [error] Get http://10.1.0.5:2379/pd/health: dial tcp 10.1.0.5:2379: connect: cannot assign requested address
2018/03/01 19:09:26.691 redirector.go:106: [error] Get http://10.1.0.5:2379/pd/api/v1/stores: dial tcp 10.1.0.5:2379: connect: cannot assign requested address
2018/03/01 19:09:26.700 redirector.go:106: [error] Get http://10.1.0.5:2379/pd/ping: dial tcp 10.1.0.5:2379: connect: cannot assign requested address
```
@Connor1996
Copy link
Member

@jomenxiao hi! I notice that the client in redirector can be reused for all api handler, so I make a update in #969 and disable keep alive. Please have a look.

@jomenxiao
Copy link
Contributor Author

@Connor1996 cool

@jomenxiao jomenxiao closed this Mar 2, 2018
@disksing disksing deleted the jomenxiao-patch-1 branch March 22, 2018 11:03
@sre-bot sre-bot added the contribution This PR is from a community contributor. label Dec 18, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
contribution This PR is from a community contributor.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants