Skip to content

allocator: high amount of CPU usage for storepool logging #104919

Open
@kvoli

Description

@kvoli

In an internal test cluster running 23.1.2 with 48 nodes we see that allocator logging is using 4% of CPU (32vCPU).

image

The CPU usage is from here:

log.VEventf(ctx, 3,
"s%d is a live target, candidate for rebalancing", targetStoreID)
return true
case storeStatusDead, storeStatusUnknown, storeStatusDecommissioning, storeStatusSuspect, storeStatusDraining:
log.VEventf(ctx, 3,
"not considering non-live store s%d (%v)", targetStoreID, status)
return false

When grabbing another profile the CPU time disappears. The suspect part is the number of string operations - which eat the majority of CPU shown above.

Details

image

It appears possible redact printing status is eating most of the CPU, however I'm not certain. Also these log statements are at v=3, meaning that tracing must have been enabled consistently - which I suppose makes sense given:

ctx, sp := tracing.EnsureChildSpan(ctx, rq.Tracer, "process replica",
tracing.WithRecording(tracingpb.RecordingVerbose))
defer sp.Finish()

Jira issue: CRDB-28774

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCode not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions