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

[Performance]Use threadGroup to compute threads state rather than ThreadMXBean #1235

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

Conversation

hfutatzhanghb
Copy link

@hfutatzhanghb hfutatzhanghb commented Dec 18, 2024

Environment: jdk-1.8
We encountered performance issue caused by jmx-exporter agent when the thread counts of HDFS Router becoming high.
We have found that it because exporter agent uses ThreadMXBean to compute threads state. It has big performance problem when thread count is high.

image

More detailes, please refer to https://issues.apache.org/jira/browse/HADOOP-16850

image

@zeitlinger
Copy link
Member

Thanks for the contribution!

There's a build failure.

@hfutatzhanghb
Copy link
Author

Thanks for the contribution!

There's a build failure.

Sir, thanks for reminding. Have fixed.

@zeitlinger
Copy link
Member

Now fails at JvmThreadsMetricsTest.testGoodCase:86

@hfutatzhanghb
Copy link
Author

Now fails at JvmThreadsMetricsTest.testGoodCase:86
Sir, In my local without this PR, there are also some failed unit tests. So i always use -DskipTests parameter to compile this project.

@zeitlinger
Copy link
Member

Now fails at JvmThreadsMetricsTest.testGoodCase:86
Sir, In my local without this PR, there are also some failed unit tests. So i always use -DskipTests parameter to compile this project.

compare with the setup in gh actions - probably a different VM of maven version

@hfutatzhanghb
Copy link
Author

Now fails at JvmThreadsMetricsTest.testGoodCase:86
Sir, In my local without this PR, there are also some failed unit tests. So i always use -DskipTests parameter to compile this project.

compare with the setup in gh actions - probably a different VM of maven version

Sir, After refer to source code. It is because we don't use ThreadMXBean to compute thread state, so the mocked ThreadMXBean is invalid.

@zeitlinger
Copy link
Member

so the mocked ThreadMXBean is invalid.

can you fix it?

@hfutatzhanghb
Copy link
Author

so the mocked ThreadMXBean is invalid.

can you fix it?

Sir, we can add a config to decide use which way to compute thread state. Then in unit test we still use ThreadMXBean

@zeitlinger
Copy link
Member

what's your proposed fix for the build failure?

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