-
Notifications
You must be signed in to change notification settings - Fork 6
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
docs: add info on websockets #2189
Merged
Merged
Changes from 4 commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
b2ae8e0
docs: add info on websockets
lorenzo-cavazzi c933e28
docs: improve wording
lorenzo-cavazzi bd86027
Merge branch 'master' into 2167-websockets
lorenzo-cavazzi e4e3736
docs: add reference to sticky sessions issue
lorenzo-cavazzi 2efe6e4
Merge branch 'master' into 2167-websockets
lorenzo-cavazzi File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
# WebSocket | ||
|
||
WebSocket allows bi-directional communication between the UI server and the UI client. | ||
In our infrastructure, the client sends messages with a specific structure that the | ||
server interprets as instructions. Most of the time, the instructions start a loop | ||
that performs actions on behalf of the user at specific intervals (5 seconds or 3 | ||
minutes). | ||
|
||
You can find more details on the [server side section](../../../server/src/websocket/) about WebSockets. | ||
|
||
## Disconnections | ||
|
||
The WebSocket channels are now reasonably stable, staying alive for hours. | ||
Still, it's good practice to consider the connection unstable when developing new code | ||
involving WebSockets. This means the code should handle connections being temporarily | ||
interrupted and re-created. | ||
|
||
## Issues | ||
|
||
We had issues with WebSockets channels being dropped after a few minutes. Intervals were irregular, with an average duration between 5 and 10 minutes. | ||
|
||
In RenkuLab, we have a complex network topology; an incoming connection goes through: | ||
* [HAproxy](https://www.haproxy.com): load balancing the incoming connections. | ||
* Namespace-wide [Nginx](https://www.nginx.com): routing the requests from the outer | ||
network to local pods. | ||
* UI [Nginx](https://www.nginx.com): serving the UI responses | ||
|
||
It turned out we had to modify a setting on the namespace Nginx to keep connections | ||
alive for longer, precisely the `worker_shutdown_timeout` setting | ||
([reference](https://github.com/kubernetes/ingress-nginx/issues/2461)). | ||
We decided to raise it, aiming to keep connections alive for ~12 hours. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
I think it would make sense to add a link to #2184 here.
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.
Ah, yes! Added