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

Add option to disablekeepalive #45

Merged
merged 1 commit into from
Jul 14, 2021

Conversation

sfunkhouser
Copy link
Contributor

I ran into the issue that was noted in #35. When connecting locally from the US east coast to a switch in Singapore my connections would pile up. However, when connecting to a switch in New York, I did not run into the issue.

Using the debugging from the issue:

lsof -i -n -P |grep com.docke | awk '{ print $9 }' |awk -F'>' '{print $2}' | sort | uniq -c | sort -n

I saw every time I ran a command a new connection would be created, but the connection would stay around, building up connections, and goroutines. When timing these calls, the would take between 2-7 seconds:

server_1  | 2021/07/09 15:04:10 load: 2.3043784s
server_1  | 2021/07/09 15:04:10 load: 2.3117265s
server_1  | 2021/07/09 15:04:10 load: 2.3401141s
server_1  | 2021/07/09 15:04:10 load: 2.3514422s
server_1  | 2021/07/09 15:04:10 load: 3.1078603s
server_1  | 2021/07/09 15:04:11 load: 3.1816625s
server_1  | 2021/07/09 15:04:11 load: 3.1809949s
server_1  | 2021/07/09 15:04:11 load: 3.2186101s
server_1  | 2021/07/09 15:04:11 load: 3.3545421s
server_1  | 2021/07/09 15:04:11 load: 3.4516948s
server_1  | 2021/07/09 15:04:11 load: 3.4777806s
server_1  | 2021/07/09 15:04:11 load: 3.4740437s
server_1  | 2021/07/09 15:04:11 load: 3.6690569s
server_1  | 2021/07/09 15:04:11 load: 3.9385031s
server_1  | 2021/07/09 15:04:14 load: 6.6771321s
server_1  | 2021/07/09 15:04:14 load: 6.6883083s

When connecting to switches in NY, these were all under 1 second, and the connections would immediately clear up, and we had no pile up of goroutines

server_1  | 2021/07/09 15:58:19 load: 708.837ms
server_1  | 2021/07/09 15:58:19 load: 710.5202ms
server_1  | 2021/07/09 15:58:19 load: 715.5299ms
server_1  | 2021/07/09 15:58:19 load: 717.2996ms
server_1  | 2021/07/09 15:58:19 load: 722.4879ms
server_1  | 2021/07/09 15:58:19 load: 716.7412ms
server_1  | 2021/07/09 15:58:19 load: 764.4918ms
server_1  | 2021/07/09 15:58:19 load: 756.8071ms
server_1  | 2021/07/09 15:58:19 load: 770.9526ms
server_1  | 2021/07/09 15:58:19 load: 770.7404ms

Adding the DisableKeepAlive option cleared up the connections immediately after they were complete.

	node.GetConnection().SetDisableKeepAlive(true)

Copy link
Contributor

@cheynearista cheynearista left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@cheynearista cheynearista merged commit 340b280 into aristanetworks:master Jul 14, 2021
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

Successfully merging this pull request may close these issues.

2 participants