Command line tools (cacti 0.8.7a) horribly slow.Problem back
Moderators: Developers, Moderators
Command line tools (cacti 0.8.7a) horribly slow.Problem back
I have following Problem.
At the beginning CLI (command line tools) were really fast, almost the same as Cacti GUI.
But now they are horribly slow. Sometimes it takes 10 minutes to create 1 Graph with CLI where the same Graph creation takes 10 seconds in Cacti GUI.
Anybody has the same Problems ? Any ideas ?
update, just for info:
select count(*) from data_template_rrd ----------142248
select count(*) from graph_templates_graph --- 16117
select count(*) from graph_templates_item ----- 161205
At the beginning CLI (command line tools) were really fast, almost the same as Cacti GUI.
But now they are horribly slow. Sometimes it takes 10 minutes to create 1 Graph with CLI where the same Graph creation takes 10 seconds in Cacti GUI.
Anybody has the same Problems ? Any ideas ?
update, just for info:
select count(*) from data_template_rrd ----------142248
select count(*) from graph_templates_graph --- 16117
select count(*) from graph_templates_item ----- 161205
Last edited by _Dmitry_ on Tue Feb 12, 2008 8:21 am, edited 2 times in total.
- fmangeant
- Cacti Guru User
- Posts: 2345
- Joined: Fri Sep 19, 2003 8:36 am
- Location: Sophia-Antipolis, France
- Contact:
Reinhard,
maybe a patch for 0.8.7a could be issued for these new indexes ?
What do you think of it ?
maybe a patch for 0.8.7a could be issued for these new indexes ?
What do you think of it ?
[size=84]
[color=green]HOWTOs[/color] :
[list][*][url=http://forums.cacti.net/viewtopic.php?t=15353]Install and configure the Net-SNMP agent for Unix[/url]
[*][url=http://forums.cacti.net/viewtopic.php?t=26151]Install and configure the Net-SNMP agent for Windows[/url]
[*][url=http://forums.cacti.net/viewtopic.php?t=28175]Graph multiple servers using an SNMP proxy[/url][/list]
[color=green]Templates[/color] :
[list][*][url=http://forums.cacti.net/viewtopic.php?t=15412]Multiple CPU usage for Linux[/url]
[*][url=http://forums.cacti.net/viewtopic.php?p=125152]Memory & swap usage for Unix[/url][/list][/size]
[color=green]HOWTOs[/color] :
[list][*][url=http://forums.cacti.net/viewtopic.php?t=15353]Install and configure the Net-SNMP agent for Unix[/url]
[*][url=http://forums.cacti.net/viewtopic.php?t=26151]Install and configure the Net-SNMP agent for Windows[/url]
[*][url=http://forums.cacti.net/viewtopic.php?t=28175]Graph multiple servers using an SNMP proxy[/url][/list]
[color=green]Templates[/color] :
[list][*][url=http://forums.cacti.net/viewtopic.php?t=15412]Multiple CPU usage for Linux[/url]
[*][url=http://forums.cacti.net/viewtopic.php?p=125152]Memory & swap usage for Unix[/url][/list][/size]
I'll add today arround 300 hosts with plenty of graphs. After this I'll attach slow_queries report here.gandalf wrote:That's still too slow. I will have to perform some debugging on our prod installation. But this is still 086-type. If you are familiar with mysql slow_queries option, it would be nice if you can post those results related to cli scrupt add_hosts.php.
Reinhard
You mean add_device.php and not add_hosts,php, right ?
To create all new Hosts with all Graphs I create first device with add_device.php and then each graph with add_graph.php.
Can I create Host with all Graphs only with add_device.php ?
Problem is back again. I've had 0.8.7 before and now 0.8.7a.
I've checked all additional indexes, all exist.
During Graphs creation I can see following Errors in cacti.log
02/12/2008 02:14:27 PM - CMDPHP: Poller[0] ERROR: SQL Cell Failed!, Error:'1064', SQL:"SELECT DISTINCT data_template_rrd.local_data_id FROM graph_templates_item, data_template_rrd WHERE graph_templates_item.local_graph_id = AND graph_templates_item.task_item_id = data_template_rrd.id"
Here is mysql_slow_queries:
I've checked all additional indexes, all exist.
During Graphs creation I can see following Errors in cacti.log
02/12/2008 02:14:27 PM - CMDPHP: Poller[0] ERROR: SQL Cell Failed!, Error:'1064', SQL:"SELECT DISTINCT data_template_rrd.local_data_id FROM graph_templates_item, data_template_rrd WHERE graph_templates_item.local_graph_id = AND graph_templates_item.task_item_id = data_template_rrd.id"
Here is mysql_slow_queries:
Code: Select all
# Time: 080212 14:11:56
# User@Host: cactiuser @ localhost []
# Query_time: 50 Lock_time: 0 Rows_sent: 0 Rows_examined: 4887200
SELECT DISTINCT data_input_fields.data_name AS `name`, data_input_fields.name AS `description`, data_input_data.value AS `default`, data_template_data.data_template_id, data_input_fields.id AS `data_input_field_id` FROM data_input_data INNER JOIN (((data_template_rrd INNER JOIN (graph_templates INNER JOIN graph_templates_item ON graph_templates.id = graph_templates_item.graph_template_id) ON data_template_rrd.id = graph_templates_item.task_item_id) INNER JOIN data_template_data ON data_template_rrd.data_template_id=data_template_data.data_template_id) INNER JOIN data_input_fields ON data_template_data.data_input_id=data_input_fields.data_input_id) ON (data_input_data.data_template_data_id = data_template_data.id) AND (data_input_data.data_input_field_id = data_input_fields.id) WHERE (((graph_templates.id)=35) AND ((data_input_data.t_value)='on') AND ((data_input_fields.input_output)='in'));
# Time: 080212 14:12:42
# User@Host: cactiuser @ localhost []
# Query_time: 45 Lock_time: 0 Rows_sent: 0 Rows_examined: 4887200
SELECT DISTINCT data_input_fields.data_name AS `name`, data_input_fields.name AS `description`, data_input_data.value AS `default`, data_template_data.data_template_id, data_input_fields.id AS `data_input_field_id` FROM data_input_data INNER JOIN (((data_template_rrd INNER JOIN (graph_templates INNER JOIN graph_templates_item ON graph_templates.id = graph_templates_item.graph_template_id) ON data_template_rrd.id = graph_templates_item.task_item_id) INNER JOIN data_template_data ON data_template_rrd.data_template_id=data_template_data.data_template_id) INNER JOIN data_input_fields ON data_template_data.data_input_id=data_input_fields.data_input_id) ON (data_input_data.data_template_data_id = data_template_data.id) AND (data_input_data.data_input_field_id = data_input_fields.id) WHERE (((graph_templates.id)=37) AND ((data_input_data.t_value)='on') AND ((data_input_fields.input_output)='in'));
- gandalf
- Developer
- Posts: 22383
- Joined: Thu Dec 02, 2004 2:46 am
- Location: Muenster, Germany
- Contact:
You will hate me. But 087a still does not have those indices. We've just release 087b including an upgrade script creating those indices. But if you UPGRADED to 087a (NOT newly installed), the index will still be there as you've added them manually._Dmitry_ wrote:Problem is back again. I've had 0.8.7 before and now 0.8.7a.
Thank you for posting the slow query stuff.
This weekend, I've spent some time on add_device.php to make it faster. But unfortunalety, all my tests on a DB of about 60 MB size did not take longer than a few seconds for 10 hosts.
It will take 'til weekend to find time to examine it in more detail.
Reinhard
Yes. That's the point. I've upgraded CACTI. And then checked again this Indexes.gandalf wrote:You will hate me. But 087a still does not have those indices. We've just release 087b including an upgrade script creating those indices. But if you UPGRADED to 087a (NOT newly installed), the index will still be there as you've added them manually._Dmitry_ wrote:Problem is back again. I've had 0.8.7 before and now 0.8.7a.
Maybe you misunderstood me. Main bottleneck is add_graph.php.Thank you for posting the slow query stuff.
This weekend, I've spent some time on add_device.php to make it faster. But unfortunalety, all my tests on a DB of about 60 MB size did not take longer than a few seconds for 10 hosts.
It will take 'til weekend to find time to examine it in more detail.
Reinhard
I can add new Host with add_device.php, this takes 1 or less second. But add_device.php doesn't activate all graphs. I am getting new Host in Cacti but with all Graphs disabled.
After that I am calling add_graph.php for each graph I want to activate for this host.
And this step takes longer,10-50 seconds for each Graph.
- TheWitness
- Developer
- Posts: 17007
- Joined: Tue May 14, 2002 5:08 pm
- Location: MI, USA
- Contact:
Execute the following:
See if it has a positive impact. If you are concerned about the change of type for "value" to varchar, execute the following:
If running MySQL 5.0.x, you can change the width to much more than 255.
TheWitness
Code: Select all
ALTER TABLE `data_input_fields` ADD INDEX `input_output`(`input_output`)
Code: Select all
ALTER TABLE `data_input_data` ADD INDEX `t_value`(`t_value`)
Code: Select all
ALTER TABLE `data_input_fields` ADD INDEX `data_name`(`data_name`)
Code: Select all
ALTER TABLE `data_input_data` MODIFY COLUMN `value` VARCHAR(255) DEFAULT NULL, ADD INDEX `value`(`value`)
Code: Select all
select max(length(value)) from data_input_data
TheWitness
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?
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?
nope. Graph creation time for 1 Graph is the same ~ 30-50 sec.TheWitness wrote:Execute the following:
Code: Select all
ALTER TABLE `data_input_fields` ADD INDEX `input_output`(`input_output`)
Code: Select all
ALTER TABLE `data_input_data` ADD INDEX `t_value`(`t_value`)
Code: Select all
ALTER TABLE `data_input_fields` ADD INDEX `data_name`(`data_name`)
See if it has a positive impact. If you are concerned about the change of type for "value" to varchar, execute the following:Code: Select all
ALTER TABLE `data_input_data` MODIFY COLUMN `value` VARCHAR(255) DEFAULT NULL, ADD INDEX `value`(`value`)
If running MySQL 5.0.x, you can change the width to much more than 255.Code: Select all
select max(length(value)) from data_input_data
TheWitness
Adding test (test.xxxxxxxxx.net) as "xxxxxxxxxxxxxxx" using SNMP v2 with community ""
Success - new device-id: (xxxx)
Device.creation time: 1 sec
php add_graphs.php --graph-type=cg --graph-template-id=xx --host-id=xxxx
Graph Added - graph-id: (xxxxx) - data-source-id: (xxxxx)
Gr.creation time: 53 sec
Code: Select all
02/13/2008 08:44:59 AM - CMDPHP: Poller[0] ERROR: SQL Cell Failed!, Error:'1064', SQL:"SELECT DISTINCT data_template_rrd.local_data_id FROM graph_templates_item, data_template_rrd WHERE graph_templates_item.local_graph_id = AND graph_templates_item.task_item_id = data_template_rrd.id"
Code: Select all
# Time: 080213 8:44:59
# User@Host: cactiuser @ localhost []
# Query_time: 52 Lock_time: 0 Rows_sent: 0 Rows_examined: 7257000
SELECT DISTINCT data_input_fields.data_name AS `name`, data_input_fields.name AS `description`, data_input_data.value AS `default`, data_template_data.data_template_id, data_input_fields.id AS `data_input_field_id` FROM data_input_data INNER JOIN (((data_template_rrd INNER JOIN (graph_templates INNER JOIN graph_templates_item ON graph_templates.id = graph_templates_item.graph_template_id) ON data_template_rrd.id = graph_templates_item.task_item_id) INNER JOIN data_template_data ON data_template_rrd.data_template_id=data_template_data.data_template_id) INNER JOIN data_input_fields ON data_template_data.data_input_id=data_input_fields.data_input_id) ON (data_input_data.data_template_data_id = data_template_data.id) AND (data_input_data.data_input_field_id = data_input_fields.id) WHERE (((graph_templates.id)=35) AND ((data_input_data.t_value)='on') AND ((data_input_fields.input_output)='in'));
- TheWitness
- Developer
- Posts: 17007
- Joined: Tue May 14, 2002 5:08 pm
- Location: MI, USA
- Contact:
Well,
As you indicate, this is a problem:
TheWitness
As you indicate, this is a problem:
What does your add_graph.php statement look like? Please attach your template XML.02/13/2008 08:44:59 AM - CMDPHP: Poller[0] ERROR: SQL Cell Failed!, Error:'1064', SQL:"SELECT DISTINCT data_template_rrd.local_data_id FROM graph_templates_item, data_template_rrd WHERE graph_templates_item.local_graph_id = AND graph_templates_item.task_item_id = data_template_rrd.id"
TheWitness
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?
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?
php add_graphs.php --graph-type=cg --graph-template-id=xx --host-id=xxxxTheWitness wrote:Well,
As you indicate, this is a problem:
What does your add_graph.php statement look like?02/13/2008 08:44:59 AM - CMDPHP: Poller[0] ERROR: SQL Cell Failed!, Error:'1064', SQL:"SELECT DISTINCT data_template_rrd.local_data_id FROM graph_templates_item, data_template_rrd WHERE graph_templates_item.local_graph_id = AND graph_templates_item.task_item_id = data_template_rrd.id"
In attachment you can find template XML for 1 of the graphs. (All Datasources are with Data Input Method set to "none". All RRD's for this Graph are updated via external interface.)Please attach your template XML.
TheWitness
Maybe the Problem is my Pooling Interval ? I have 20 seconds.
Probably Pooler(spine) blocks something and add_graph need this ?
- Attachments
-
- cacti_graph_template_mss_-_cpu0_utilization.xml
- (18.88 KiB) Downloaded 243 times
Who is online
Users browsing this forum: No registered users and 0 guests