Skip to content

Conversation

@dcw-data
Copy link

Add --percentile[=LIST] option to report latency percentiles during pgbench runs. By default reports p50, p90, p99, p99.9, and p99.99. Users can specify a custom comma-separated list of percentiles (0-100) to report.

Implementation details:

  • Multi-tier histogram with bounded memory (~100KB per histogram):
    • Fine buckets: 0-100ms at 100μs resolution (1000 buckets)
    • Coarse buckets: 100ms-10s at 1ms resolution (9900 buckets)
    • Medium buckets: 10s-120s at 100ms resolution (1100 buckets)
    • Large buckets: 120s-1200s at 1s resolution (1080 buckets)
  • Dynamic overflow tracking for latencies exceeding 20 minutes, storing individual values in a growable array for accurate tail percentiles
  • Per-command percentile reporting when combined with -r flag, with percentiles displayed on a single line per command
  • Per-script percentile aggregation across all threads

New options:

  • --percentile[=LIST]: Enable percentile reporting with optional custom list
  • --debug-latency-multiplier=N: Multiply latencies for testing overflow handling

Memory considerations documented for high-concurrency scenarios with per-command reporting enabled. Includes comprehensive TAP test coverage for custom percentile lists, overflow handling, and per-command reporting.

Add --percentile[=LIST] option to report latency percentiles during pgbench runs.
By default reports p50, p90, p99, p99.9, and p99.99. Users can specify a custom
comma-separated list of percentiles (0-100) to report.

Implementation details:
- Multi-tier histogram with bounded memory (~100KB per histogram):
  * Fine buckets: 0-100ms at 100μs resolution (1000 buckets)
  * Coarse buckets: 100ms-10s at 1ms resolution (9900 buckets)
  * Medium buckets: 10s-120s at 100ms resolution (1100 buckets)
  * Large buckets: 120s-1200s at 1s resolution (1080 buckets)
- Dynamic overflow tracking for latencies exceeding 20 minutes, storing
  individual values in a growable array for accurate tail percentiles
- Per-command percentile reporting when combined with -r flag, with
  percentiles displayed on a single line per command
- Per-script percentile aggregation across all threads

New options:
- --percentile[=LIST]: Enable percentile reporting with optional custom list
- --debug-latency-multiplier=N: Multiply latencies for testing overflow handling

Memory considerations documented for high-concurrency scenarios with
per-command reporting enabled. Includes comprehensive TAP test coverage
for custom percentile lists, overflow handling, and per-command reporting.
@dcw-data dcw-data self-assigned this Dec 19, 2025
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