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

Cache JMX connection and MBeans names and attributes #1019

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

max-melentyev
Copy link

Hey, I saw significant improvement with jmx connection cached. Here is a chart for sample cassandra cluster without any traffic, orange line is for an instance with patched exporter:
image
Cassandra Clusters with traffic have GC time and throughput decreased, and we saw latencies improved up to 50%. But this depends on the traffic patters and vary from cluster to cluster.

Implementation details:

  • scraper is cached in collector's config instance, so it's replaced every time config is reloaded.
  • jmx connection is cached in scraper, and it uses Cleaner API to close it when scraper is discarded.
  • MBeans names and attributes are cached in scraper. JMX client subscribes to MBean register/unregister events to invalidate this cache.
  • JMX is reconnected when any exception occurs. I tested only in javaagent mode, so didn't have a chance to test reconnection.

@dhoard
Copy link
Collaborator

dhoard commented Nov 5, 2024

@max-melentyev Thanks for the PR! I'll need to review it.

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

Successfully merging this pull request may close these issues.

2 participants