Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 5 additions & 7 deletions nixos/modules/services/misc/apache-kafka.nix
Original file line number Diff line number Diff line change
Expand Up @@ -94,14 +94,12 @@ in {
"-server"
"-Xmx1G"
"-Xms1G"
"-XX:+UseCompressedOops"
"-XX:+UseParNewGC"
"-XX:+UseConcMarkSweepGC"
"-XX:+CMSClassUnloadingEnabled"
"-XX:+CMSScavengeBeforeRemark"
"-XX:+DisableExplicitGC"
"-XX:+UseG1GC"
Copy link
Contributor

Choose a reason for hiding this comment

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

I wonder if there's a need to be explicit since G1 should be default GC since java 9.

Copy link
Contributor Author

@GTrunSec GTrunSec Oct 12, 2020

Choose a reason for hiding this comment

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

https://github.com/apache/kafka/blob/aba9036eb681597911343510e246de4fc547a479/bin/kafka-run-class.sh#L257. I think, the option of default should be matched with this line of the shell. otherwise, I can remove the default flags to list of example such as XX:+DisableExplicitGC was replaced by -XX:+ExplicitGCInvokesConcurrent in the default JVM settings. may this will be a good way to comment for users. it does not matter the flag is default setting or not. Or set the default list to empty(the example list as explain option).

"-XX:+ExplicitGCInvokesConcurrent"
"-XX:InitiatingHeapOccupancyPercent=35"
"-XX:MaxGCPauseMillis=20"
"-XX:InitiatingHeapOccupancyPercent=35"
"-Djava.awt.headless=true"
"-Djava.net.preferIPv4Stack=true"
];
type = types.listOf types.str;
example = [
Expand Down
12 changes: 9 additions & 3 deletions nixos/tests/kafka.nix
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,15 @@ let
zookeeper = "zookeeper1:2181";
# These are the default options, but UseCompressedOops doesn't work with 32bit JVM
jvmOptions = [
"-server" "-Xmx1G" "-Xms1G" "-XX:+UseParNewGC" "-XX:+UseConcMarkSweepGC" "-XX:+CMSClassUnloadingEnabled"
"-XX:+CMSScavengeBeforeRemark" "-XX:+DisableExplicitGC" "-Djava.awt.headless=true" "-Djava.net.preferIPv4Stack=true"
] ++ optionals (! pkgs.stdenv.isi686 ) [ "-XX:+UseCompressedOops" ];
"-Xmx1G"
"-Xms1G"
"-XX:+UseG1GC"
"-XX:+ExplicitGCInvokesConcurrent"
"-XX:InitiatingHeapOccupancyPercent=35"
"-XX:MaxGCPauseMillis=20"
"-XX:InitiatingHeapOccupancyPercent=35"
"-Djava.awt.headless=true"
];
};

networking.firewall.allowedTCPPorts = [ 9092 ];
Expand Down