Bandwidth limiter uses nanosleep causing jitter, and SSL thread-local limits threading #111
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Description
Two performance issues in the I/O layer:
Bandwidth limiter jitter (protocol.c:30-58): The token bucket throttle uses
nanosleep()for deficit sleep. Short sleeps on a loaded system can overrun. The 65536-byte chunk size for throttling may cause burstiness.SSL thread-local statics (protocol.c:11-13):
io_read_fd,io_write_fd,io_sslare__threadstatics. This works withfork()-per-connection but prevents using a thread pool on the server side without complex TLS context management.Location
Suggested Fix
timerfdfor precise bandwidth shaping, or useppoll()with a deadline.Severity
low
Category
performance
Sub-Agent
perf-analyst (PA-6, PA-7)
This issue was automatically generated by the issue-creator agent.
Fixed in PR #148 — merged into main on 2026-07-29.