-
Notifications
You must be signed in to change notification settings - Fork 480
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
HDDS-3173. Provide better default JVM options #710
Changes from 5 commits
7eedf5b
55a9911
80bdc94
ffede62
0db1e34
8894dad
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1541,6 +1541,21 @@ function hadoop_translate_cygwin_path | |
fi | ||
} | ||
|
||
## @description Adds default GC parameters | ||
## @description Only for server components and only if no other -XX parameters | ||
## @description are set | ||
## @audience private | ||
## @stability evolving | ||
## @replaceable yes | ||
function hadoop_add_default_gc_opts | ||
{ | ||
if [[ "${HADOOP_SUBCMD_SUPPORTDAEMONIZATION}" == true ]]; then | ||
if [[ ! "$HADOOP_OPTS" =~ "-XX" ]] ; then | ||
hadoop_debug "Appending default GC parameter to the HADOOP_OPTS" | ||
HADOOP_OPTS="${HADOOP_OPTS} -XX:ParallelGCThreads=8 -XX:+UseConcMarkSweepGC -XX:CMSInitiatingOccupancyFraction=70 -XX:+CMSParallelRemarkEnabled" | ||
fi | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should we print a warning or message if any -XX options are set, that we are not overriding the GC parameters? |
||
fi | ||
} | ||
## @description Adds the HADOOP_CLIENT_OPTS variable to | ||
## @description HADOOP_OPTS if HADOOP_SUBCMD_SUPPORTDAEMONIZATION is false | ||
## @audience public | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
#!/usr/bin/env bash | ||
# Licensed to the Apache Software Foundation (ASF) under one or more | ||
# contributor license agreements. See the NOTICE file distributed with | ||
# this work for additional information regarding copyright ownership. | ||
# The ASF licenses this file to You under the Apache License, Version 2.0 | ||
# (the "License"); you may not use this file except in compliance with | ||
# the License. You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
|
||
|
||
# | ||
# Can be executed with bats (https://github.com/bats-core/bats-core) | ||
# bats gc_opts.bats (FROM THE CURRENT DIRECTORY) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 👍 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is my first experiment, will see how does it work and eventually we can make it part of the main tests. The only problem what I have found until now that the test script is copied to /tmp by bats, I couldn't use any smart, relative path (like But I can live with it. |
||
# | ||
|
||
source ../../shell/hdds/hadoop-functions.sh | ||
@test "Setting Hadoop GC parameters: add GC params for server" { | ||
export HADOOP_SUBCMD_SUPPORTDAEMONIZATION=true | ||
export HADOOP_OPTS="Test" | ||
hadoop_add_default_gc_opts | ||
[[ "$HADOOP_OPTS" =~ "UseConcMarkSweepGC" ]] | ||
} | ||
|
||
@test "Setting Hadoop GC parameters: disabled for client" { | ||
export HADOOP_SUBCMD_SUPPORTDAEMONIZATION=false | ||
export HADOOP_OPTS="Test" | ||
hadoop_add_default_gc_opts | ||
[[ ! "$HADOOP_OPTS" =~ "UseConcMarkSweepGC" ]] | ||
} | ||
|
||
@test "Setting Hadoop GC parameters: disabled if GC params are customized" { | ||
export HADOOP_SUBCMD_SUPPORTDAEMONIZATION=true | ||
export HADOOP_OPTS="-XX:++UseG1GC -Xmx512" | ||
hadoop_add_default_gc_opts | ||
[[ ! "$HADOOP_OPTS" =~ "UseConcMarkSweepGC" ]] | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
UseConcMarkSweepGC was deprecated in JDK8.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, but as I learned from @arp7 we have no better option, right now. As I know G1 doesn't provide the same performance (yet).
The idea here was provide some very basic default to avoid bad experience for the users who use Ozone out-of-the-box. And advanced users can set any smart default.
Or do you suggest G1 by default?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, I'm not sure which is better.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Which is better heavily depends on the workload, but as the main workload are RPC calls with mostly short lived objects in our server processes, CMS is better due to the easier newGen eviction and low number of tenuring/surviving objects. At least this is the experience from HDFS and our workload on the DN and OM/SCM is very similar to HDFS server roles and consist mainly RPC calls while handling large metadata structures. G1 can be tuned for this kind of workload, but it is not the best performing one for this due to the segmented heap structure.