cacti 0.8.6 problems, Allowed memory size of ...

Post general support questions here that do not specifically fall into the Linux or Windows categories.

Moderators: Developers, Moderators

Post Reply
radek_spam
Posts: 4
Joined: Thu Sep 16, 2004 8:39 am

cacti 0.8.6 problems, Allowed memory size of ...

Post by radek_spam »

Hello,

just upgraded cacti 0.8.5a to 0.8.6 .. but problems shows

date was gathered with cactid,
after debuging cacti.log i know that data is gathered and stored into mysql
09/16/2004 02:46:23 PM - CACTID: Poller[0] DEBUG: SQLCMD: insert into poller_output (local_data_id,rrd_name,time,output) values (50,'5min_used_mem',NOW(),'41310348')
but .. part of poll.php didn't finish

after some more debuging i discovered that problem was in line

Code: Select all

process_poller_output($rrdtool_pipe);
after that i go to lib/poller.php and do more debug
$results = db_fetch_assoc("select
poller_output.output,
poller_output.time,
poller_output.local_data_id,
poller_item.rrd_path,
poller_item.rrd_name,
poller_item.rrd_num
from poller_output,poller_item
where (poller_output.local_data_id=poller_item.local_data_id and poller_output.rrd_name=poller_item.rrd_name)");
in mysql this sql returned about 191000 rows .. nice

in lib/database.php is function db_fetch_assoc, i make litte modification

Code: Select all

$cnt = 0;
	if ($query) {
		while ((!$query->EOF) && ($query)) {
			$data{sizeof($data)} = $query->fields;
			$query->MoveNext();
			$cnt++;
			echo "c: $cnt\n";
		}
		return($data);
	}
and .. finaly
c: 25498
c: 25499
c: 25500
c: 25501
c: 25502
c: 25503
c: 25504
c: 25505
c: 25506
c: 25507
c: 25508
c: 25509
c: 25510
PHP Fatal error: Allowed memory size of 18874368 bytes exhausted (tried to allocate 12 bytes) in /var/www/cacti086/lib/adodb/drivers/adodb-mysql.inc.php on line 599

Fatal error: Allowed memory size of 18874368 bytes exhausted (tried to allocate 12 bytes) in /var/www/cacti086/lib/adodb/drivers/adodb-mysql.inc.php on line 599
i think solution will be not to get all data to one variable and then proces it with foreach() function, but first get number of rows and then proces each row one by one.
what amount of memory i have to allocate for 200 000 rows

any other solutions? maybe small fix in 0.8.6a ? :-)

edit: sorry for my bad engish
User avatar
TheWitness
Developer
Posts: 17007
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Post by TheWitness »

radek_spam,

The first thing you need to do is truncate the poller_output table to remove the huge number of entries. Then, follow the link below to make a small patch (It's temporary) to make the poller work corectly.

To truncate the table you need to do the following:

mysql --user=root --password cacti
> truncate table poller_output;
> exit

http://forums.cacti.net/viewtopic.php?t=4801
True understanding begins only when we realize how little we truly understand...

Life is an adventure, let yours begin with Cacti!

Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages


For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests