Repository navigation
WebSocket: ask for 4000-byte file upload blocks - #20
Merged
Merged
Conversation
The WebSocket channel asked for 500-byte blocks. The device's reply to ufStart decides the size: older firmware allows 800 on WebSocket, and firmware with PSRAM from 2026-10 (RaftWebServer PR #6) up to 16000. Bigger blocks are faster where storage is fast: 200 KB uploads to an SD card on an ESP32-S3 took 29 KB/s with 800-byte blocks and 52 KB/s with 4000. The device writes each block in its main loop, so 4000 keeps each write short (16000 was only a little faster). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
RaftChannelWebSocketasks for 4000-byte file upload blocks instead of 500.ufStartstill decides the size:Why 4000
200 KB uploads over WebSocket to an ESP32-S3 with PSRAM (Axiom plant growth board), measured with RaftCLI against the same firmware:
The device writes each block in its main loop, so bigger blocks mean longer pauses there. 16000 is only a little faster than 4000. RaftCLI asks for 4000 too.
Test plan
tsc --noEmitandjest: 237 tests pass🤖 Generated with Claude Code