Im adding the devices with a perl script and use as api the cli from cacti.
My problem is that i get extremely long query times after adding the devices.
After 18 Devices the Query time of this query takes 8 seconds!
The ENV:
8 GB RAM 2x CPUs @3 GHZ
Raid 5
Memory limit 1GB in php.ini and config files (changed in the second try after deleting the Database)
Can anybody give me a hint?
This was the worst query i ever got.
EDIT1:/usr/libexec/mysqld, Version: 4.1.20-log. started with:
Tcp port: 3306 Unix socket: /var/lib/mysql/mysql.sock
Time Id Command Argument
# Time: 081217 9:10:21
# User@Host: root[root] @ localhost
# Query_time: 54 Lock_time: 0 Rows_sent: 3 Rows_examined: 7360371
use cacti;
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)=26) AND ((data_input_data.t_value)='on') AND ((data_input_fields.input_output)='in')) LIMIT 0, 30;
The query comes from lib/api_automation_tools.php
from the function getInputFields(){}
And only if the graphTemplateID=26
7489e44466abee8a7d8636cb2cb14a1a ucd 90 Filesystems
There must be something wrong
EDIT2:
Update to Mysql 5.1 with new intallation of cacti.db brought no success.
EDIT3:
This result is funny.
State Duration
starting 0.000077
Opening tables 0.000236
System lock 0.000007
Table lock 0.000014
init 0.000014
optimizing 0.000008
statistics 0.000015
preparing 0.000013
executing 0.000250
Sending data 0.000044
end 0.000007
query end 0.000006
freeing items 0.000018
removing tmp table 0.000053
closing tables 0.000010
logging slow query 0.000006
cleaning up 0.000006
Zeige Datensätze 0 - 2 (3 insgesamt, die Abfrage dauerte 59.7280 sek.)
Why does it takes 59 sec and the tasks takes only a part of it?