ppkarwasz commented on issue #3635: URL: https://github.com/apache/logging-log4j2/issues/3635#issuecomment-2830090262
@will-zdu, Depending on the Disruptor waiting strategy you choose a high CPU usage on the asynchronous thread is perfectly normal. See the [documentation of the `log4j2.asyncLoggerWaitStrategy` configuration attribute](https://logging.apache.org/log4j/2.x/manual/async.html#log4j2.asyncLoggerWaitStrategy) and the [LMAX documentation of alternative wait strategies](https://lmax-exchange.github.io/disruptor/user-guide/index.html#_alternative_wait_strategies) for details. You can finely tune the `Sleep` wait strategy using the [`log4j2.asyncLoggerRetries`](https://logging.apache.org/log4j/2.x/manual/async.html#log4j2.asyncLoggerRetries) and [`log4j2.asyncLoggerSleepTimeNs`](https://logging.apache.org/log4j/2.x/manual/async.html#log4j2.asyncLoggerSleepTimeNs) configuration properties, e.g.: ``` -Dlog4j2.contextSelector=org.apache.logging.log4j.core.async.AsyncLoggerContextSelector -Dlog4j2.asyncLoggerWaitStrategy=Sleep -Dlog4j2.asyncLoggerRetries=200 -Dlog4j2.asyncLoggerSleepTimeNs=1000 ``` Does this solve your problem? -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: notifications-unsubscr...@logging.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org