Skip to content

High CPU overhead while using spring-cloud-gateway with agent #12796

@123liuziming

Description

@123liuziming

I am evaluating the performance impact of otel java agent on spring-cloud-gateway application, and I found the performance overhead introduced by agent in this scenario to be very high.
image
image
CPU usage doubled in my performance test scenario(I do the performance test with&without otel java agent, and send requests to a spring-cloud-gateway application with 1000 QPS).

I 've analyzed the flame graph
flamegraph.zip

The main reason for this performance overhead is because agent use resetOnEachOperator to propagate context on all the operators. But in this scenario, most of the context propagations are useless for users because SCG do not produce any span in those operators. Do we have some ways to avoid those context propagation?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions