Skip to content

chore(rtsp): tune buffer pool for 4K cameras#4

Merged
janost merged 1 commit into
masterfrom
chore/buffer-pool-tuning
Mar 19, 2026
Merged

chore(rtsp): tune buffer pool for 4K cameras#4
janost merged 1 commit into
masterfrom
chore/buffer-pool-tuning

Conversation

@janost
Copy link
Copy Markdown
Collaborator

@janost janost commented Mar 19, 2026

Summary

  • Bump MAX_BUCKET from 1MB to 4MB so 4K keyframes stay in the pooled path
  • Add trace logging for bucket distribution (needed vs bucket size)
  • Add debug logging when frames exceed MAX_BUCKET and fall back to non-pooled allocation

Context: upstream PR QuantumEntangledAndy#373 introduced power-of-two buffer pooling but capped at 1MB. 4K H265 I-frames can exceed that, pushing them to per-frame allocation and losing the FD/fragmentation benefits.

Test plan

  • Run with RUST_LOG=neolink::rtsp::factory=trace against a camera and verify bucket distribution logs appear
  • Confirm no debug fallback messages for typical 1080p/4K streams
  • Monitor FD count over time: watch -n1 "ls -l /proc/<PID>/fd | wc -l"

🤖 Generated with Claude Code

Increase MAX_BUCKET from 1MB to 4MB so 4K camera keyframes stay within
the pooled allocation path. Add trace logging for bucket distribution
and debug logging when frames exceed MAX_BUCKET and fall back to
non-pooled allocation.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@janost janost added the run-ci Triggers Docker build CI on PRs label Mar 19, 2026
@janost janost merged commit 4ad31b2 into master Mar 19, 2026
1 of 2 checks passed
@janost janost deleted the chore/buffer-pool-tuning branch March 19, 2026 16:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

run-ci Triggers Docker build CI on PRs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant