Skip to content

Run encoding and block compression on blocking pool - #336

Merged
serprex merged 1 commit into
mainfrom
offload-encoding-compression
Nov 20, 2026
Merged

serprex merged 1 commit into
mainfrom
offload-encoding-compression

Conversation

@serprex

@serprex serprex commented Nov 20, 2026

Copy link
Copy Markdown
Member

Encoding a whole run, which renders JSONB, and LZ4-compressing a Native block each hold a tokio worker for one long poll. The serial planner yields every 1ms and then waits for a free worker to resume, so encoding and compression were stalling it. On synthetic workload planning spent 16.4s of a 29s drain waiting to be resumed after a yield.

Moving both onto spawn_blocking frees the runtime workers for the planner. Over 4 interleaved rounds on the same archive:

WAL drain 21.7 -> 25.1 MiB/s
rows/s 4613 -> 5326
drain time 29.2 -> 25.3 s
wait after yield 16.4 -> 0.23 s
pump blocked 23.5 -> 18.7 s
peak RSS 973 -> 1137 MiB

Encoding a whole run, which renders JSONB, and LZ4-compressing a Native
block each hold a tokio worker for one long poll. The serial planner
yields every 1ms and then waits for a free worker to resume, so
encoding and compression were stalling it. On synthetic workload planning
spent 16.4s of a 29s drain waiting to be resumed after a yield.

Moving both onto spawn_blocking frees the runtime workers for the
planner. Over 4 interleaved rounds on the same archive:

  WAL drain          21.7 -> 25.1 MiB/s
  rows/s             4613 -> 5326
  drain time         29.2 -> 25.3 s
  wait after yield   16.4 -> 0.23 s
  pump blocked       23.5 -> 18.7 s
  peak RSS           973 -> 1137 MiB
@serprex
serprex merged commit f511d15 into main Nov 20, 2026
8 checks passed
@serprex
serprex deleted the offload-encoding-compression branch November 20, 2026 08:54
@serprex

serprex commented Nov 20, 2026

Copy link
Copy Markdown
Member Author

optimized for #229

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants