Skip to content

High CPU usage in async mode with Log4j2 #3635

Closed
@will-zdu

Description

@will-zdu

Description

When using Log4j2 in asynchronous logging mode, the CPU usage is significantly higher than expected, even under low logging throughput. This issue persists regardless of the configured

Configuration

Version: [2.24.3]

Operating system: [linux 6.8]

JDK: [jdk 11]

Logs

no

Reproduction

[An isolated test reproducing the test.
JUnit tests similar to the ones in the code base are extremely appreciated.]
-Dlog4j2.contextSelector=org.apache.logging.log4j.core.async.AsyncLoggerContextSelector
-DAsyncLogger.WaitStrategy=Sleep

add these jvm options
and run ,we will found the high cpu usage on "Log4j2-TF" thread

Metadata

Metadata

Assignees

No one assigned

    Labels

    waiting-for-userMore information is needed from the user

    Type

    No type

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions