May 14, 2013 8:51 AM
Zencommand Threads/Parallel instances question
-
Like (0)
Hi All,
Does anyone know how I can tell how many instances of zencommand are currently set to run? I found a link that showed me how to change the number, docs/DOC-2521 but I don't know what the current number is..
We're having performance issues when we go over a certain threshold of zencommand operations and I want to know how to resolve it without resorting to another collector.
I want to increase the number of instances of zencommand running if possible. The above link says I can do this in $ZENHOME/etc/zencommand.conf by adding a line like this.
parallel 5
Any ideas would be really welcome,
Thanks,
Joan
joan,
You can see the default config values by su zenoss then zencommand genconf. Look in the scrollback for parallel. The default value will be in the comment. Heads up though, don't set this too high or you'll murder your box.
Best,
--Shane Scott (Hackman238)
Thanks for that Shane!
Actually Shane, do you know of any other way to increase throughput with zencommand other than adding another collector?
Thanks,
Joan
joan,
The best options short of creating a second logical collector on the same physical collector is to change the testing approach.
A short term option would be to optimize the code of the script zencommand is calling at scale. This can add up drmatically. Chaining sed, awk and other bins is very common, but each one takes up precious ms and causes thread contention. Every optimization you can make counts.
A better option would be to use PythonCollector (https://github.com/Hackman238/ZenPacks.zenoss.PythonCollector) as it's quite a bit more scalable than zencommand. The downside is your test would need to be rewritten in python.
The best option, in my opinion, is to try to use a similar test that fits under other zendaemons (like SNMP) or to craft a specialized daemon dedicated to the test needing large scale. This is usually isolated to cases where you're needing very large scale, producing a package for a customer for which scale is unknown or needing to create a custom datasource.
The big problem with zencommand isn't really zencommand at all- it's the nature of what it's designed to do, execute scripts and commands. The competition for execution resources really adds up fast, especially with high parallel values. What's worse is the collectors are often subjec to high IO wait from RRD writting to the disks. With that it's very easy for a normally fast script to dramatically bloat in execution time waiting for disk access.
--Shane Scott (Hackman238)
Thanks Shane, really appreciate that. I'll go research the python collector option now. Regarding the parallel instances of zencommand - I don't think I've succeeded in changing it. My zencommand.conf file shows this,
#PARAMETER VALUE
monitor localhost
parallel 15
but zencommand genconf shows this -
#
# Number of devices to collect at one
# time, default: 10
#parallel 10
#
running this - " zencommand start --parallel 15" from the CLI has no affect on what is generated by zencommand genconf.
Any ideas? Am I actually changing it at all? Or is it just not making a blind bit of difference to my overloaded zencommand daemon?
Thanks,
Joan
Huh, I just saw this "creating a second logical collector on the same physical collector", does that mean running a second zenoss instance from the same server?
Is there a doc somewhere on the forum that describes how to do this?
Thanks,
Joan
Hi Shane,
Just wondering if you'd mind explaining what you meant by -
"creating a second logical collector on the same physical collector"
Thanks,
Joan
I'm not Shane, but he means going into the GUI on Zenoss and (at least in 3.2.x) going to Advanced -> Collectors, and adding another one with the gear icon... This can increase parallelism of the checks, if your server has the hardware to not bog down (and you manually load balance devices across the 2 collectors)...
--
James Pulver
ZCA Member
LEPP Computer Group
Cornell University
Hi James,
Thanks for that. To ask the dumb question - I can see how you add a new collector in the webinterface, but how do I create another collector/instance of zenoss on the same physical host in the background? ie, zenoss only asks me the new collector name. What does that new collector name map to? Am I missing a zenpack/more configuration details?
Thanks,
Joan
I don't think you have to do anything else - you then would just move devices to the new collector. . . Then I think it will start up additional daemons.
--
James Pulver
ZCA Member
LEPP Computer Group
Cornell University
Hi James,
I'm using version 3.2.1. Adding a new monitor with the hostname of the existing box makes the new collector appear, but despite adding devices to it, nothing ever happens to them.They're no longer monitored by local host, but no collections are made by the "new" collector. At this point I have two collectors, localhost and actualhostname.com. That doesn't work, so I delete that collector and restart.
Then I installed ZenPacks.community.DistributedCollector, in case 3.2.1 is lacking something. This gave no errors during install, gives more options when I click on the gear, but the end result is the same. When I went to remove this zenpack, it told me it wasn't installed. So it's not installing properly but without any helpful errors.. I can only remove this from the GUI. I of course restart zenoss between each install/uninstall.
Any ideas? Thanks so much.
Regards,
Joan
Joan -
Setting up logical collectors isn't that hard but it a little bit of manual work. The steps are as follows:
1) Create the collector in the zenoss UI (let's say you call it collector1)
2) On the Zenoss server itself you have to duplicate all the daemons you want to run on this collector. So you would copy $ZENHOME/bin/zencommand to $ZENHOME/bin/collector1_zencommand, $ZENHOME/bin/zenperfsnmp to $ZENHOME/bin/collector1_zenperfsnmp, etc.
3) You then have to modify those files. So modify collector1_zencommand and set CFGFILE=$CFGDIR/collector1_zencommand.conf
4) For each of your collector1_ daemons you need a conf file in $ZENHOME/etc. For example $ZENHOME/etc/collector1_zencommand.conf (this file name matches what you set CFGFILE to). In the conffile you set the 'monitor' value to be what you configured in the UI (in my example 'collector1'). At a minimum you need:
monitor collector1
hubhost localhost
This is assuming you only have one zenoss server so the hub is the same machine.
You can then have all the other options that the daemons can have (in the case of zencommand; parallel etc.)
Then you have to create a $ZENHOME/etc/daemons.txt and in this file you list all of the collector1_ daemons you want to start. This should start all the normal zenoss deamons and the collector1_ daemons when you do a 'zenoss start'
Then when you assign a device to the 'collector1' collector it is these collector1_ daemons that are monitoring it
--Dennis
Thanks so much Dennis, I'll give that a go
Regards,
Joan
Dennis,
That was perfect and did exactly what I needed. Thanks so much. I now have 2 zencommand daemons running and no longer have gaps in my command generated graphs.
Regards,
Joan
Follow Us On Twitter »
|
Latest from the Zenoss Blog » | Community | Products | Services Resources | Customers Partners | About Us | ||
Copyright © 2005-2011 Zenoss, Inc.
|
||||||||