Skip to content

Mutex contention in servicegraphs processor #4908

@flxbk

Description

@flxbk

In some circumstances, the servicegraph processor in the metrics generator can spend a lot of time locking and unlocking the mutex in UpsertEdge.

The following is a screenshot from two execution traces captured from metrics generators ingesting from Kafka. Both show one of the goroutines running readCh. The bottom trace shows a state where the generator is keeping up with its backlog, while at the top it's falling behind.

Execution trace goroutine flamegraph

Image

If we need to improve throughput, optimizing this locking could be an option.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions