Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit4b9bdfe

Browse files
committed
docs: add troubleshooting steps for prebuilt workspaces
1 parentc84ab72 commit4b9bdfe

File tree

1 file changed

+41
-0
lines changed

1 file changed

+41
-0
lines changed

‎docs/admin/templates/extending-templates/prebuilt-workspaces.md‎

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -247,6 +247,47 @@ When prebuilt workspaces are configured for an organization, Coder creates a "pr
247247

248248
If a quota is exceeded, the prebuilt workspace will fail provisioning the same way other workspaces do.
249249

250+
###Managing prebuild provisioning queues
251+
252+
It is possible for prebuilt workspaces to overwhelm a Coder deployment to the point that users and template administrators experience significant delays when they attempt to create new workspaces or manage their templates. This may happen organically, if there are not enough provisioners to meet the needs of the Coder deployment. It may also happen if a broken template is uploaded, which mistakenly requests too many prebuilt workspaces. In the latter case, it may be hard to correct the situation because a fixed template version cannot be uploaded while the Coder deployment's provisioners are overloaded.
253+
254+
If your Coder deployment is exhibiting the above symptoms, follow these instructions to verify and then rectify the situation:
255+
256+
First, run:
257+
```bash
258+
coder prebuilds pause
259+
```
260+
261+
This prevents further pollution of your provisioner queues. Specifically, it will prevent the prebuilt workspaces feature from scheduling new prebuilt workspace creation jobs. Jobs that have already been enqueued will still be processed at this point. Regardless of the steps taken in the rest of your troubleshooting process, remember to run`coder prebuilds resume` once all impact has been mitigated. See the last step in this section for more information.
262+
263+
Next, run:
264+
```bash
265+
coder provisionerjobs list --status=pending --initiator=prebuilds
266+
```
267+
268+
This will show a list of all pending jobs that have been enqueued by the prebuilt workspace system. The length of this list is an indicator of whether prebuilt workspaces have overwhelmed your Coder deployment. Human initiated jobs do have priority over pending prebuild jobs, but a prebuild job that is already running will not be preempted to process a human initiated job. An extended list of pending prebuild jobs therefore increases the likelihood that all provisioners may already be occopied when a human user would like to create a workspace. This then transitively increases the likelihood that users will experience delays waiting for the next available provisioner to become available when they try to manage their workspaces or templates.
269+
270+
To ensure that the next available provisioner will be given to a human initiated job, run:
271+
```bash
272+
coder provisionerjobs list --status=pending --initiator=prebuilds| jq'...'| xargs -n1 -P2 -I{} coder provisionerjobs cancel {}
273+
```
274+
275+
This will clear the provisioner queue of all jobs that were not initiated by a human being, which increases the probability that a provisioner will be available when the next human operator needs it. It does not cancel running provisioner jobs, so there may still be some delay in processing new provisioner jobs at least until a provisioner completes its current job.
276+
277+
At this stage, most prebuild related impact will have been mitigated. There may still be a bugged template version, but it will no longer pollute provisioner queues with prebuilt workspace jobs. If the latest version of a template is also broken for reasons unrelated to prebuilds, then users are able to create workspaces using a previous template version. Some running jobs may have been initiated by the prebuild system, but these cannot be cancelled without potentially orphaning resources that have already been deployed by Terraform. Depending on your deployment and template provisioning times, it might be best to upload a new template version and wait for it to be processed organically.
278+
279+
If you need to expedite the processing of human-related jobs at the cost of some infrastructure house-keeping, then you can run:
280+
```bash
281+
coder provisionerjobs list --status=running --initiator=prebuilds| jq'...'| xargs -n1 -P2 -I{} coder provisionerjobs cancel {}
282+
```
283+
284+
This will cancel running prebuild jobs (orphaning any resources that have already been deployed) and immediately make room for human-initiated jobs.
285+
286+
Once the provisioner queue has been cleared and all templates have been fixed, remember to resume prebuild reconciliation by running:
287+
```bash
288+
coder prebuilds resume
289+
```
290+
250291
###Template configuration best practices
251292

252293
####Preventing resource replacement

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp