-
Language:
English
-
Language:
English
Chapter 4. Configuring your JBoss EAP server and application
The JBoss EAP for OpenShift image is preconfigured for basic use with your Java applications. However, you can configure the JBoss EAP instance inside the image. The recommended method is to use the OpenShift S2I process, together with application template parameters and environment variables.
Any configuration changes made on a running container will be lost when the container is restarted or terminated.
This includes any configuration changes made using scripts that are included with a traditional JBoss EAP installation, for example add-user.sh
or the management CLI.
It is strongly recommended that you use the OpenShift S2I process, together with application template parameters and environment variables, to make any configuration changes to the JBoss EAP instance inside the JBoss EAP for OpenShift image.
4.1. JVM default memory settings
You can use the following environment variables to modify the JVM settings calculated automatically. Note that these variables are only used when default memory size is calculated automatically when a valid container memory limit is defined.
Environment variables | Description |
---|---|
|
This environment variable is now deprecated. Corresponds to the JVM argument Note
You no longer need to set |
|
Environment variable to configure the |
|
Environment variable to provide additional options to the JVM, for example, Note
If you set a value for |
|
This environment variable is now deprecated. Use |
4.2. JVM garbage collection settings
The EAP image for OpenShift includes settings for both garbage collection and garbage collection logging
Garbage Collection Settings
-XX:+UseParallelGC -XX:MinHeapFreeRatio=10 -XX:MaxHeapFreeRatio=20 -XX:GCTimeRatio=4 -XX:AdaptiveSizePolicyWeight=90 -XX:+ExitOnOutOfMemoryError
Garbage Collection Logging Settings
-Xlog:gc*:file=/opt/server/standalone/log/gc.log:time,uptimemillis:filecount=5,filesize=3M
4.3. Resource limits in default settings
If set, additional default settings are included in the image.
-XX:ParallelGCThreads={core-limit} -Djava.util.concurrent.ForkJoinPool.common.parallelism={core-limit} -XX:CICompilerCount=2
The value of CICompilerCount
is always fixed as 2.
The container limits are automatically computed by JVM
.
4.4. JVM environment variables
Use these environment variables to configure the JVM in the EAP for OpenShift image.
Table 4.1. JVM Environment Variables
Variable Name | Example | Default Value | JVM Settings | Description |
---|---|---|---|---|
JAVA_OPTS | -verbose:class | No default | Multiple |
JVM options to pass to the
Use
Using
In addition, if automatic memory calculation is not enabled, the inital Java memory (-Xms) and maximum Java memory (-Xmx) are not defined.
Add these defaults if you use |
JAVA_OPTS_APPEND | -Dsome.property=value | No default | Multiple |
User-specified Java options to append to generated options in |
JAVA_MAX_MEM_RATIO | 50 | 80 | -Xmx |
Use this variable when the |
JAVA_INITIAL_MEM_RATIO | 25 | -Xms | -Xms |
Use this variable when the |
JAVA_MAX_INITIAL_MEM | 4096 | 4096 | -Xms |
|
JAVA_DIAGNOSTICS | true | false (disabled) |
|
Set the value of this variable to |
DEBUG | true | false | -agentlib:jdwp=transport=dt_socket,address=$DEBUG_PORT,server=y,suspend=n | Enables remote debugging. |
DEBUG_PORT | 8787 | 8787 | -agentlib:jdwp=transport=dt_socket,address=$DEBUG_PORT,server=y,suspend=n | Specifies the port used for debugging. |
GC_MIN_HEAP_FREE_RATIO | 20 | 10 | -XX:MinHeapFreeRatio | Minimum percentage of heap free after garbage collection to avoid expansion. |
GC_MAX_HEAP_FREE_RATIO | 40 | 20 | -XX:MaxHeapFreeRatio | Maximum percentage of heap free after garbage collection to avoid shrinking. |
GC_TIME_RATIO | 4 | 4 | -XX:GCTimeRatio | Specifies the ratio of the time spent outside of garbage collection (for example, time spent in application execution) to the time spent in garbage collection. |
GC_ADAPTIVE_SIZE_POLICY_WEIGHT | 90 | 90 | -XX:AdaptiveSizePolicyWeight | The weighting given to the current garbage collection time versus the previous garbage collection times. |
GC_METASPACE_SIZE | 20 | 96 | -XX:MetaspaceSize | The initial metaspace size. |
GC_MAX_METASPACE_SIZE | 100 | No default | -XX:MaxMetaspaceSize | The maximum metaspace size. |
GC_CONTAINER_OPTIONS | -XX:+UserG1GC | -XX:-UseParallelGC | -XX:-UseParallelGC | Specifies the Java garbage collection to use. The value of the variable is specified by using the Java Runtime Environment (JRE) command-line options. The specified JRE command overrides the default. |
The following environment variables are deprecated:
-
JAVA_OPTIONS
: UseJAVA_OPTS
. -
INITIAL_HEAP_PERCENT
: UseJAVA_INITIAL_MEM_RATIO
. -
CONTAINER_HEAP_PERCENT
: UseJAVA_MAX_MEM_RATIO
.
4.5. Default datasource
The datasource ExampleDS
is not available in JBoss EAP 8.0 Beta.
Some quickstarts require this datasource:
-
cmt
-
thread-racing
Applications developed by customers might also require the ExampleDS
datasource.
If you need the default datasource, use the ENABLE_GENERATE_DEFAULT_DATASOURCE
environment variable to include it when provisioning a JBoss EAP server.
ENABLE_GENERATE_DEFAULT_DATASOURCE=true
This environment variable works only when cloud-default-config
galleon layer is used.