Server Optimization, LOAD, Help:(
Hi,FIRST, sorry if my english bad!
Can somebody help me, I have load on my server every day higher, and when I type "top" command in ssh, I see very much time MySql 99% CPU and httpd 90% cpu...here is all info about server:
1. Dedicated
2. Celeron(R) CPU 2.00GHz, single
3. RAM: 512mb ram
4. hard drive: 80GB EIDE non raid (WDC WD800JB-00ETA0, ATA DISK drive, that I read in WHM/cPanel)
5. linux distributor: redhat linux 9
6. apache: apache 1.3.31
7. PHP version: php 4.3.9
8. MySQL version: mysql 4.0.20-standard
9.
/etc/my.cnf: I have in this file only this:
[mysqld]
set-variable = max_connections=400
safe-show-database
10. mysql extended-status (I don`t use root password):
+--------------------------+------------+
| Variable_name | Value |
+--------------------------+------------+
| Aborted_clients | 3437 |
| Aborted_connects | 195 |
| Bytes_received | 725834501 |
| Bytes_sent | 2212972681 |
| Com_admin_commands | 25 |
| Com_alter_table | 85 |
| Com_analyze | 0 |
| Com_backup_table | 0 |
| Com_begin | 99 |
| Com_change_db | 875950 |
| Com_change_master | 0 |
| Com_check | 0 |
| Com_commit | 99 |
| Com_create_db | 2 |
| Com_create_function | 0 |
| Com_create_index | 0 |
| Com_create_table | 99 |
| Com_delete | 53252 |
| Com_delete_multi | 0 |
| Com_drop_db | 0 |
| Com_drop_function | 0 |
| Com_drop_index | 0 |
| Com_drop_table | 14 |
| Com_flush | 302 |
| Com_grant | 63 |
| Com_ha_close | 0 |
| Com_ha_open | 0 |
| Com_ha_read | 0 |
| Com_insert | 80194 |
| Com_insert_select | 88 |
| Com_kill | 0 |
| Com_load | 0 |
| Com_load_master_data | 0 |
| Com_load_master_table | 0 |
| Com_lock_tables | 5442 |
| Com_optimize | 20 |
| Com_purge | 0 |
| Com_rename_table | 0 |
| Com_repair | 10590 |
| Com_replace | 123 |
| Com_replace_select | 0 |
| Com_reset | 0 |
| Com_restore_table | 0 |
| Com_revoke | 0 |
| Com_rollback | 0 |
| Com_savepoint | 0 |
| Com_select | 6621341 |
| Com_set_option | 2101 |
| Com_show_binlog_events | 0 |
| Com_show_binlogs | 0 |
| Com_show_create | 2101 |
| Com_show_databases | 274 |
| Com_show_fields | 13660 |
| Com_show_grants | 435 |
| Com_show_keys | 12 |
| Com_show_logs | 0 |
| Com_show_master_status | 0 |
| Com_show_new_master | 0 |
| Com_show_open_tables | 0 |
| Com_show_processlist | 841 |
| Com_show_slave_hosts | 0 |
| Com_show_slave_status | 0 |
| Com_show_status | 3 |
| Com_show_innodb_status | 1 |
| Com_show_tables | 2933 |
| Com_show_variables | 234 |
| Com_slave_start | 0 |
| Com_slave_stop | 0 |
| Com_truncate | 0 |
| Com_unlock_tables | 5442 |
| Com_update | 3067321 |
| Connections | 867592 |
| Created_tmp_disk_tables | 17297 |
| Created_tmp_tables | 58696 |
| Created_tmp_files | 0 |
| Delayed_insert_threads | 0 |
| Delayed_writes | 0 |
| Delayed_errors | 0 |
| Flush_commands | 1 |
| Handler_commit | 0 |
| Handler_delete | 31255 |
| Handler_read_first | 1482788 |
| Handler_read_key | 41452428 |
| Handler_read_next | 1559715872 |
| Handler_read_prev | 204418 |
| Handler_read_rnd | 6986662 |
| Handler_read_rnd_next | 3081266433 |
| Handler_rollback | 1 |
| Handler_update | 36878193 |
| Handler_write | 209914912 |
| Key_blocks_used | 7793 |
| Key_read_requests | 73711879 |
| Key_reads | 3558870 |
| Key_write_requests | 2248598 |
| Key_writes | 518566 |
| Max_used_connections | 400 |
| Not_flushed_key_blocks | 0 |
| Not_flushed_delayed_rows | 0 |
| Open_tables | 64 |
| Open_files | 128 |
| Open_streams | 0 |
| Opened_tables | 836333 |
| Questions | 11607396 |
| Qcache_queries_in_cache | 0 |
| Qcache_inserts | 0 |
| Qcache_hits | 0 |
| Qcache_lowmem_prunes | 0 |
| Qcache_not_cached | 0 |
| Qcache_free_memory | 0 |
| Qcache_free_blocks | 0 |
| Qcache_total_blocks | 0 |
| Rpl_status | NULL |
| Select_full_join | 3122 |
| Select_full_range_join | 0 |
| Select_range | 121067 |
| Select_range_check | 0 |
| Select_scan | 1470754 |
| Slave_open_temp_tables | 0 |
| Slave_running | OFF |
| Slow_launch_threads | 79 |
| Slow_queries | 2771 |
| Sort_merge_passes | 0 |
| Sort_range | 145743 |
| Sort_rows | 7026775 |
| Sort_scan | 342465 |
| Table_locks_immediate | 9860297 |
| Table_locks_waited | 45372 |
| Threads_cached | 0 |
| Threads_created | 867591 |
| Threads_connected | 3 |
| Threads_running | 1 |
| Uptime | 250632 |
+--------------------------+------------+
11. httpd.conf:
KeepAlive On
MaxKeepAliveRequests 50
KeepAliveTimeout 3
MinSpareServers 7
MaxSpareServers 20
StartServers 7
MaxClients 250
Can you help me, what I must change?
Thanks