-
Notifications
You must be signed in to change notification settings - Fork 899
docs: Add autoscale recommendations docs #7617
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
Merged
Merged
Changes from 1 commit
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
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 hidden or 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 | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -64,6 +64,33 @@ The test does the following: | |||||||||||
|
||||||||||||
Concurrency is configurable. `concurrency 0` means the scaletest test will attempt to create & connect to all workspaces immediately. | ||||||||||||
|
||||||||||||
## Autoscaling | ||||||||||||
|
||||||||||||
We generally do not recommend using an autoscaler that modifies the number of coderd replicas. In particular, scale | ||||||||||||
down events can cause interruptions for a large number of users. | ||||||||||||
|
||||||||||||
Coderd is different from a simple request-response HTTP service in that it services long-lived connections whenever it | ||||||||||||
proxies HTTP applications like IDEs or terminals that rely on websockets, or when it relays tunneled connections to | ||||||||||||
workspaces. Loss of a coderd replica will drop these long-lived connections and interrupt users. For example, if you | ||||||||||||
have 4 coderd replicas behind a load balancer, and an autoscaler decides to reduce it to 3, roughly 25% of the | ||||||||||||
connections will drop. An even larger proportion of users could be affected if they use applications that use more | ||||||||||||
than one websocket. | ||||||||||||
|
||||||||||||
The severity of the interruption varies by application. Coder's web terminal, for example, will reconnect to the same | ||||||||||||
session and continue. So, this should not be interpreted as saying coderd replicas should never be taken down for any | ||||||||||||
reason. | ||||||||||||
|
||||||||||||
We recommend you plan to run enough coderd replicas to comfortably meet your weekly high-water-mark load, and monitor | ||||||||||||
coderd peak CPU & memory utilization over the long term, reevaluating periodically. When scaling down (or performing | ||||||||||||
upgrades), schedule these on off hours to minimize user interruptions. | ||||||||||||
|
||||||||||||
### A note for Kubernetes users | ||||||||||||
|
||||||||||||
When running on Kubernetes on cloud infrastructure (i.e. not bare metal), many operators choose to employ a _cluster_ | ||||||||||||
autoscaler that adds and removes Kubernetes _nodes_ according to load. Coder can coexist with such cluster autoscalers, | ||||||||||||
but we recommend you take steps to prevent the autoscaler from evicting coderd pods, as an eviction will cause the same | ||||||||||||
interruptions as described above. | ||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Might be no harm to add an example:
Suggested change
|
||||||||||||
|
||||||||||||
## Troubleshooting | ||||||||||||
|
||||||||||||
If a load test fails or if you are experiencing performance issues during day-to-day use, you can leverage Coder's [prometheus metrics](./prometheus.md) to identify bottlenecks during scale tests. Additionally, you can use your existing cloud monitoring stack to measure load, view server logs, etc. |
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.
nit: "on off hours" reads funny, suggest