Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

KAFKA-18046: cache calls to LoggerFactory.getLogger() inside LogContext #17896

Open
wants to merge 2 commits into
base: trunk
Choose a base branch
from

Conversation

m-anthony
Copy link

use ConcurrentHashMap#computeIfAbsent in LogContext#logger since LoggerFactory#getLogger is costly with Log4j2

Copy link
Collaborator

@gaurav-narula gaurav-narula left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@m1a2st
Copy link
Contributor

m1a2st commented Dec 22, 2024

Hello @m-anthony, Thanks for this PR, I'm interesting in this issue!
Could you please provide the observed data before and after this PR? I have tested versions 3.9 and 4.0 in my local environment. I noticed that CPU usage is higher in version 4.0, but I couldn't observe whether the impact is truly positively correlated with log4j2. Could you share your test screenshots? Thank you!

@gaurav-narula
Copy link
Collaborator

@m1a2st : I reckon the flamegraphs are in the JIRA ticket https://issues.apache.org/jira/browse/KAFKA-18046

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants