You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by "divijvaidya (via GitHub)" <gi...@apache.org> on 2023/02/10 09:40:40 UTC

[GitHub] [kafka] divijvaidya commented on pull request #13078: KAFKA-13999: Add ProducerCount metrics (KIP-847)

divijvaidya commented on PR #13078:
URL: https://github.com/apache/kafka/pull/13078#issuecomment-1425521316

   > One concern is that the ConcurrentHashMap could take up more space. This metric was introduced to try to get this memory usage under control.
   
   The hash map in question here stores the number of idempotent producers. Which I assume is in "hundreds" in a busy cluster. As per this old benchmark https://stackoverflow.com/a/11104401 (newer JVMs may have even smaller footprint) we have an incremental usage of 8 bytes per entry, so we are talking about 800 bytes more? I think this is a reasonable tradeoff compared the out-of-the-box thread safety & code simplification that `ConcurrentHashMap` provides here. The tradeoff becomes even more appealing since the class in question, is accessed by multiple threads.


-- 
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: jira-unsubscribe@kafka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org