Skip to content

Re-evaluate dogstatsd_buffer_count default for UDS stream workloads. #1382

@webern

Description

@webern

dogstatsd_buffer_count is an ADP-only config key (no core agent equivalent). It controls how many packet buffers are pre-allocated in a shared pool at startup. The current default is 128.

The pool is global — created once (mod.rs:450) and shared across all listeners and connections. It uses a semaphore internally, so when all buffers are in use, new reads block until a buffer is returned. The IoBufferManager releases buffers back to the pool promptly for connection-oriented streams (UDS stream, TCP), but retains them permanently for connectionless listeners (UDP, UDS datagram).

For UDP and UDS datagram workloads, 128 is more than sufficient. But UDS stream is connection-oriented — each active connection needs a buffer from the shared pool during reads. In high-fan-in scenarios (many simultaneous clients sending over UDS stream), active connections could exhaust the pool and stall I/O.

Re-evaluate whether the default should be higher for deployments using UDS stream. The memory cost is modest — each buffer is dogstatsd_buffer_size bytes (default 8192), so doubling from 128 to 256 adds approximately 1 MiB.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/configConfiguration.area/memoryMemory bounds and memory management.source/dogstatsdDogStatsD source.type/investigationA potential issue that requires further investigation to quantify and categorize.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions