junos_exporter icon indicating copy to clipboard operation
junos_exporter copied to clipboard

High CPU usage on the switches when using the exporter

Open ademenfis opened this issue 2 years ago • 2 comments

Hi, I'm trying to use the exporter but I see the CPUs are spiking up when the scrape is happening.

Screenshot 2022-12-08 at 11 23 33

This shows the cpu usage since the target was added in week 39 has increased exponentially. I don't see anything particular in the switches logs.

Am I missing something? Should I enable some sort of caching in junos?

Thank you and sorry if this is not the right place to ask

ademenfis avatar Dec 08 '22 10:12 ademenfis

Unfortunately this just happens and afaik cannot be avoided. Due to the nature of the exporter having to run multiple cli commands that, depending on hardware model, can cause a lot of cpu use. This should however not have a high impact, if any at all, for the performance of the device since the CPU usage is for the control plane only. Do fewer scrapes if a constant high cpu use is of concern to you.

4xoc avatar Jan 12 '23 10:01 4xoc

considering the stated goal in the readme this is really baffling me:

The set of metrics is minimal to increase performance. We (a few friends from the Freifunk community and myself) used the generic snmp_exporter before. Since snmp_exporter is highly generic it comes with a lot of complexity at the cost of performance. We wanted to have an KIS and vendor specific exporter instead. This approach should allow us to scrape our metrics in a very time efficient way.

which performance is this supposed to increase?

i can see the configuration being much simpler and it being more flexible in the data available via CLI/RPC compared to what is available via snmp, as SNMP imposes some limitations e.g. in cluster scenarios, but the performance seems to be significantly worse, especially without using netconf (#190)

Nothing4You avatar Jun 10 '23 20:06 Nothing4You