I have a heck of a lot of circuits that I graph with cacti. Basicly it's gotten to the point to where I'm having to use a 3gHz with 2gig ram to keep up with the process load. But, I've discovered what's causing my graphs to be "skippy".
During peak traffic times, I notice that one instance of cmd.php is still running waiting to finish up while it's time for a new one to start again... Basicly, it's taking longer than 5 minutes to finish cmd.php.
I have a couple of solutions in mind, and am wondering if anyone else has any others.
One would be to separate my circuits into 2 different cacti servers, thus cutting in half the amount of time cmd.php would have to run on 2 servers.
The other would be to do similar as above, but keep the 2 instances of cacti running on the same machine, just in different databases and directories.
Any better solutions?
More data processes that cacti can get back in time.
Moderators: Developers, Moderators
You can try to play with SNMP timeouts (discussed a bit here: http://www.raxnet.net/board/viewtopic.php?t=1517). Spliting the work on two or more cmd.php is a good direction. You just need to filter data sources per each cmd.php in sql query (line 29). You can also try forked cmd.php solution described here: http://www.raxnet.net/board/viewtopic.php?t=349
- bulek
- bulek
-
- Posts: 3
- Joined: Tue Apr 01, 2003 3:32 pm
I tried to follow this suggestion, but all my data sources are still being updated. I changed mysql_query from this:bulek wrote: Spliting the work on two or more cmd.php is a good direction. You just need to filter data sources per each cmd.php in sql query (line 29).
$sql_id = mysql_query("select d.id, d.name, d.srcid,
s.formatstrin, s.formatstrout, s.id as sid, s.type
from rrd_ds d
left join src s
on d.srcid=s.id
where d.active="on"
and d.subdsid=0",$cnn_id);
to this:
$sql_id = mysql_query("select d.id, d.name, d.srcid,
s.formatstrin, s.formatstrout, s.id as sid, s.type
from rrd_ds d
left join src s
on d.srcid=s.id
where d.active="on"
and d.subdsid=0 and d.name like "$device%" ",$cnn_id);
Then I edited my crontab entry to this:
0-59/5 * * * * root php /var/www/html/cacti/cmd.php device=system > /dev/null 2>&1
Any ideas what else might need to be changed?
John Donaldson
You can't pass variables like that to php scripts. I propose you to make several copies of cmd.php with different names like cmd-system.php, cmd-routers.php, cmd-servers.php, etc. Then at the beginning of each of them just define $device variable with proper value.0-59/5 * * * * root php /var/www/html/cacti/cmd.php device=system > /dev/null 2>&1
If you wan't to stay with your solution then you need to run it like this: "...../cmd.php system > /dev....". Then add the following line at the begining of cmd.php: $device=$argv[1];
- bulek
-
- Posts: 3
- Joined: Tue Apr 01, 2003 3:32 pm
I found that out last night. I have already made that change and it is now working.bulek wrote: If you wan't to stay with your solution then you need to run it like this: "...../cmd.php system > /dev....". Then add the following line at the begining of cmd.php: $device=$argv[1];
- bulek
Thanks
John Donaldson
Who is online
Users browsing this forum: No registered users and 3 guests