cpu overload (1 reply)

Hello,

firstly, i am sorry for my english !

I have a cpu overload during 20 secondes each minute !

I activate the slow-log option, but the result is not interesting :

# Time: 080805 9:53:45

# User@Host: xls_user[xls_user] @ localhost []

# Query_time: 0 Lock_time: 0 Rows_sent: 21 Rows_examined: 21

here is my configuration file :

# * Fine Tuning

#

key_buffer = 148M

max_allowed_packet = 16M

thread_stack = 128K

thread_cache_size = 90

table_cache = 1500

max_heap_table_size = 128M

max_tmp_tables = 64

sort_buffer_size = 6M

myisam_sort_buffer_size = 64M

read_rnd_buffer_size = 2M

join_buffer_size = 5M

read_buffer_size = 2M

long_query_time = 5

thread_concurrency = 4

#

# * Query Cache Configuration

#

query_cache_limit = 1M

query_cache_size = 64M

query_cache_type = 1

I ask database with the same connection and I run those query each 10 secondes :

********************************************************************************

$query = "INSERT INTO sys_stat ";

$query .= "(id_equ, time, rem_racine, rem_usr, rem_var, rem_exp_home, cpu0, cpu1, mem_free, swap_free) ";

$query .= "VALUES ('$id_equ', '$time', '$rem_racine', '$rem_usr', '$rem_var', '$rem_exp_home', '$cpu0', '$cpu1', '$mem_free', '$swap_free');";

$resultat = db_query($lien, $query);

*********************************************************************************

$query = "UPDATE alarmes_machine ";

$query .= "SET alarm_rep_racine = '$alarm_rep_racine', ";

$query .= " alarm_rep_usr = '$alarm_rep_usr', ";

$query .= " alarm_rep_var = '$alarm_rep_var', ";

$query .= " alarm_rep_exp_home = '$alarm_rep_exp_home', ";

$query .= " alarm_cpu0 = '$alarm_cpu0', ";

$query .= " alarm_cpu1 = '$alarm_cpu1', ";

$query .= " alarm_mem = '$alarm_mem', ";

$query .= " alarm_swap = '$alarm_swap', ";

$query .= " synthese = '$synthese' ";

$query .= "WHERE id_equ = '$machine->id';";

$resultat = db_query($lien, $query);

*********************************************************************************

$query = "UPDATE ping ";

$query .= "SET status = '$etat' ";

$query .= "WHERE de = '$de' AND a= '$a' AND via='$via';";

$resultat = db_query($lien, $query);

*********************************************************************************

$query = "SELECT time, ifInOctets, ifOutOctets, debitIn, debitOut FROM link_stat ";

$query .= " WHERE id_equ = " . $machine->id . " AND id_link = ".$val." ORDER BY id DESC LIMIT 1";

$resultat = db_query($lien, $query);

**********************************************************************************

$query = "INSERT INTO link_stat ";

$query .= "(id_equ, id_link, status, speed, time, ifInOctets, ifInErrors, IfOutOctets, IfOutErrors, debitIn, debitOut) ";

$query .= "VALUES ('$machine->id', '$val', '$port_stat', '$port_speed', '$unix_time', '$port_in', '$port_inerr', '$port_out', '$port_outerr', '$debit_In', '$debit_Out');";

$resultat = db_query($lien, $query);

*********************************************************************************

$query = "UPDATE alarmes_reseaux ";

$query .= "SET alarm_debit_in = '$alarm_debit_in', ";

$query .= " alarm_debit_out = '$alarm_debit_out', ";

$query .= " alarm_status = '$alarm_status', ";

$query .= " synthese = '$synthese' ";

$query .= "WHERE id_equ = '$machine->id' AND id_link = '$val';";

//printf ("%s\n", $query);

$resultat = db_query($lien, $query);

*********************************************************************************

table link_stat has 6 251 580 rows

table sys_stat has 1 908 192 rows

and others just some rows

Why this cpu overload, too much rows in my database ?

if someone has an idea, I want it !!

Good afternoon

Fabrice