Start the XFCE desktop before code-server and coder-init #4

Merged
GuillaumeHemmen merged 1 commit from perf/start-xfce-first into master 2026-09-30 08:09:57 +00:00
Member

Why

The Desktop tile takes ~15s to become healthy after the container starts, versus ~6s for code-server. Agent log timeline from the 2026-09-30 04:01 UTC start:

Time (UTC) Event
04:01:39.7 agent starts
04:01:40.0 startup script begins
04:01:45.9 code-server healthy
04:01:46.0 startup script done — XFCE only launched here
04:01:54.9 Desktop healthy

start-xfce-vnc was the last step of the startup script, so it queued behind the code-server install and coder-init (~6s) before starting its own ~4-9s bring-up (TigerVNC + XFCE + a fixed sleep 2 + websockify).

Change

Reorder the startup script: coder-init-desktop + start-xfce-vnc first (still backgrounded), then the code-server install/start and coder-init. Nothing else changes.

Safe because the desktop depends on neither moved step:

  • coder-init-desktop only heals ~/.config/xfce4/helpers.rc (default browser) and stale Claude Desktop entries — both read when used, not at session start. It is kept before XFCE anyway.
  • coder-init does bashrc/profile seeding, gitignore and nvm — not used by the X session.

Expected: Desktop healthy ~6s sooner, roughly alongside code-server. Headless variant is unaffected (both blocks are guarded by command -v).

Not validated

terraform isn't installed in the workspace, so no terraform validate; the change only reorders lines inside the heredoc. Verification is timing the next workspace start after coder templates push.

🤖 Generated with Claude Code

## Why The Desktop tile takes ~15s to become healthy after the container starts, versus ~6s for code-server. Agent log timeline from the 2026-09-30 04:01 UTC start: | Time (UTC) | Event | |---|---| | 04:01:39.7 | agent starts | | 04:01:40.0 | startup script begins | | 04:01:45.9 | code-server healthy | | 04:01:46.0 | startup script done — **XFCE only launched here** | | 04:01:54.9 | Desktop healthy | `start-xfce-vnc` was the last step of the startup script, so it queued behind the code-server install and `coder-init` (~6s) before starting its own ~4-9s bring-up (TigerVNC + XFCE + a fixed `sleep 2` + websockify). ## Change Reorder the startup script: `coder-init-desktop` + `start-xfce-vnc` first (still backgrounded), then the code-server install/start and `coder-init`. Nothing else changes. Safe because the desktop depends on neither moved step: - `coder-init-desktop` only heals `~/.config/xfce4/helpers.rc` (default browser) and stale Claude Desktop entries — both read when used, not at session start. It is kept before XFCE anyway. - `coder-init` does bashrc/profile seeding, gitignore and nvm — not used by the X session. Expected: Desktop healthy ~6s sooner, roughly alongside code-server. Headless variant is unaffected (both blocks are guarded by `command -v`). ## Not validated `terraform` isn't installed in the workspace, so no `terraform validate`; the change only reorders lines inside the heredoc. Verification is timing the next workspace start after `coder templates push`. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
The desktop was launched as the last step of the startup script, so it
waited ~6s on the code-server install and coder-init before it even
began its own ~4-9s startup. It depends on neither, so start it first
and let it come up in parallel.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
GuillaumeHemmen deleted branch perf/start-xfce-first 2026-09-30 08:09:57 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
GuillaumeHemmen-k8s/coder-sindri-deployment!4
No description provided.