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

pulsar-perf: Dump JVM information #9769

Merged
merged 2 commits into from
Mar 2, 2021

Conversation

eolivelli
Copy link
Contributor

@eolivelli eolivelli commented Mar 1, 2021

Relates to #9721

Motivation

Is it really useful to have a summary of JVM configuration when you are working with pulsar-perf.
This is because that configuration may affect the execution of the test, but also with that piece of information you can easily troubleshot problems like #9721

Modifications

Log JVM configuration at boot:

  • Netty max memory
  • JVM command line arguments
  • Actual max heap size

Verifying this change

This change is a trivial rework / code cleanup without any test coverage.

@eolivelli
Copy link
Contributor Author

@codelipenghui @wolfstudy picking this to 2.7.1 will be very useful

public static void printJVMInformation(Logger log) {
RuntimeMXBean runtimeMXBean = ManagementFactory.getRuntimeMXBean();
log.info("Java Runtime Info");
System.getProperties().forEach( (k,v)-> {
Copy link
Contributor

Choose a reason for hiding this comment

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

I've been annoyed by ZK printing this (and classpath) for many years! :(

Can we keep it at just the args and the memory size?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

sure. that information is not very useful, only to report easily about the env.

@merlimat we can hide that information in ZooKeeper, https://issues.apache.org/jira/browse/ZOOKEEPER-4228

}
});
log.info("JVM args {}", runtimeMXBean.getInputArguments());
log.info("Netty max memory (PlatformDependent.maxDirectMemory()) {}", PlatformDependent.maxDirectMemory());
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we convert it to GB to make it easier to read?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done.
I am using now an utility from Commons IO in order to pretty print the value

Copy link
Contributor Author

@eolivelli eolivelli left a comment

Choose a reason for hiding this comment

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

@merlimat I have addressed your comments.
PTAL

@codelipenghui please consider merging this patch to 2.7.1

@merlimat merlimat merged commit 7643897 into apache:master Mar 2, 2021
zymap pushed a commit that referenced this pull request Mar 3, 2021
* Print JVM info while running pulsar-perf commands

* Address Matteo's comments

Co-authored-by: Enrico Olivelli <eolivelli@apache.org>
(cherry picked from commit 7643897)
@zymap zymap added the cherry-picked/branch-2.7 Archived: 2.7 is end of life label Mar 3, 2021
zymap pushed a commit to streamnative/pulsar-archived that referenced this pull request Mar 5, 2021
* Print JVM info while running pulsar-perf commands

* Address Matteo's comments

Co-authored-by: Enrico Olivelli <eolivelli@apache.org>
(cherry picked from commit 7643897)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cherry-picked/branch-2.7 Archived: 2.7 is end of life release/2.7.1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants