|
Can you help? Opt. my server
|
Posts: 5
Group: Registered
Joined: Jun 2006
Status:
Offline
Reputation: 0
|
Can you help? Opt. my server
Hi!
I have dedicate server and have some (20) friends site on this (usaly: phpbb / smf / joomla) .
AMD 2.0 + (1.66GHz 256 RAM 40 GB)
Every works good but now from ~15.00 to ~21.00 I have problem with mysql I think. Load average goes up and I must reset apache even for 5 minutes.
14:51:57 up 5 days, 1:49, 2 users, load average: 0.75, 1.13, 1.69 97 processes: 94 sleeping, 2 running, 1 zombie, 0 stopped CPU states: 16.8% user 3.2% system 0.0% nice 0.0% iowait 80.0% idle Mem: 239124k av, 179444k used, 59680k free, 0k shrd, 12780k buff 137996k actv, 15344k in_d, 2300k in_c Swap: 1550232k av, 60456k used, 1489776k free 60328k cached
PID USER PRI NI SIZE RSS SHARE STAT %CPU %MEM TIME CPU COMMAND 31107 root 15 0 8372 8152 4148 S 99.9 3.4 0:16 0 httpd 321 root 16 0 0 0 0 SW 0.9 0.0 20:44 0 kjournald 16103 mysql 16 0 41984 24M 1916 S 0.9 10.6 12:09 0 mysqld 320 root 15 0 0 0 0 SW 0.1 0.0 17:26 0 kjournald 1078 root 15 0 748 720 384 R 0.1 0.3 0:02 0 top 1 root 15 0 100 64 44 S 0.0 0.0 0:19 0 init 2 root 15 0 0 0 0 SW 0.0 0.0 2:44 0 keventd 3 root 15 0 0 0 0 SW 0.0 0.0 0:56 0 kapmd 4 root 34 19 0 0 0 SWN 0.0 0.0 0:26 0 ksoftirqd_CPU0 9 root 25 0 0 0 0 SW 0.0 0.0 0:00 0 bdflush 5 root 15 0 0 0 0 SW 0.0 0.0 24:16 0 kswapd 6 root 15 0 0 0 0 SW 0.0 0.0 0:24 0 kscand/DMA 7 root 15 0 0 0 0 SW 0.0 0.0 3:32 0 kscand/Normal 8 root 15 0 0 0 0 SW 0.0 0.0 0:00 0 kscand/HighMem 10 root 15 0 0 0 0 SW 0.0 0.0 0:52 0 kupdated 11 root 25 0 0 0 0 SW 0.0 0.0 0:00 0 mdrecoveryd 15 root 15 0 0 0 0 SW 0.0 0.0 6:28 0 kjournald 73 root 25 0 0 0 0 SW 0.0 0.0 0:00 0 khubd 319 root 15 0 0 0 0 SW 0.0 0.0 0:02 0 kjournald 322 root 15 0 0 0 0 SW 0.0 0.0 5:37 0 kjournald 606 root 15 0 204 160 116 S 0.0 0.0 0:13 0 syslogd 610 root 21 0 52 4 0 S 0.0 0.0 0:00 0 klogd 628 rpc 15 0 80 4 0 S 0.0 0.0 0:00 0 portmap 664 root 25 0 52 4 0 S 0.0 0.0 0:00 0 apmd 703 named 15 0 1564 1000 500 S 0.0 0.4 1:30 0 named 716 root 15 0 252 4 0 S 0.0 0.0 0:14 0 sshd 730 root 23 0 152 4 0 S 0.0 0.0 0:00 0 xinetd 787 root 15 0 160 140 88 S 0.0 0.0 0:08 0 crond 810 daemon 16 0 156 140 96 S 0.0 0.0 0:02 0 atd 820 root 15 0 108 100 52 S 0.0 0.0 0:00 0 rhnsd 943 root 15 0 324 192 120 S 0.0 0.0 0:15 0 master 944 root 15 0 184 52 20 S 0.0 0.0 0:14 0 authdaemond 953 root 15 0 60 4 0 S 0.0 0.0 0:00 0 courierlogger 954 root 15 0 56 4 0 S 0.0 0.0 0:00 0 couriertcpd
procs memory swap io system cpu r b w swpd free buff cache si so bi bo in cs us sy id 0 0 0 60404 60076 13116 65928 29 35 19 13 37 62 11 7 82 0 0 0 60404 59628 13172 66076 12 0 180 728 301 128 7 17 76 0 0 0 60404 58012 13172 66076 4 0 4 0 193 138 17 1 82 0 0 0 60404 57988 13172 66076 12 0 12 0 176 92 13 0 87 0 0 0 60404 57988 13180 66172 8 0 112 0 189 74 10 1 89 0 0 3 60404 57472 13292 66528 20 0 472 144 298 346 22 8 70 0 1 0 60404 56224 13400 66652 64 0 280 352 339 351 22 21 57 0 0 0 60404 54936 13436 66764 20 0 172 0 271 189 20 6 74 0 0 0 60404 50088 13436 66764 12 0 12 0 198 215 16 3 81 1 0 0 60404 43120 13444 66896 32 0 172 0 203 361 29 3 68 0 0 4 60404 41572 13600 67168 24 0 388 736 379 517 23 22 55 0 0 0 60404 36492 13664 67192 24 0 28 464 241 516 38 11 51 1 0 0 60404 36492 13664 67200 4 0 12 0 197 152 12 1 87 1 0 0 60404 33192 13680 67316 16 0 148 0 218 195 23 2 75 1 0 0 60404 35564 13680 67440 112 0 232 0 216 218 47 4 50 2 0 2 60404 35572 13716 67448 0 0 8 816 274 39 3 13 84 1 0 0 60404 36304 13752 67684 12 0 292 4 226 318 45 7 49 0 0 0 60404 36304 13752 67720 16 0 36 0 218 197 35 2 63 0 0 0 60404 36304 13760 67776 28 0 88 0 251 261 15 3 82 0 0 0 60404 36288 13764 67828 0 0 52 0 193 238 16 0 84 0 1 3 60404 27976 13792 67860 0 0 36 912 298 261 23 17 60
Aborted_clients 1610 Aborted_connects 29 % of Total Connections = 0.105% Binlog_cache_disk_use 0 Binlog_cache_use 0 Bytes_received 97 KB Received/Second = 0.000 Per Hour = 0.000 Bytes_sent 6033 KB Sent/Second = 0.000 Per Hour = 0.266 Com_admin_commands 0 Com_alter_db 0 Com_alter_table 0 Com_analyze 0 Com_backup_table 0 Com_begin 0 Com_change_db 0 Com_change_master 0 Com_check 0 Com_checksum 0 Com_commit 0 Com_create_db 0 Com_create_function 0 Com_create_index 0 Com_create_table 0 Com_dealloc_sql 0 Com_delete 0 Com_delete_multi 0 Com_do 0 Com_drop_db 0 Com_drop_function 0 Com_drop_index 0 Com_drop_table 0 Com_drop_user 0 Com_execute_sql 0 Com_flush 0 Com_grant 0 Com_ha_close 0 Com_ha_open 0 Com_ha_read 0 Com_help 0 Com_insert 0 Com_insert_select 0 Com_kill 0 Com_load 0 Com_load_master_data 0 Com_load_master_table 0 Com_lock_tables 0 Com_optimize 0 Com_preload_keys 0 Com_prepare_sql 0 Com_purge 0 Com_purge_before_date 0 Com_rename_table 0 Com_repair 0 Com_replace 0 Com_replace_select 0 Com_reset 0 Com_restore_table 0 Com_revoke 0 Com_revoke_all 0 Com_rollback 0 Com_savepoint 0 Com_select 0 Com_set_option 0 Com_show_binlog_events 0 Com_show_binlogs 0 Com_show_charsets 0 Com_show_collations 0 Com_show_column_types 0 Com_show_create_db 0 Com_show_create_table 0 Com_show_databases 0 Com_show_errors 0 Com_show_fields 0 Com_show_grants 0 Com_show_innodb_status 0 Com_show_keys 0 Com_show_logs 0 Com_show_master_status 0 Com_show_ndb_status 0 Com_show_new_master 0 Com_show_open_tables 0 Com_show_privileges 0 Com_show_processlist 0 Com_show_slave_hosts 0 Com_show_slave_status 0 Com_show_status 1 Com_show_storage_engines 0 Com_show_tables 0 Com_show_triggers 0 Com_show_variables 1 Com_show_warnings 0 Com_slave_start 0 Com_slave_stop 0 Com_stmt_close 0 Com_stmt_execute 0 Com_stmt_fetch 0 Com_stmt_prepare 0 Com_stmt_reset 0 Com_stmt_send_long_data 0 Com_truncate 0 Com_unlock_tables 0 Com_update 0 Com_update_multi 0 Com_xa_commit 0 Com_xa_end 0 Com_xa_prepare 0 Com_xa_recover 0 Com_xa_rollback 0 Com_xa_start 0 Compression OFF Connections 27717 Connections/Second = 0.410 Per Hour = 1476.031 Created_tmp_disk_tables 0 Created_tmp_files 3 Created_tmp_tables 2 Per Hour = 0.107 Delayed_errors 0 Delayed_insert_threads 0 Delayed_writes 0 Flush_commands 1 Handler_commit 0 Handler_delete 0 Handler_discover 0 Handler_prepare 0 Handler_read_first 0 Handler_read_key 0 Handler_read_next 0 Handler_read_prev 0 Handler_read_rnd 0 Handler_read_rnd_next 211 Handler_rollback 0 Handler_savepoint 0 Handler_savepoint_rollback 0 Handler_update 0 Handler_write 340 Innodb_buffer_pool_pages_data 0 Innodb_buffer_pool_pages_dirty 0 Innodb_buffer_pool_pages_flushed 0 Innodb_buffer_pool_pages_free 0 Innodb_buffer_pool_pages_latched 0 Innodb_buffer_pool_pages_misc 0 Innodb_buffer_pool_pages_total 0 Innodb_buffer_pool_read_ahead_rnd 0 Innodb_buffer_pool_read_ahead_seq 0 Innodb_buffer_pool_read_requests 0 Innodb_buffer_pool_reads 0 Innodb_buffer_pool_wait_free 0 Innodb_buffer_pool_write_requests 0 Innodb_data_fsyncs 0 Innodb_data_pending_fsyncs 0 Innodb_data_pending_reads 0 Innodb_data_pending_writes 0 Innodb_data_read 0 Innodb_data_reads 0 Innodb_data_writes 0 Innodb_data_written 0 Innodb_dblwr_pages_written 0 Innodb_dblwr_writes 0 Innodb_log_waits 0 Innodb_log_write_requests 0 Innodb_log_writes 0 Innodb_os_log_fsyncs 0 Innodb_os_log_pending_fsyncs 0 Innodb_os_log_pending_writes 0 Innodb_os_log_written 0 Innodb_page_size 0 Innodb_pages_created 0 Innodb_pages_read 0 Innodb_pages_written 0 Innodb_row_lock_current_waits 0 Innodb_row_lock_time 0 Innodb_row_lock_time_avg 0 Innodb_row_lock_time_max 0 Innodb_row_lock_waits 0 Innodb_rows_deleted 0 Innodb_rows_inserted 0 Innodb_rows_read 0 Innodb_rows_updated 0 Key_blocks_not_flushed 0 Key_blocks_unused 2608 Key_blocks_used 2725 Approx. 89% of key_buffer in use Key Buffer Size = 3 Mb. Key_read_requests 6756679 Key_reads 294865 Key Reads/Key Read Requests = 0.043641 Cache hit = 99.956359% Key_write_requests 305747 Last_query_cost 10.499000 Max_used_connections 81 Not_flushed_delayed_rows 0 Open_files 48 Open_streams 0 Open_tables 25 100% of table_cache in use Opened_tables 0 Qcache_free_blocks 3271 Qcache_free_memory 33462928 Qcache_hits 454184 73% of Queries Cached Qcache_inserts 152956 Qcache_lowmem_prunes 0 Qcache_not_cached 11049 Qcache_queries_in_cache 9119 Qcache_total_blocks 22296 Questions 785138 Queries/Second = 11.614 Queries/Hour = 41811.464 Rpl_status NULL Select_full_join 0 % of Total Queries = 0.000% Select_full_range_join 0 Select_range 0 Select_range_check 0 Select_scan 2 Slave_open_temp_tables 0 Slave_retried_transactions 0 Slave_running OFF Slow_launch_threads 8 Slow_queries 0 Slow Queries/Second = 0.000 Slow Queries/Hour = 0.000 % of Total Queries = 0.000% Sort_merge_passes 0 Sort_range 0 Sort_rows 0 Sort_scan 0 Table_locks_immediate 368538 % of total locks 99.887249% Locks/Second = 5.452 Locks/Hour = 19625.994 Table_locks_waited 416 % of total locks 0.112751% Locks/Second = 0.006 Locks/Hour = 22.154 Tc_log_max_pages_used 0 Tc_log_page_size 0 Tc_log_page_waits 0 Threads_cached 0 Threads_connected 8 Threads_created 27716 Cache hit Rate = 0.003608% Threads_running 1 Uptime 67601 18 hrs 46 mins 41 secs Current "my.cnf" Settings
[mysqld] skip-locking set-variable = key_buffer=3M set-variable = join_buffer=124K set-variable = read_buffer_size=1020K set-variable = sort_buffer_size=1M
set-variable = max_allowed_packet=1023K set-variable = tmp_table_size=32M set-variable = max_connections=150 set-variable = table_cache=25 set-variable = thread_cache_size=0 set-variable = connect_timeout=5
Timeout 100 KeepAlive On MaxKeepAliveRequests 30 KeepAliveTimeout 5 UseCanonicalName Off AccessFileName .htaccess ServerTokens Full ServerSignature On HostnameLookups Off
-------------------------------------------
and now:
16:50:06 up 5 days, 3:47, 1 user, load average: 4.23, 2.70, 1.72 93 processes: 91 sleeping, 2 running, 0 zombie, 0 stopped CPU states: 0.0% user 2.8% system 0.0% nice 0.0% iowait 97.1% idle Mem: 239124k av, 200948k used, 38176k free, 0k shrd, 15384k buff 135632k actv, 20396k in_d, 4536k in_c Swap: 1550232k av, 61112k used, 1489120k free 74600k cached
PID USER PRI NI SIZE RSS SHARE STAT %CPU %MEM TIME CPU COMMAND 9427 root 15 0 1188 1188 840 R 2.9 0.4 0:00 0 top 1 root 15 0 100 64 44 S 0.0 0.0 0:20 0 init 2 root 15 0 0 0 0 SW 0.0 0.0 2:46 0 keventd 3 root 15 0 0 0 0 SW 0.0 0.0 0:57 0 kapmd 4 root 34 19 0 0 0 SWN 0.0 0.0 0:26 0 ksoftirqd_CPU0 9 root 25 0 0 0 0 SW 0.0 0.0 0:00 0 bdflush 5 root 15 0 0 0 0 SW 0.0 0.0 24:32 0 kswapd 6 root 15 0 0 0 0 SW 0.0 0.0 0:24 0 kscand/DMA 7 root 15 0 0 0 0 SW 0.0 0.0 3:35 0 kscand/Normal 8 root 15 0 0 0 0 SW 0.0 0.0 0:00 0 kscand/HighMem 10 root 15 0 0 0 0 SW 0.0 0.0 0:52 0 kupdated 11 root 25 0 0 0 0 SW 0.0 0.0 0:00 0 mdrecoveryd 15 root 15 0 0 0 0 SW 0.0 0.0 6:34 0 kjournald 73 root 25 0 0 0 0 SW 0.0 0.0 0:00 0 khubd 319 root 15 0 0 0 0 SW 0.0 0.0 0:02 0 kjournald 320 root 15 0 0 0 0 SW 0.0 0.0 17:45 0 kjournald 321 root 15 0 0 0 0 SW 0.0 0.0 21:11 0 kjournald 322 root 15 0 0 0 0 SW 0.0 0.0 5:45 0 kjournald 606 root 15 0 244 208 156 S 0.0 0.0 0:14 0 syslogd 610 root 21 0 52 4 0 S 0.0 0.0 0:00 0 klogd 628 rpc 15 0 80 4 0 S 0.0 0.0 0:00 0 portmap 664 root 25 0 52 4 0 S 0.0 0.0 0:00 0 apmd 703 named 15 0 1560 1008 496 S 0.0 0.4 1:31 0 named 716 root 15 0 388 220 136 S 0.0 0.0 0:10 0 sshd 730 root 23 0 152 4 0 S 0.0 0.0 0:00 0 xinetd 787 root 15 0 156 136 84 S 0.0 0.0 0:08 0 crond 810 daemon 15 0 168 152 108 S 0.0 0.0 0:02 0 atd 820 root 15 0 56 4 0 S 0.0 0.0 0:00 0 rhnsd 943 root 15 0 324 192 120 S 0.0 0.0 0:15 0 master 944 root 15 0 168 32 4 S 0.0 0.0 0:15 0 authdaemond 953 root 15 0 60 4 0 S 0.0 0.0 0:00 0 courierlogger 954 root 15 0 56 4 0 S 0.0 0.0 0:00 0 couriertcpd 960 root 15 0 224 216 168 S 0.0 0.0 0:01 0 courierlogger 961 root 15 0 124 108 64 S 0.0 0.0 0:02 0 couriertcpd
# vmstat 1 procs memory swap io system cpu r b w swpd free buff cache si so bi bo in cs us sy id 0 0 0 61112 31016 15996 78668 29 36 20 16 40 63 11 7 82 0 0 0 61112 31016 16028 78668 0 0 0 188 164 33 0 3 97 0 0 0 61112 31016 16028 78668 0 0 0 0 137 28 0 0 100 0 0 0 61112 31016 16028 78668 0 0 0 0 146 30 0 1 99 0 0 0 61112 31008 16028 78668 4 0 4 0 143 98 10 3 87 0 0 0 61112 31008 16028 78672 8 0 12 0 169 121 11 0 89 0 0 0 61112 31016 16060 78800 0 0 128 228 194 78 1 5 94 0 0 0 61112 31028 16060 78800 0 0 0 0 148 31 0 1 99 0 0 0 61112 31028 16060 78848 4 0 52 0 206 114 7 6 87 0 0 0 61112 29496 16060 78848 4 0 4 0 182 63 11 3 86 0 0 0 61112 29496 16060 78860 0 0 12 0 170 35 0 0 100 0 0 0 61112 29496 16092 78860 0 0 0 320 221 63 0 5 95 0 0 0 61112 29220 16092 78860 0 0 0 0 174 44 3 1 96 0 0 0 61112 29220 16092 78860 0 0 0 0 172 38 0 0 100 0 0 0 61112 29220 16092 78864 0 0 4 0 195 38 1 3 96 0 0 0 61112 29220 16092 78864 0 0 0 0 159 23 0 0 100 0 0 0 61112 31260 16116 78864 0 0 0 112 161 29 0 0 100 0 0 0 61112 31268 16116 78868 0 0 4 0 168 64 7 0 93 0 0 1 61112 31268 16132 78996 0 0 144 0 215 44 3 0 97 0 0 0 61112 31268 16132 78996 0 0 0 0 170 43 0 0 100 0 0 0 61112 31268 16132 78996 0 0 0 0 136 21 0 0 100 procs memory swap io system cpu r b w swpd free buff cache si so bi bo in cs us sy id 1 0 0 61112 31268 16164 78996 0 0 0 144 186 34 0 5 95 2 0 0 61112 35600 16164 79024 0 0 28 0 181 70 6 3 91 0 0 0 61112 34556 16176 79224 20 0 228 0 241 227 14 6 80 1 0 0 61112 31656 16180 79228 0 0 4 0 244 56 41 3 56 0 0 0 61112 31656 16180 79228 0 0 0 0 186 39 0 0 100 0 0 0 61112 31656 16216 79228 0 0 0 720 254 52 1 12 87 0 0 0 61112 31656 16216 79228 0 0 0 0 155 25 0 0 100 0 0 0 61112 31656 16216 79228 0 0 0 0 175 36 1 0 99 0 0 0 61112 31648 16216 79228 0 0 0 0 159 26 0 0 100 0 0 0 61112 31648 16216 79264 0 0 36 0 181 75 0 0 100 0 0 0 61112 31648 16248 79264 0 0 0 68 194 52 0 2 98 0 0 1 61112 31648 16248 79264 0 0 0 0 204 50 0 2 98 0 0 0 61112 31648 16248 79264 0 0 0 0 191 45 0 0 100
Thanks and sorry for my bad english;-)
06-06-2006 01:22 PM
This post was last modified: 06-06-2006 04:06 PM by LukaszP.
|
|
|
 |
Posts: 221
Group: Administrators
Joined: May 2006
Status:
Offline
Reputation: 0
|
RE: Can you help? Opt. my server
LukaszP, the problem with your server is that you're already pushing more than ram it's got and you really need to upgrade to AT LEAST 512 mb ram.
There isn't much I can do to help you optimize, because it's already optimized for lower memory usage but still your server lacks the memory required to run a MySQL server. 11 queries per second is a bit high for that memory.
You can try to disable your website logs (web logs) and try to optimize a few more MySQL variables, but nothing is going to help much here.
And please post your stats recorded when on high load. When you are under load, please record the output of:
#free -m
Additionally, post the Min and Max SpareServers settings of Apache.
06-06-2006 03:43 PM
|
|
|
 |
Posts: 5
Group: Registered
Joined: Jun 2006
Status:
Offline
Reputation: 0
|
RE: Can you help? Opt. my server
# free -m
total used free shared buffers cached
Mem: 233 224 8 0 14 89
-/+ buffers/cache: 119 113
Swap: 1513 60 1453
now: load average: 0.18, 0.92, 2.87
06-06-2006 03:51 PM
|
|
|
 |
Posts: 221
Group: Administrators
Joined: May 2006
Status:
Offline
Reputation: 0
|
RE: Can you help? Opt. my server
Well, have you tried disabling HTTPD logs? Which control panel (if any), and OS you're using?
And that's MySQL 4.x right?
Well, try these variables for MySQL..
skip-locking
set-variable = key_buffer=16M
set-variable = join_buffer=256K
set-variable = read_buffer_size=256K
set-variable = sort_buffer_size=512K
set-variable = max_allowed_packet=1023K
set-variable = tmp_table_size=16M
set-variable = max_connections=150
set-variable = table_cache=50
set-variable = thread_cache_size=0
set-variable = connect_timeout=5
Also, try lowering your timeout settings in httpd.conf to 30 from 100.. Try this:
Timeout 30
KeepAlive On
KeepAliveTimeout 3
Disable all un-necessary modules in your httpd.conf file, like mod_perl if you aren't using perl/cgi on server.
06-06-2006 04:08 PM
This post was last modified: 06-06-2006 04:08 PM by Pacifier.
|
|
|
 |
Posts: 5
Group: Registered
Joined: Jun 2006
Status:
Offline
Reputation: 0
|
RE: Can you help? Opt. my server
RH9, webmin + usermin + phpmyadmin
this is normal ?
eAccelerator for php can help ?
MySQL 5.0.21
I'm thinking about new server:
C2,6GHz 512 RAM or I must find somen thing beter?
06-06-2006 04:20 PM
|
|
|
 |
Posts: 5
Group: Registered
Joined: Jun 2006
Status:
Offline
Reputation: 0
|
RE: Can you help? Opt. my server
for now is about 0.8-1.6, sometime go to 3.2 but apache reset and goes to 0.8
06-06-2006 06:24 PM
|
|
|
 |
Posts: 221
Group: Administrators
Joined: May 2006
Status:
Offline
Reputation: 0
|
RE: Can you help? Opt. my server
Celeron 2.6 with 512mb ram will be good upgrade from your current server. 0.8-1.6 means you should upgrade. Anything above 1.0 is something to worry about when you have already optimize it to it's maximum capacity.
I don't think you can run a cache software such as eAccelerator or APC, because you're already too limited on memory. Better go for an upgrade!
06-07-2006 04:11 PM
|
|
|
 |
Posts: 5
Group: Registered
Joined: Jun 2006
Status:
Offline
Reputation: 0
|
RE: Can you help? Opt. my server
ok, but I think that eAccelerator goes to tmp/eacelerator no to RAM ? maybe I worng....
06-07-2006 05:22 PM
|
|
|
 |
Posts: 221
Group: Administrators
Joined: May 2006
Status:
Offline
Reputation: 0
|
RE: Can you help? Opt. my server
eAccelerator also uses 32-64 mb (not sure what's the default setting). So that's not a very convenient choice. You really need more RAM and everything will be resolved. After upgrading RAM, you can use eAccelerator or APC (I use APC) to get a furthur performance boost.
06-08-2006 01:09 PM
|
|
|
 |