-
Notifications
You must be signed in to change notification settings - Fork 529
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
[Core] Avoid high concurrency issue with control master #4455
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for adding this @Michaelvll ! Left some discussions ;)
|
||
Args: | ||
ip: The IP address to check | ||
threshold: Maximum number of allowed concurrent SSH connections |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
stale? seems now the threshold is a constant (but not an arg)
# Use pgrep to efficiently find ssh processes and pipe to grep for IP | ||
cmd = f'pgrep -f ssh | xargs -r ps -p | grep -c {ip}' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is that only tracks the SSH command from local machine? How about the connections from other laptops
# The maximum number of concurrent ssh connections to a same node. This is a | ||
# heuristic value, based on the observation that when the number of concurrent | ||
# ssh connections to a node with control master is high, new connections through | ||
# control master will hang. | ||
_MAX_CONCURRENT_SSH_CONNECTIONS = 32 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
have you test if this is related to number of cpu?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did you experiment with setting MaxSessions on the node sshd instead?
Actually, this cannot fix the issue with the high concurrency. We may need a better solution. : ) |
When there are high concurrent ssh connection to the same node with control master, it seems any new connection with the control master will hang. We now add a detection to avoid using control master when the total connections are higher than a threshold.
To reproduce:
Tested (run the relevant ones):
bash format.sh
pytest tests/test_smoke.py
pytest tests/test_smoke.py::test_fill_in_the_name
conda deactivate; bash -i tests/backward_compatibility_tests.sh