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

Allow configuring java settings #3

Closed
bbaugher opened this issue Mar 30, 2015 · 4 comments

Comments

Projects
None yet
2 participants
@bbaugher
Copy link
Owner

commented Mar 30, 2015

No description provided.

@gregorskii

This comment has been minimized.

Copy link

commented Oct 2, 2017

Can you provide an example in the readme about how to set the java arguments for one of the services? In other cookbooks I have used the arguments are provided as a string.

When I set the arguments in this book they are not applied to the running tasks.

MIN_HEAP_MEMORY = node['MIN_HEAP_MEMORY']
MAX_HEAP_MEMORY = node['MAX_HEAP_MEMORY']

opts = "-Xms#{MIN_HEAP_MEMORY}m -Xmx#{MAX_HEAP_MEMORY}m"

node.default["confluent"]["kafka"]["env_vars"] = {
  '_JAVA_OPTIONS' => opts
}
conflue+ 25416  6.9  4.7 4299520 377084 ?      Sl   00:58   0:02 java -Xmx1G -Xms1G -server -XX:+UseG1GC -XX:MaxGCPauseMillis=20 -XX:InitiatingHeapOccupancyPercent=35 -XX:+D
conflue+ 25503  9.7  3.1 4259460 255608 ?      Sl   00:59   0:03 java -Xmx256M -server -XX:+UseG1GC -XX:MaxGCPauseMillis=20 -XX:InitiatingHeapOccupancyPercent=35 -XX:+Disabl
conflue+ 25568 12.2  3.2 4255248 261332 ?      Sl   00:59   0:03 java -Xmx512M -server -XX:+UseG1GC -XX:MaxGCPauseMillis=20 -XX:InitiatingHeapOccupancyPercent=35 -XX:+Disabl
conflue+ 25654 95.1 14.7 4251696 1178788 ?     Sl   00:59   0:19 java -Xmx256M -server -XX:+UseG1GC -XX:MaxGCPauseMillis=20 -XX:InitiatingHeapOccupancyPercent=35 -XX:+Disabl

The tasks seem to have their default memory settings.

@bbaugher

This comment has been minimized.

Copy link
Owner Author

commented Oct 3, 2017

You are correct that the environment variables config is the best way to set java options. The next is what environment variables to set. This is provided by kafka and its run/start server scripts. You can see an example here where its using $KAFKA_JVM_PERFORMANCE_OPTS and provides the value -server -XX:+UseG1GC -XX:MaxGCPauseMillis=20 -XX:InitiatingHeapOccupancyPercent=35 -XX:+ExplicitGCInvokesConcurrent -Djava.awt.headless=true by default. There are others for heap ($KAFKA_HEAP_OPTS).

I'd assume these environment variables are the same as the ones in confluent's kafka package but you may need to verify in its package/distribution.

@bbaugher

This comment has been minimized.

Copy link
Owner Author

commented Oct 3, 2017

I'll see if I can add a small bit in the README about this

@gregorskii

This comment has been minimized.

Copy link

commented Oct 3, 2017

Perfect thank you for pointing that out, appreciate it.

I didn’t know if it was global java options or per argument ones on Kafka, great to have clarity.

👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.