Skip to content

kvstreamer: impact on go scheduling latency #129942

@tbg

Description

@tbg

Describe the problem

I was looking at some customer statement traces and noticed that frequently, kvstreamer would created several hundred goroutines at once. This leads to temporary scheduler overload

kvstreamer is in no way unique in causing such behavior, but it is one instance I've noticed multiple times. At present, I'm unable to quantify the performance impact in a concrete example, but I expect it to have substantial impact on the tail, especially in the case in which each individual kvstreamer request is computationally nontrivial.

To Reproduce

I did not reproduce this but saw it in a customer system, but I assume it is straightforward to reproduce and detect via an execution trace.

Note in the screenshot below how the scheduler suddenly finds itself with (at peak) 400+ runnable goroutines. This is a 32vcpu machine, so a single kvstreamer may launch 256 goroutines. These goroutines will compete for CPU time with other foreground reads that may be deemed more important by the user.

image

image

Unsure how to classify this (which A- label? Is SQL-Queries the right team?).

Jira issue: CRDB-41788

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-enhancementSolution expected to add code/behavior + preserve backward-compat (pg compat issues are exception)O-supportWould prevent or help troubleshoot a customer escalation - bugs, missing observability/tooling, docsP-3Issues/test failures with no fix SLAT-sql-queriesSQL Queries Team

    Type

    No type

    Projects

    Status

    Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions