Discussion:
[rancid] High cpu on large configs
nachofw
2016-03-24 14:58:13 UTC
Permalink
Hi, some of the devices i backup contain more than 10k config lines, specifically a cisco asa. This causes high cpu when a backup is done. How can i set a "sleep 1" in the clogin script so that when the line "<--- More --->" gets hit it whaits 1 second before continuing.
Alex DEKKER
2016-03-24 15:06:03 UTC
Permalink
Post by nachofw
Hi, some of the devices i backup contain more than 10k config lines,
specifically a cisco asa. This causes high cpu when a backup is done.
How can i set a "sleep 1" in the clogin script so that when the line
"<--- More --->" gets hit it whaits 1 second before continuing.
I doubt that RANCID ever "sees" the pager lines. It almost certainly
sets the terminal length so that the config is never split into pages.

alexd
heasley
2016-03-24 15:39:43 UTC
Permalink
Post by Alex DEKKER
Post by nachofw
Hi, some of the devices i backup contain more than 10k config lines,
specifically a cisco asa. This causes high cpu when a backup is done.
How can i set a "sleep 1" in the clogin script so that when the line
"<--- More --->" gets hit it whaits 1 second before continuing.
I doubt that RANCID ever "sees" the pager lines. It almost certainly
sets the terminal length so that the config is never split into pages.
if the device supports that, yes.

you'd probably be better to set send_human parameters to something slow.
Lee
2016-03-24 16:19:53 UTC
Permalink
Post by heasley
Post by Alex DEKKER
Post by nachofw
Hi, some of the devices i backup contain more than 10k config lines,
specifically a cisco asa. This causes high cpu when a backup is done.
How can i set a "sleep 1" in the clogin script so that when the line
"<--- More --->" gets hit it whaits 1 second before continuing.
I doubt that RANCID ever "sees" the pager lines. It almost certainly
sets the terminal length so that the config is never split into pages.
if the device supports that, yes.
You might want to consider adding a
terminal pager 0
to clogin in addition to the 'term len 0' to disable the pager on ASAs

Lee
Lee
2016-03-24 16:14:15 UTC
Permalink
Post by nachofw
Hi, some of the devices i backup contain more than 10k config lines,
specifically a cisco asa. This causes high cpu when a backup is done. How
can i set a "sleep 1" in the clogin script so that when the line "<--- More
--->" gets hit it whaits 1 second before continuing.
Depends on which version of rancid you have. For 3.4.1 you'd edit
lib/rancid/ios.pm to add the sleep calls or whatever inside the
appropriate
if (/^(<-+ More -+>)/) {
...
}
block.

Regards,
Lee
nachofw
2016-03-28 18:10:16 UTC
Permalink
Thanks for the input.I ended up taking advantage of the fact that asa doesn't support 'terminal length'and 'terminal width'. And changed the file lee mentioned:-> /usr/share/perl5/rancid/ios.pm        # the pager can not be disabled per-session on the PIX        if (/^(<-+ More -+>)/) {            my($len) = length($1);            s/^$1s{$len}//;+            select(undef, undef, undef, 0.15);        }
I cant use the 'terminal pager 0' because that displays all the config in one shot and causes the cpu to spike to 97%, i needed for rancid to use the ---more--- feature when displaying the config.Again thanks to all-------- Mensaje original --------De: nachofw <***@adinet.com.uy> Fecha: 24/03/2016 11:58 AM (GMT-03:00) Para: rancid-***@shrubbery.net, ***@shrubbery.net Asunto: High cpu on large configs
Hi, some of the devices i backup contain more than 10k config lines, specifically a cisco asa. This causes high cpu when a backup is done. How can i set a "sleep 1" in the clogin script so that when the line "<--- More --->" gets hit it whaits 1 second before continuing.
heasley
2016-03-29 12:46:15 UTC
Permalink
Thanks for the input.I ended up taking advantage of the fact that asa doesn't support 'terminal length'and 'terminal width'. And changed the file lee mentioned:-> /usr/share/perl5/rancid/ios.pm        # the pager can not be disabled per-session on the PIX        if (/^(<-+ More -+>)/) {            my($len) = length($1);            s/^$1s{$len}//;+            select(undef, undef, undef, 0.15);        }
I cant use the 'terminal pager 0' because that displays all the config in one shot and causes the cpu to spike to 97%, i needed for rancid to use the ---more--- feature when displaying the config.Again thanks to all--------
Why is it an issue if the cpu jumps for 97%? So what. It is temporary and
the scheduler should prioritize processes appropriately.
nachofw
2016-03-29 13:23:56 UTC
Permalink
It is very inconvinient for my scenario, high cpu causes alerts on the monitoring systems creating false positive alerts. Also on other platforms causes packet loss por example cisco 3k series with large configs
Post by nachofw
Thanks for the input.I ended up taking advantage of the fact that asa doesn't support 'terminal length'and 'terminal width'. And changed the file lee mentioned:-> /usr/share/perl5/rancid/ios.pm        # the pager can not be disabled per-session on the PIX        if (/^(<-+ More -+>)/) {            my($len) = length($1);            s/^$1s{$len}//;+            select(undef, undef, undef, 0.15);        }
I cant use the 'terminal pager 0' because that displays all the config in one shot and causes the cpu to spike to 97%, i needed for rancid to use the ---more--- feature when displaying the config.Again thanks to all--------
Why is it an issue if the cpu jumps for 97%?  So what.  It is temporary and
the scheduler should prioritize processes appropriately.
Nicolai Langfeldt
2016-03-29 13:38:58 UTC
Permalink
Post by nachofw
It is very inconvinient for my scenario, high cpu causes alerts on the
monitoring systems creating false positive alerts. Also on other
platforms causes packet loss por example cisco 3k series with large configs
Then I guess you can't use rancid on those systems. The whole point is
to generate text configs.

Loading Image...

Nicolai
heasley
2016-03-29 13:41:38 UTC
Permalink
Post by nachofw
It is very inconvinient for my scenario, high cpu causes alerts on the monitoring systems creating false positive alerts. Also on other platforms causes packet loss por example cisco 3k series with large configs
the scheduler should not allow it to cause packet loss. you should open a
TAC case.

as for monitoring; i would alert on high cpu over a 5 minute or longer
interval, not a single poll.
f***@iname.com
2016-04-01 01:05:46 UTC
Permalink
What about copying the configuration file over instead, and processing that?



Frank



From: Rancid-discuss [mailto:rancid-discuss-***@shrubbery.net] On Behalf Of nachofw
Sent: Tuesday, March 29, 2016 8:24 AM
To: heasley <***@shrubbery.net>
Cc: rancid-***@shrubbery.net
Subject: Re: [rancid] High cpu on large configs



It is very inconvinient for my scenario, high cpu causes alerts on the monitoring systems creating false positive alerts. Also on other platforms causes packet loss por example cisco 3k series with large configs







Enviado desde mi smartphone Samsung Galaxy.

-------- Mensaje original --------

De: heasley <***@shrubbery.net <mailto:***@shrubbery.net> >

Fecha: 29/03/2016 9:46 AM (GMT-03:00)

Para: nachofw <***@adinet.com.uy <mailto:***@adinet.com.uy> >

Cc: rancid-***@shrubbery.net <mailto:rancid-***@shrubbery.net>

Asunto: Re: High cpu on large configs
Thanks for the input.I ended up taking advantage of the fact that asa doesn't support 'terminal length'and 'terminal width'. And changed the file lee mentioned:-> /usr/share/perl5/rancid/ios.pm # the pager can not be disabled per-session on the PIX if (/^(<-+ More -+>)/) { my($len) = length($1); s/^$1s{$len}//;+ select(undef, undef, undef, 0.15); }
I cant use the 'terminal pager 0' because that displays all the config in one shot and causes the cpu to spike to 97%, i needed for rancid to use the ---more--- feature when displaying the config.Again thanks to all--------
Why is it an issue if the cpu jumps for 97%? So what. It is temporary and
the scheduler should prioritize processes appropriately.

nachofw
2016-03-29 13:55:33 UTC
Permalink
But i do use it succesfully, read the previous mail where i set a 150 millisecond sleep to avoid the high cpu. Its working just fine now
Post by nachofw
It is very inconvinient for my scenario, high cpu causes alerts on the
monitoring systems creating false positive alerts. Also on other
platforms causes packet loss por example cisco 3k series with large configs
Then I guess you can't use rancid on those systems.  The whole point is
to generate text configs.

http://www.gdargaud.net/Humor/Pics/DilbertNickel.gif

Nicolai
nachofw
2016-03-29 13:58:30 UTC
Permalink
Thanks heasley i will check on the polling advice, as for TAC unfortunately my company doesnt have the budget for that.
Post by nachofw
It is very inconvinient for my scenario, high cpu causes alerts on the monitoring systems creating false positive alerts. Also on other platforms causes packet loss por example cisco 3k series with large configs
the scheduler should not allow it to cause packet loss.  you should open a
TAC case.

as for monitoring; i would alert on high cpu over a 5 minute or longer
interval, not a single poll.
Loading...