cacti icon indicating copy to clipboard operation
cacti copied to clipboard

Polling-serialization by "hostname" field to avoid excessive parallel polling for virtual contexts on the same physical device

Open bernisys opened this issue 4 years ago • 4 comments

Feature Request

Is your feature request related to a problem? Please describe

We have a bunch of devices in our setup which have virtual contexts, and those contexts are all polled via the root device itself, hence all are polled on the same administration IP address but with a different SNMP community.

With the current device queue handling it is most likely that all polls to many contexts are started in parallel, thus putting a huge SNMP load on a single device. Our experience shows that many SNMP implementations are everything else than performant/efficient, which can overload the management CPU board, some devices also have certain features implemented on the CPU instead of using ASICs, which means that polling can harm the device performance. If i remember correctly, this was the case for some routing engines, and also for SSL offloading on certain load balancers.

It seems that this specific use-case is currently not handled in a resource-saving way by the poller process. The poller only has a configuration for the parallel tasks started for the same device ID. In this specific case the same IP is used to poll a lot of (up to 50..100) "devices" (contexts) on the same IP, so it can happen that multiple threads try to connect to the same physical device in the same moment. At some point this ends in timeouts for some of the contexts - i believe it's particularly those which are polled when the SNMP deamon on the device is already trying to answer several other requests. The contexts are still randomly polled correctly due to timing effects, but some of the graphs show lots of gaps.

Describe the solution you'd like

To avoid above scenario, it would be really good if the poller is dividing its initial task list by the "hostname" field and try to put all activities on the same "hostname" into one single thread, so that these kind of queries can be serialized in a better way. If fine-tuning is needed, one can use the threads per device setting, or another nice solution would be to have a setting per poller "threads per physical target" similar to "threads per device" setting, but evaluated across multiple devices with same hostname entry.

bernisys avatar May 20 '21 09:05 bernisys

I can see where you are going with this, but that's actually counter intuitive to what a lot of people want, which is the ability to speed up polling by having multiple threads query a device to retrieve all desired information faster.

So, this sounds like it would need a new field to either flag or handle that, such as a host group.

netniV avatar May 20 '21 10:05 netniV

Hi Mark,

yes, host groups sounds like a really good approach here, so taht you can define which hosts are to be polled separately or which can be processed in parallel.

bernisys avatar May 20 '21 11:05 bernisys

If you want to suggest a simple design, maybe it's another setting to change the sort or something like that. We've got a lot of setting already, but suggest away. Host Groups in Cacti has been something I've wanted to do for over a decade, but we adopted this "Device" moniker and I just can not see calling it "Device Groups". Seriously it triggers me.

TheWitness avatar Jun 25 '21 20:06 TheWitness

Containers would be a good word.

netniV avatar Jul 07 '21 08:07 netniV