Consider disabling WebSocket message splitting when permessage-deflate is off
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 45/100
- Issue type
- Feature
- Clarity
- Needs clarification
- Activity status
- Quiet
- Tech stack
- typescript, vscode
- Domain
- networking, performance
Research direction
Start by reviewing ipc.net.ts, especially MaxWebSocketMessageLength and the enableMessageSplitting behavior described in the issue. Compare the splitting and non-splitting paths under proxied, high-latency connections, then define whether completion means a CLI-configurable setting or a changed default supported by latency and compression-safety checks.
Written by the indexing model from the issue text.
Description
WebSocket message splitting adds significant latency for large files on proxied connections
When serving code-server behind a proxy (which is the common production deployment), the 256KB WebSocket message splitting introduced in microsoft/vscode#174278 multiplies per-message RTT overhead significantly for large file operations like image previews.
Background
VS Code splits large IPC messages into 256KB chunks (MaxWebSocketMessageLength = 256 * 1024 in ipc.net.ts) to avoid blocking the Node.js event loop during zlib compression. Each chunk becomes a separate WebSocket message.
The latency problem in proxied deployments
In a proxied deployment (e.g. a gateway in front of a devbox), each WebSocket message incurs a full round-trip. With 100ms RTT between the proxy and the devbox:
- A 10MB file generates ~40 chunks (10MB ÷ 256KB)
- Each chunk = one WebSocket message = one round-trip
- Total overhead: ~40 × 100ms = ~4 seconds of pure latency
We tested image preview times (time from opening a file in the explorer to the image fully rendering) across different file sizes at 100ms simulated RTT:
| File size | Splitting ON | Splitting OFF | Improvement |
|---|---|---|---|
| 145 KB | 2,212ms | 2,251ms | ~0% |
| 1 MB | 1,988ms | 1,707ms | 14% |
| 1.5 MB | 2,093ms | 1,412ms | 33% |
| 5.6 MB | 4,255ms | 2,193ms | 48% |
| 10.3 MB | 7,262ms | 2,888ms | 60% |
Is disabling splitting safe? (Does zlib actually block?)
A few basic tests didn't seem to indicate this issue in our case, but more investigation may be needed
Question
Would you consider making enableMessageSplitting configurable via a CLI flag, or defaulting it to false for single-user deployments?
Happy to submit a PR if there's agreement on the right approach.
- Dominant language
- TypeScript
- Stars
- 79.4k
- Forks
- 6.9k
- Avg merge
- 2d 13h
- Merged PRs (30d)
- 39
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from coder/code-server
-
Difficulty 1/5 Under an hour Newbie friendliness 92/100
coder/code-server#8017 · 2 comments ·
-
security
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
coder/code-server#8013 · 4 comments ·
-
enhancement
Difficulty 5/5 Over a week Newbie friendliness 35/100
coder/code-server#7976 · 2 comments ·
-
enhancement
Difficulty 5/5 Over a week Newbie friendliness 35/100
coder/code-server#7962 · 3 comments ·
-
bug needs-investigation
Difficulty 4/5 3-5 days Newbie friendliness 55/100
coder/code-server#7955 · 1 comment ·
All issues in coder/code-server
Similar issues
-
VerificationGate: ATTRIBUTION quote guard never matches a normal quotation (\b around the quote) Open
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
danielmiessler/LifeOS#2234 ·
-
T: Bug
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
-
Difficulty 1/5 Under an hour Newbie friendliness 85/100
-
Mend: dependency security vulnerability untriaged
Difficulty 2/5 1-3 hours Newbie friendliness 70/100