Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Disable pinging slaves in Jenkins

Tags:

So, we are seeing tons of our EC2 slaves go offline (using EC2 plugin). So to debug it I am trying to disabe pinging thread based on the article Pinging thread where they talk about disabling the ping thread on the master JVM on a running jenkins using:

Jenkins.instance.injector.getInstance(hudson.slaves.ChannelPinger.class).@pingInterval = -1

and to disable slaves from pinging the master, the system property -Dhudson.remoting.Launcher.pingIntervalSec=-1 needs to be set to slaves.

Questions:

  1. Where and how do I add the pingInterval value to -1?
  2. How and where do I set the system property for pingIntervalSec=-1

We are seeing tons of slaves going offline and I want to see if ping interval can help.

Thanks, Jason

like image 669
Jason Avatar asked May 04 '17 18:05

Jason


2 Answers

At the master node, you can change the system property under /etc/sysconfig/jenkins

JENKINS_JAVA_OPTIONS="-Djava.awt.headless=true -Dhudson.remoting.Launcher.pingIntervalSec=-1"

you can set the system property when you are running the slave (via JNPL):

java -Dhudson.remoting.Launcher.pingIntervalSec=-1 -jar slave.jar -jnlpUrl <Jenkins root URL>

-K

like image 79
JimK Avatar answered Sep 24 '22 10:09

JimK


From Jenkins version 2.37, the names of these properties are slightly different:

  • hudson.slaves.ChannelPinger.pingInterval - Since: 1.405, Default: 5, (Deprecated since 2.37) Frequency (in minutes) of pings between the controller and agents

  • hudson.slaves.ChannelPinger.pingIntervalSeconds - Since: 2.37, Default: 300, Frequency of pings between the controller and agents, in seconds

  • hudson.slaves.ChannelPinger.pingTimeoutSeconds - Since: 2.37, Default: 240, Timeout for each ping between the controller and agents, in seconds

See a list with all "Jenkins Features Controlled with System Properties" (https://www.jenkins.io/doc/book/managing/system-properties/ )

like image 39
Cristina Alboni Avatar answered Sep 25 '22 10:09

Cristina Alboni