Configuration Deployment speed

Support requests, bug reports, questions etc.
brom
NConf rookie
NConf rookie
Posts: 24
Joined: Tue Aug 23, 2011 14:52

Configuration Deployment speed

Post by brom » Thu Jul 25, 2013 15:44

Hi,

I have 3 collectors, one deploy is local and other two is under scp, network speed is OK, systems is not overloaded, I mean disk I/O etc. But deployment is took about 30sec. How can I speedup this? In case if this really possible of course.
Thanks.

iiro
starter
starter
Posts: 1
Joined: Wed Jul 31, 2013 19:48

Re: Configuration Deployment speed

Post by iiro » Thu Aug 01, 2013 10:35

brom wrote:Hi,

I have 3 collectors, one deploy is local and other two is under scp, network speed is OK, systems is not overloaded, I mean disk I/O etc. But deployment is took about 30sec. How can I speedup this? In case if this really possible of course.
Thanks.
We are having the same issue here - but we have only one collector and no remote deployment.

The deployment is fast for us but the "Generate config" takes a lot of CPU (it`s MySQL - I haven`t yet understood why) and takes time (maybe 15 seconds).

Eric
starter
starter
Posts: 3
Joined: Wed May 22, 2013 15:59

Re: Configuration Deployment speed

Post by Eric » Tue Aug 13, 2013 17:25

The problem is that nconf always copies all files, whether they are changed or not. Often you just make a change that reflects 1 instance, and nconf wants to copy everything to every instance.

I have speed up my deployment by writing a small script that keeps the hash values of the config files, and only copies the files when they have changed. You have to make one script per instance, use copy config to local and define multiple reload commands with these scripts (and they will take care of the copying and the reloading).

You might need to change some paths for your installation.

Example :

#! /bin/bash

###
# CONFIG
#######################################################################################################

instancename=MYINSTANCE
checksumfile=/var/spool/checksums/myinstance.txt
keyfile=/etc/icinga/keys/id_rsa_myinstance
targethost=192.168.0.2
ruser=root

#######################################################################################################

echo "Deploying ${instancename}"

# Check if there are changes
checksum=`cat /tmp/${instancename}/* /tmp/global/* | md5sum | cut -f 1 -d " "`
old=`cat ${checksumfile} 2>/dev/null`

if [ x${old} == x${checksum} ] ; then
echo "No changes for ${instancename}"
exit 0
else
cd /tmp
/usr/bin/scp -C -i ${keyfile} -r ${instancename} global ${ruser}@${targethost}:/etc/icinga/objects/
if [ $? -ne 0 ] ; then
echo "Error while copying"
exit 1
fi
/usr/bin/ssh -C -i ${keyfile} ${ruser}@${targethost} "/etc/init.d/icinga reload"
myexit=$?
if [ ${myexit} -eq 0 ] ; then
cat /tmp/${instancename}/* /tmp/global/* | md5sum | cut -f 1 -d " " > ${checksumfile}
fi
exit ${myexit}
fi

brom
NConf rookie
NConf rookie
Posts: 24
Joined: Tue Aug 23, 2011 14:52

Re: Configuration Deployment speed

Post by brom » Mon Aug 19, 2013 12:55

But I think solution should be present inside nconf. Checking which files are changed etc.
Waiting for developers comments, if project still alive %)

Locked