[help] a lot of useless SQL before fetch data.

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

Moderators: Developers, Moderators

Post Reply
mjjzr
Posts: 8
Joined: Mon Oct 10, 2005 4:23 am

[help] a lot of useless SQL before fetch data.

Post by mjjzr »

Hi,
I've just noticed my cacti page some times response slow,
and after I turn on the DEBUG log,
I saw a lot of log like below , before the cacti begin fetch data.
almost after 2 minutes , the cacti begin to do some work

Does anyone met the same ? or any clues ?
thanks a lot.

Code: Select all

.....
06/05/2006 06:27:04 PM - CMDPHP: Poller[0] DEBUG: SQL Assoc: "select poller_id,end_time from poller_time where poller_id = 0"
06/05/2006 06:27:04 PM - CMDPHP: Poller[0] DEBUG: SQL 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)"
06/05/2006 06:27:05 PM - CMDPHP: Poller[0] DEBUG: SQL Assoc: "select poller_id,end_time from poller_time where poller_id = 0"
06/05/2006 06:27:05 PM - CMDPHP: Poller[0] DEBUG: SQL 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)"
06/05/2006 06:27:06 PM - CMDPHP: Poller[0] DEBUG: SQL Assoc: "select poller_id,end_time from poller_time where poller_id = 0"
06/05/2006 06:27:06 PM - CMDPHP: Poller[0] DEBUG: SQL 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)"
06/05/2006 06:27:07 PM - CMDPHP: Poller[0] DEBUG: SQL Assoc: "select poller_id,end_time from poller_time where poller_id = 0"
06/05/2006 06:27:07 PM - CMDPHP: Poller[0] DEBUG: SQL 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)"
06/05/2006 06:27:08 PM - CMDPHP: Poller[0] DEBUG: SQL Assoc: "select poller_id,end_time from poller_time where poller_id = 0"
06/05/2006 06:27:08 PM - CMDPHP: Poller[0] DEBUG: SQL 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)"
06/05/2006 06:27:09 PM - CMDPHP: Poller[0] DEBUG: SQL Assoc: "select poller_id,end_time from poller_time where poller_id = 0"
06/05/2006 06:27:09 PM - CMDPHP: Poller[0] DEBUG: SQL 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)"
06/05/2006 06:27:10 PM - CMDPHP: Poller[0] DEBUG: SQL Assoc: "select poller_id,end_time from poller_time where poller_id = 0"
.....
and almost after 2 minutes , the cacti begin to do some work

Code: Select all

06/05/2006 05:57:59 PM - CMDPHP: Poller[0] DEBUG: SQL Assoc: "select poller_id,end_time from poller_time where poller_id = 0"
06/05/2006 05:57:59 PM - CMDPHP: Poller[0] DEBUG: SQL 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)"
06/05/2006 05:58:00 PM - CMDPHP: Poller[0] Host[0] DS[1701] WARNING: Result from CMD not valid.  Partial Result:
06/05/2006 05:58:00 PM - CMDPHP: Poller[0] Host[0] DS[1701] CMD: perl /var/www/html/cacti-0.8.6h/scripts/weather.pl, output: U
06/05/2006 05:58:00 PM - CMDPHP: Poller[0] DEBUG: SQL Exec: "insert into poller_output (local_data_id,rrd_name,time,output) values (1701,'','2006-06-05 17:55:00','U')"
06/05/2006 05:58:00 PM - CMDPHP: Poller[0] Host[1] SNMP: Device does not require SNMP
06/05/2006 05:58:00 PM - CMDPHP: Poller[0] DEBUG: SQL Exec: "update host set  status = '3',  status_event_count = '0',  status_fail_date = '0000-00-00 00:00:00',  status_rec_date = '0000-00-00 00:00:00',  status_last_error = '',  min_time = '0.00000',  max_time = '0.00000',  cur_time = '0',  avg_time = '0',  total_polls = '27062',  failed_polls = '0',  availability = '100'  where hostname = '127.0.0.1'"
06/05/2006 05:58:00 PM - CMDPHP: Poller[0] Host[1] No host availability check possible for '127.0.0.1'.
06/05/2006 05:58:00 PM - CMDPHP: Poller[0] DEBUG: SQL Assoc: "select     poller_reindex.data_query_id,     poller_reindex.action,     poller_reindex.op,     poller_reindex.assert_value,     poller_reindex.arg1     from poller_reindex     where poller_reindex.host_id=1"
06/05/2006 05:58:00 PM - CMDPHP: Poller[0] Host[1] DS[3] CMD: /usr/bin/perl /var/www/html/cacti-0.8.6h/scripts/linux_memory.pl MemFree:, output: 896624

User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

Is your cacti fully patched? And please grep for SYSTEM STATS in ./log/cacti.log and post this
Reinhard
mjjzr
Posts: 8
Joined: Mon Oct 10, 2005 4:23 am

Post by mjjzr »

lvm wrote:Is your cacti fully patched? And please grep for SYSTEM STATS in ./log/cacti.log and post this
Reinhard
yes, I apply all the patches,
and below is the "SYSTEM STATS"
normally, all my jobs should be finished in 20Secs, but when I enable one of my Data Sources : weather. the jobs finish time will be 200Secs.
but how could an data source cause the system slow down so much.
when I run the script "weather.pl" manually (which is just fetch 40 Characters from a web site, )it's only take 3~4 secs.

Code: Select all

hreads:N/A Hosts:68 HostsPerProcess:68 DataSources:1811 RRDsProcessed:1427
06/06/2006 10:30:18 AM - SYSTEM STATS: Time:17.9712 Method:cmd.php Processes:1 Threads:N/A Hosts:68 HostsPerProcess:68 DataSources:1811 RRDsProcessed:1408
06/06/2006 10:35:12 AM - SYSTEM STATS: Time:11.9943 Method:cmd.php Processes:1 Threads:N/A Hosts:68 HostsPerProcess:68 DataSources:1811 RRDsProcessed:1408
06/06/2006 10:43:39 AM - SYSTEM STATS: Time:218.6806 Method:cmd.php Processes:1 Threads:N/A Hosts:68 HostsPerProcess:68 DataSources:1812 RRDsProcessed:1428
06/06/2006 10:48:26 AM - SYSTEM STATS: Time:205.8018 Method:cmd.php Processes:1 Threads:N/A Hosts:68 HostsPerProcess:68 DataSources:1812 RRDsProcessed:1428
06/06/2006 10:53:30 AM - SYSTEM STATS: Time:209.9076 Method:cmd.php Processes:1 Threads:N/A Hosts:68 HostsPerProcess:68 DataSources:1812 RRDsProcessed:1428
06/06/2006 10:58:36 AM - SYSTEM STATS: Time:214.8761 Method:cmd.php Processes:1 Threads:N/A Hosts:68 HostsPerProcess:68 DataSources:1812 RRDsProcessed:1428
06/06/2006 11:03:22 AM - SYSTEM STATS: Time:201.8803 Method:cmd.php Processes:1 Threads:N/A Hosts:68 HostsPerProcess:68 DataSources:1812 RRDsProcessed:1428
06/06/2006 11:08:12 AM - SYSTEM STATS: Time:191.8095 Method:cmd.php Processes:1 Threads:N/A Hosts:68 HostsPerProcess:68 DataSources:1812 RRDsProcessed:1428
06/06/2006 11:13:10 AM - SYSTEM STATS: Time:189.6923 Method:cmd.php Processes:1 Threads:N/A Hosts:68 HostsPerProcess:68 DataSources:1812 RRDsProcessed:1427
06/06/2006 11:15:11 AM - SYSTEM STATS: Time:10.9217 Method:cmd.php Processes:1 Threads:N/A Hosts:68 HostsPerProcess:68 DataSources:1811 RRDsProcessed:1427
06/06/2006 11:20:10 AM - SYSTEM STATS: Time:9.9562 Method:cmd.php Processes:1 Threads:N/A Hosts:68 HostsPerProcess:68 DataSources:1811 RRDsProcessed:1427

User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

Is this script requesting a remote site? How long does it take to establish a new connection (if none is currently established, e.g. dial-up/ADSL connect, ...).
Reinhard
mjjzr
Posts: 8
Joined: Mon Oct 10, 2005 4:23 am

Post by mjjzr »

lvm wrote:Is this script requesting a remote site? How long does it take to establish a new connection (if none is currently established, e.g. dial-up/ADSL connect, ...).
Reinhard
Hi lvm
Yes, just as you said,it's my script's problem. the script can't running properly in background. after modify the scripts, everything looks ok.
thanks for your help.

Br
Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests