Beginning with Jenkins 2.357 (released on June 28, 2022) and the forthcoming September LTS release, Jenkins requires Java 11. Additionally, beginning with Jenkins 2.355 (released on June 14, 2022) and Jenkins 2.346.1 LTS (released on June 22, 2022), Jenkins supports Java 17. Plugins have already been prepared in JENKINS-68446. Use the Plugin Manager to upgrade all plugins before and after upgrading to Jenkins 2.357.
Omitting -XX:+UnlockDiagnosticVMOptions or -XX:+UnlockExperimentalVMOptions might cause your instance to fail to startup.
To increase GC logs to a longer period of time, we suggest
increasing the value of the arguments -Xlog option filecount=2 and/or filesize=100M
and as ultimate option use file=${LOGDIR}/gc-%t.log instead of file=${LOGDIR}/gc.log.
With the parameter %t, the JVM create a new set of GC files each time that the instance is restarted. It is well known that when the GC log folder gets big enough in terms of size, the support bundle might produce performance issues in the instance given that it needs to compress all of them.
-XX:+AlwaysPreTouch
-XX:+HeapDumpOnOutOfMemoryError
-XX:HeapDumpPath=${LOGDIR}
-XX:+UseG1GC
-XX:+UseStringDeduplication
-XX:+ParallelRefProcEnabled
-XX:+DisableExplicitGC
-XX:+UnlockDiagnosticVMOptions
-XX:+UnlockExperimentalVMOptions
-Xlog:gc*=info,gc+heap=debug,gc+ref*=debug,gc+ergo*=trace,gc+age*=trace:file=${LOGDIR}/gc.log:utctime,pid,level,tags:filecount=2,filesize=100M
-XX:ErrorFile=${LOGDIR}/hs_err_%p.log
-XX:+LogVMOutput
-XX:LogFile=${LOGDIR}/jvm.log
# Heap setting for CloudBees CI on modern cloud platforms:
# -XX:InitialRAMPercentage=50.0 -XX:MaxRAMPercentage=50.0
# Heap setting for CloudBees CI on traditional platforms:
# Heap Size `-Xmx` and `-Xms` should be set to the same value, and determined by following the above section "JVM Heap Size"
java 8
[!NOTE]
To increase GC logs to a longer period of time, we suggest
increasing the value of the arguments -XX:GCLogFileSize and -XX:NumberOfGCLogFiles
and as ultimate option use -Xloggc:${LOGDIR}/gc-%t.log instead of -Xloggc:${LOGDIR}/gc.log.
With the parameter %t, the JVM create a new set of GC files each time that the instance is restarted. It is well known that when the GC log folder gets big enough in terms of size, the support bundle might produce performance issues in the instance given that it needs to compress all of them.
$ docker run --rm openjdk:8-jre java -XX:MaxRAMPercentage=75 -help 2>&1 | head
Improperly specified VM option 'MaxRAMPercentage=75'
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.
$ docker run --rm openjdk:8-jre java -XX:MaxRAMPercentage=75.0 -help 2>&1 | head
Usage: java [-options] class [args...]
(to execute a class)
or java [-options] -jar jarfile [args...]
(to execute a jar file)
where options include:
-d32 use a 32-bit data model if available
-d64 use a 64-bit data model if available
-server to select the "server" VM
The default VM is server,
because you are running on a server-class machine.
-XX:+AlwaysPreTouch
-XX:+HeapDumpOnOutOfMemoryError
-XX:HeapDumpPath=${LOGDIR}
-XX:+UseG1GC
-XX:+UseStringDeduplication
-XX:+ParallelRefProcEnabled
-XX:+DisableExplicitGC
-XX:+UnlockDiagnosticVMOptions
-XX:+UnlockExperimentalVMOptions
-verbose:gc
-Xloggc:${LOGDIR}/gc.log
-XX:NumberOfGCLogFiles=2
-XX:+UseGCLogFileRotation
-XX:GCLogFileSize=100m
-XX:+PrintGC
-XX:+PrintGCDateStamps
-XX:+PrintGCDetails
-XX:+PrintHeapAtGC
-XX:+PrintGCCause
-XX:+PrintTenuringDistribution
-XX:+PrintReferenceGC
-XX:+PrintAdaptiveSizePolicy
-XX:ErrorFile=${LOGDIR}/hs_err_%p.log
-XX:+LogVMOutput
-XX:LogFile=${LOGDIR}/jvm.log
# Heap setting for CloudBees CI on modern cloud platforms:
# -XX:InitialRAMPercentage=50.0 -XX:MaxRAMPercentage=50.0
# Heap setting for CloudBees CI on traditional platforms:
# Heap Size `-Xmx` and `-Xms` should be set to the same value, and determined by following the above section "JVM Heap Size"
$ java -jar agent.jar -help
-agentLog FILE : Local agent error log destination
(overrides workDir)
-auth user:pass : (deprecated) unused; use -credentials
or -proxyCredentials
-cert VAL : Specify additional X.509 encoded PEM
certificates to trust when connecting
to Jenkins root URLs. If starting
with @ then the remainder is assumed
to be the name of the certificate
file to read.
-connectTo HOST:PORT : (deprecated) make a TCP connection to
the given host and port, then start
communication.
-credentials (-jnlpCredentials) : HTTP BASIC AUTH header to pass in for
USER:PASSWORD making HTTP requests.
-direct (-directConnection) HOST:PORT : Connect directly to this TCP agent
port, skipping the HTTP(S) connection
parameter download. For example,
"myjenkins:50000".
-failIfWorkDirIsMissing : Fails the initialization if the
requested workDir or internalDir are
missing ('false' by default)
(default: false)
-headless : (deprecated; now always headless)
-help : Show this help message (default: true)
-instanceIdentity VAL : The base64 encoded InstanceIdentity
byte array of the Jenkins controller.
When this is set, the agent skips
connecting to an HTTP(S) port for
connection info.
-internalDir VAL : Specifies a name of the internal
files within a working directory
('remoting' by default) (default:
remoting)
-jar-cache DIR : Cache directory that stores jar files
sent from the controller
-jnlpUrl URL : instead of talking to the controller
via stdin/stdout, emulate a JNLP
client by making a TCP connection to
the controller. Connection parameters
are obtained by parsing the JNLP file.
-loggingConfig FILE : Path to the property file with
java.util.logging settings
-name VAL : Name of the agent.
-noCertificateCheck (-disableHttpsCert : Ignore SSL validation errors - use as
Validation) a last resort only. (default: false)
-noKeepAlive : Disable TCP socket keep alive on
connection to the controller.
(default: false)
-noReconnect (-noreconnect) : Doesn't try to reconnect when a
communication fail, and exit instead
(default: false)
-ping : (deprecated; now always pings)
-protocols VAL : Specify the remoting protocols to
attempt when instanceIdentity is
provided.
-proxyCredentials USER:PASSWORD : HTTP BASIC AUTH header to pass in for
making HTTP authenticated proxy
requests.
-secret HEX_SECRET : Agent connection secret.
-tcp FILE : (deprecated) instead of talking to
the controller via stdin/stdout,
listens to a random local port, write
that port number to the given file,
then wait for the controller to
connect to that port.
-text : encode communication with the
controller with base64. Useful for
running agent over 8-bit unsafe
protocol like telnet
-tunnel HOST:PORT : Connect to the specified host and
port, instead of connecting directly
to Jenkins. Useful when connection to
Jenkins needs to be tunneled. Can be
also HOST: or :PORT, in which case
the missing portion will be
auto-configured like the default
behavior.
-url URL : Specify the Jenkins root URLs to
connect to.
-version : Shows the version of the remoting jar
and then exits (default: false)
-webSocket : Make a WebSocket connection to
Jenkins rather than using the TCP
port. (default: false)
-webSocketHeader NAME=VALUE : Additional WebSocket header to set,
eg for authenticating with reverse
proxies. To specify multiple headers,
call this flag multiple times, one
with each header
-workDir FILE : Declares the working directory of the
remoting instance (stores cache and
logs by default)
Scripts that obtain a crumb using the `/crumbIssuer/api` URL will now fail to perform actions protected from CSRF unless the scripts retain the web session ID in subsequent requests.
${PROTOCOL_FULLY_QUALIFIED_NAME}.disabled:
where PROTOCOL_FULLY_QUALIFIED_NAME equals PROTOCOL_HANDLER_CLASSNAME without the Handler suffix.
- description - `hudson.remoting.FlightRecorderInputStream.BUFFER_SIZE` :
Size (in bytes) of the flight recorder ring buffer used for debugging remoting issues - `hudson.remoting.Launcher.pingIntervalSec` :
Seconds between ping checks to monitor health of agent nodes; 0 to disable ping | - `hudson.remoting.Launcher.pingTimeoutSec` :
If ping of agent node takes longer than this, consider it dead; 0 to disable ping | - `hudson.remoting.RemoteClassLoader.force` :
Class name String. Forces loading of the specified class name on incoming requests. Works around issues like JENKINS-19445 | - `hudson.remoting.Engine.socketTimeout` :
Socket read timeout in milliseconds. If timeout happens and the failOnSocketTimeoutInReader property is true, the channel will be interrupted. | - `hudson.remoting.SynchronousCommandTransport.failOnSocketTimeoutInReader` :
Boolean flag. Enables the original aggressive behavior, when the channel reader gets interrupted by any SocketTimeoutException | - `hudson.remoting.ExportTable.unexportLogSize` :
Defines number of entries to be stored in the unexport history, which is being analyzed during the invalid object ID analysis. | - `${PROTOCOL_FULLY_QUALIFIED_NAME}.disabled` :
Boolean flag, which allows disabling particular protocols in remoting.
Property example:
org.jenkinsci.remoting.engine.JnlpProtocol3.disabled | - `org.jenkinsci.remoting.nio.NioChannelHub.disabled` :
Boolean flag to disable NIO-based socket connection handling, and switch back to classic IO. Used to isolate the problem. | - `org.jenkinsci.remoting.engine.JnlpAgentEndpointResolver.protocolNamesToTry` :
If specified, only the protocols from the list will be tried during the connection. The option provides protocol names, but the order of the check is defined internally and cannot be changed. |