File tree 3 files changed +1
-52
lines changed
bash/artifacts/opt/jboss/container/java/jvm
3 files changed +1
-52
lines changed Original file line number Diff line number Diff line change 30
30
- name : JAVA_DEBUG_PORT
31
31
description : Port used for remote debugging. Defaults to *5005*.
32
32
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"
36
33
- name : CONTAINER_MAX_MEMORY
37
34
description : Memory limit given to the container.
38
35
example : " 1024"
Original file line number Diff line number Diff line change 8
8
#
9
9
# This script is meant to be sourced.
10
10
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
-
39
11
max_unbounded () {
40
12
cat /proc/meminfo | grep ' MemTotal:' | awk ' {print $2*1024}'
41
13
}
@@ -57,11 +29,6 @@ min() {
57
29
printf " %s\n" " $@ " | sort -g | head -n1
58
30
}
59
31
60
- local limit=" $( core_limit) "
61
- if [ x$limit != x ]; then
62
- export CONTAINER_CORE_LIMIT=" $limit "
63
- fi
64
-
65
32
local max_mem=" $( container_memory) "
66
33
if [ x$max_mem != x ]; then
67
34
export CONTAINER_MAX_MEMORY=" $max_mem "
Original file line number Diff line number Diff line change @@ -114,21 +114,6 @@ diagnostics() {
114
114
fi
115
115
}
116
116
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
-
132
117
gc_config () {
133
118
local minHeapFreeRatio=${GC_MIN_HEAP_FREE_RATIO:- 10}
134
119
local maxHeapFreeRatio=${GC_MAX_HEAP_FREE_RATIO:- 20}
@@ -175,4 +160,4 @@ error_handling() {
175
160
initialize_container_limits > /dev/null
176
161
177
162
# # 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