File tree Expand file tree Collapse file tree 3 files changed +1
-52
lines changed
bash/artifacts/opt/jboss/container/java/jvm Expand file tree Collapse file tree 3 files changed +1
-52
lines changed Original file line number Diff line number Diff line change 3030- name : JAVA_DEBUG_PORT
3131 description : Port used for remote debugging. Defaults to *5005*.
3232 example : " 8787"
33- - name : CONTAINER_CORE_LIMIT
34- description : A calculated core limit as described in https://www.kernel.org/doc/Documentation/scheduler/sched-bwc.txt.
35- example : " 2"
3633- name : CONTAINER_MAX_MEMORY
3734 description : Memory limit given to the container.
3835 example : " 1024"
Original file line number Diff line number Diff line change 88#
99# This script is meant to be sourced.
1010
11- ceiling () {
12- awk -vnumber=" $1 " -vdiv=" $2 " '
13- function ceiling(x){
14- return x%1 ? int(x)+1 : x
15- }
16- BEGIN{
17- print ceiling(number/div)
18- }
19- '
20- }
21-
22- # Based on the cgroup limits, figure out the max number of core we should utilize
23- core_limit () {
24- local cpu_period_file=" /sys/fs/cgroup/cpu/cpu.cfs_period_us"
25- local cpu_quota_file=" /sys/fs/cgroup/cpu/cpu.cfs_quota_us"
26- if [ -r " ${cpu_period_file} " ]; then
27- local cpu_period=" $( cat ${cpu_period_file} ) "
28-
29- if [ -r " ${cpu_quota_file} " ]; then
30- local cpu_quota=" $( cat ${cpu_quota_file} ) "
31- # cfs_quota_us == -1 --> no restrictions
32- if [ " x$cpu_quota " != " x-1" ]; then
33- ceiling " $cpu_quota " " $cpu_period "
34- fi
35- fi
36- fi
37- }
38-
3911max_unbounded () {
4012 cat /proc/meminfo | grep ' MemTotal:' | awk ' {print $2*1024}'
4113}
@@ -57,11 +29,6 @@ min() {
5729 printf " %s\n" " $@ " | sort -g | head -n1
5830}
5931
60- local limit=" $( core_limit) "
61- if [ x$limit != x ]; then
62- export CONTAINER_CORE_LIMIT=" $limit "
63- fi
64-
6532local max_mem=" $( container_memory) "
6633if [ x$max_mem != x ]; then
6734 export CONTAINER_MAX_MEMORY=" $max_mem "
Original file line number Diff line number Diff line change @@ -114,21 +114,6 @@ diagnostics() {
114114 fi
115115}
116116
117- cpu_core_tunning () {
118- # If none are set, just return.
119- local core_limit=${CONTAINER_CORE_LIMIT}
120- if [ " x$core_limit " = " x0" -o " x$core_limit " = " x" ]; then
121- return
122- else
123- if [ " x$CONTAINER_CORE_LIMIT " != " x" ] && [ $core_limit -gt $CONTAINER_CORE_LIMIT ]; then
124- core_limit=$CONTAINER_CORE_LIMIT
125- fi
126- echo " -XX:ParallelGCThreads=${core_limit} " \
127- " -Djava.util.concurrent.ForkJoinPool.common.parallelism=${core_limit} " \
128- " -XX:CICompilerCount=2"
129- fi
130- }
131-
132117gc_config () {
133118 local minHeapFreeRatio=${GC_MIN_HEAP_FREE_RATIO:- 10}
134119 local maxHeapFreeRatio=${GC_MAX_HEAP_FREE_RATIO:- 20}
@@ -175,4 +160,4 @@ error_handling() {
175160initialize_container_limits > /dev/null
176161
177162# # Echo options, trimming trailing and multiple spaces
178- echo " $( initial_memory) $( max_memory) $( gc_config) $( diagnostics) $( cpu_core_tunning ) $( error_handling) " | awk ' $1=$1'
163+ echo " $( initial_memory) $( max_memory) $( gc_config) $( diagnostics) $( error_handling) " | awk ' $1=$1'
You can’t perform that action at this time.
0 commit comments