PDA

View Full Version : [Needed] optimization for Dual Opteron 244


uae2k
Thu 2nd Mar '06, 9:06pm
I had a new server for My forum and I hope to get help in the optimization ... The server still in it first hour




1. Dedicated Server


cpu: Dual Opteron 244
Memory: 1 GB ram
HD: 2x120GB SATA
OS: CentOS 4.2 i686
apache/IIS version: Apache/1.3.34
PHP version: php 4.4.1
MySQL version: mysql 4.0.25


vB Status
Version: 3,5,4
Users Online: 300-600



Top Stats
top - 04:42:11 up 7:51, 1 user, load average: 2.14, 2.94, 2.57
Tasks: 193 total, 3 running, 190 sleeping, 0 stopped, 0 zombie
Cpu(s): 44.2% us, 17.8% sy, 0.0% ni, 25.7% id, 12.0% wa, 0.3% hi, 0.0% si
Mem: 1034628k total, 225812k used, 808816k free, 3660k buffers
Swap: 3148700k total, 45888k used, 3102812k free, 32408k cached
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
8597 anabico 17 0 11832 7088 1684 R 36.8 0.7 5:05.34 php
8609 mysql 16 0 50576 33m 1868 S 15.9 3.3 2:16.54 mysqld
1373 root 15 0 0 0 0 S 1.0 0.0 0:04.17 kjournald
5680 root 16 0 8500 3788 2748 S 1.0 0.4 0:00.03 exim
51 root 15 0 0 0 0 S 0.7 0.0 0:04.04 kswapd0
5601 root 17 0 9304 3788 2748 S 0.7 0.4 0:00.02 exim
5644 root 16 0 9660 3780 2748 S 0.7 0.4 0:00.02 exim
5650 root 17 0 8868 3788 2748 S 0.7 0.4 0:00.02 exim
5659 root 17 0 9732 3784 2748 S 0.7 0.4 0:00.02 exim
5686 root 19 0 10124 3788 2748 S 0.7 0.4 0:00.02 exim
5689 root 19 0 8376 3784 2748 S 0.7 0.4 0:00.02 exim
5692 root 19 0 9016 3788 2748 S 0.7 0.4 0:00.02 exim
5695 root 19 0 9724 3784 2748 S 0.7 0.4 0:00.02 exim
5698 root 19 0 8664 3788 2748 S 0.7 0.4 0:00.02 exim
5701 root 16 0 9428 3784 2748 S 0.7 0.4 0:00.02 exim
5704 root 19 0 9352 3788 2748 S 0.7 0.4 0:00.02 exim
5707 root 17 0 9692 3780 2748 S 0.7 0.4 0:00.02 exim



My.cnf
[mysqld]
set-variable = max_connections=500
safe-show-database



httpd.conf

KeepAlive On
MaxKeepAliveRequests 100
KeepAliveTimeout 15
MinSpareServers 5
MaxSpareServers 10
StartServers 5
MaxClients 150
MaxRequestsPerChild 0



MySQL Variables

Variable_name Value
back_log 50
basedir /
binlog_cache_size 32768
bulk_insert_buffer_size 8388608
character_set latin1
character_sets latin1 big5 czech euc_kr gb2312 gbk latin1_de sjis tis620 ujis dec8 dos german1 hp8 koi8_ru latin2 swe7 usa7 cp1251 danish hebrew win1251 estonia hungarian koi8_ukr win1251ukr greek win1250 croat cp1257 latin5
concurrent_insert ON
connect_timeout 5
convert_character_set
datadir /var/lib/mysql/
default_week_format 0
delay_key_write ON
delayed_insert_limit 100
delayed_insert_timeout 300
delayed_queue_size 1000
flush OFF
flush_time 0
ft_boolean_syntax + -><()~*:""&|
ft_min_word_len 4
ft_max_word_len 254
ft_max_word_len_for_sort 20
ft_stopword_file (built-in)
have_bdb NO
have_crypt YES
have_innodb YES
have_isam YES
have_raid NO
have_symlink YES
have_openssl NO
have_query_cache YES
init_file
innodb_additional_mem_pool_size 1048576
innodb_autoextend_increment 8
innodb_buffer_pool_size 8388608
innodb_data_file_path ibdata1:10M:autoextend
innodb_data_home_dir
innodb_file_io_threads 4
innodb_force_recovery 0
innodb_thread_concurrency 8
innodb_flush_log_at_trx_commit 1
innodb_fast_shutdown ON
innodb_flush_method
innodb_lock_wait_timeout 50
innodb_log_arch_dir ./
innodb_log_archive OFF
innodb_log_buffer_size 1048576
innodb_log_file_size 5242880
innodb_log_files_in_group 2
innodb_log_group_home_dir ./
innodb_mirrored_log_groups 1
innodb_max_dirty_pages_pct 90
innodb_max_purge_lag 0
innodb_table_locks ON
interactive_timeout 28800
join_buffer_size 131072
key_buffer_size 8388600
language /usr/share/mysql/english/
large_files_support ON
license GPL
local_infile ON
locked_in_memory OFF
log OFF
log_update OFF
log_bin OFF
log_slave_updates OFF
log_slow_queries OFF
log_warnings 1
long_query_time 10
low_priority_updates OFF
lower_case_file_system OFF
lower_case_table_names 0
max_allowed_packet 1048576
max_binlog_cache_size 4294967295
max_binlog_size 1073741824
max_connections 500
max_connect_errors 10
max_delayed_threads 20
max_insert_delayed_threads 20
max_heap_table_size 16777216
max_join_size 4294967295
max_relay_log_size 0
max_seeks_for_key 4294967295
max_sort_length 1024
max_user_connections 0
max_tmp_tables 32
max_write_lock_count 4294967295
myisam_max_extra_sort_file_size 268435456
myisam_max_sort_file_size 2147483647
myisam_repair_threads 1
myisam_recover_options OFF
myisam_sort_buffer_size 8388608
net_buffer_length 16384
net_read_timeout 30
net_retry_count 10
net_write_timeout 60
new OFF
open_files_limit 10000
pid_file /var/lib/mysql/ls1102.alwahdaonline.com.pid
log_error
port 3306
protocol_version 10
query_alloc_block_size 8192
query_cache_limit 1048576
query_cache_size 0
query_cache_type ON
query_cache_wlock_invalidate OFF
query_prealloc_size 8192
range_alloc_block_size 2048
read_buffer_size 131072
read_only OFF
read_rnd_buffer_size 262144
rpl_recovery_rank 0
server_id 0
slave_net_timeout 3600
skip_external_locking ON
skip_networking OFF
skip_show_database OFF
slow_launch_time 2
socket /var/lib/mysql/mysql.sock
sort_buffer_size 2097144
sql_mode 0
table_cache 64
table_type MYISAM
thread_cache_size 0
thread_stack 126976
tx_isolation REPEATABLE-READ
timezone GST
tmp_table_size 33554432
tmpdir /tmp/
transaction_alloc_block_size 8192
transaction_prealloc_size 4096
version 4.0.25-standard
version_comment Official MySQL RPM
version_compile_os pc-linux-gnu
wait_timeout 28800
Aborted_clients 0
Aborted_connects 3
Bytes_received 717056120
Bytes_sent 596208465
Com_admin_commands 0
Com_alter_table 217
Com_analyze 0
Com_backup_table 0
Com_begin 0
Com_change_db 1173
Com_change_master 0
Com_check 104
Com_commit 0
Com_create_db 3
Com_create_function 0
Com_create_index 0
Com_create_table 106
Com_delete 156
Com_delete_multi 0
Com_drop_db 2
Com_drop_function 0
Com_drop_index 0
Com_drop_table 106
Com_flush 40
Com_grant 15
Com_ha_close 0
Com_ha_open 0
Com_ha_read 0
Com_insert 17214
Com_insert_select 2
Com_kill 0
Com_load 0
Com_load_master_data 0
Com_load_master_table 0
Com_lock_tables 15961
Com_optimize 104
Com_purge 0
Com_rename_table 0
Com_repair 0
Com_replace 168
Com_replace_select 0
Com_reset 0
Com_restore_table 0
Com_revoke 0
Com_rollback 0
Com_savepoint 0
Com_select 376452
Com_set_option 113
Com_show_binlog_events 0
Com_show_binlogs 2
Com_show_create 0
Com_show_databases 34
Com_show_fields 0
Com_show_grants 6
Com_show_keys 0
Com_show_logs 0
Com_show_master_status 0
Com_show_new_master 0
Com_show_open_tables 0
Com_show_processlist 97
Com_show_slave_hosts 0
Com_show_slave_status 0
Com_show_status 4
Com_show_innodb_status 0
Com_show_tables 15
Com_show_variables 15
Com_slave_start 0
Com_slave_stop 0
Com_truncate 0
Com_unlock_tables 15962
Com_update 626
Com_update_multi 1
Connections 1456
Created_tmp_disk_tables 7
Created_tmp_tables 215
Created_tmp_files 7
Delayed_insert_threads 0
Delayed_writes 0
Delayed_errors 0
Flush_commands 1
Handler_commit 0
Handler_delete 43317
Handler_read_first 569
Handler_read_key 1444119
Handler_read_next 3196635
Handler_read_prev 21588130
Handler_read_rnd 565751
Handler_read_rnd_next 45031516
Handler_rollback 2
Handler_update 23442
Handler_write 10450812
Key_blocks_used 7793
Key_read_requests 19259952
Key_reads 286239
Key_write_requests 3125267
Key_writes 84209
Max_used_connections 12
Not_flushed_key_blocks 0
Not_flushed_delayed_rows 0
Open_tables 64
Open_files 121
Open_streams 0
Opened_tables 1614
Questions 430146
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 28
Select_full_range_join 0
Select_range 2263
Select_range_check 0
Select_scan 4160
Slave_open_temp_tables 0
Slave_running OFF
Slow_launch_threads 0
Slow_queries 15
Sort_merge_passes 0
Sort_range 8903
Sort_rows 579185
Sort_scan 1052
Table_locks_immediate 416935
Table_locks_waited 80
Threads_cached 0
Threads_created 1455
Threads_connected 2
Threads_running 1
Uptime 28572




uname -a
Linux ls1102.alwahdaonline.com 2.6.9-22.0.2.ELsmp #1 SMP Tue Jan 17 07:10:04 CST 2006 i686 athlon i386 GNU/Linux


ulimit -aH
core file size (blocks, -c) 1000000
data seg size (kbytes, -d) unlimited
file size (blocks, -f) unlimited
pending signals (-i) 1024
max locked memory (kbytes, -l) 32
max memory size (kbytes, -m) unlimited
open files (-n) 4096
pipe size (512 bytes, -p) 8
POSIX message queues (bytes, -q) 819200
stack size (kbytes, -s) 8192
cpu time (seconds, -t) unlimited
max user processes (-u) 14335
virtual memory (kbytes, -v) unlimited
file locks (-x) unlimited


/proc/cpuinfo
processor : 0
vendor_id : AuthenticAMD
cpu family : 15
model : 5
model name : AMD Opteron(tm) Processor 244
stepping : 10
cpu MHz : 1792.947
cache size : 1024 KB
fdiv_bug : no
hlt_bug : no
f00f_bug : no
coma_bug : no
fpu : yes
fpu_exception : yes
cpuid level : 1
wp : yes
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 syscall nx mmxext lm 3dnowext 3dnow
bogomips : 3522.56
processor : 1
vendor_id : AuthenticAMD
cpu family : 15
model : 5
model name : AMD Opteron(tm) Processor 244
stepping : 10
cpu MHz : 1792.947
cache size : 1024 KB
fdiv_bug : no
hlt_bug : no
f00f_bug : no
coma_bug : no
fpu : yes
fpu_exception : yes
cpuid level : 1
wp : yes
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 syscall nx mmxext lm 3dnowext 3dnow
bogomips : 3579.90

eva2000
Fri 3rd Mar '06, 4:14am
Beware of the centOS and 2.6.9-22 kernel problem - point your web host to this thread http://www.vbulletin.com/forum/showthread.php?t=171071 you might want to downgrade or upgrade your kernel to fix this if you have unexplained cpu load issues


1. Upgrade MySQL server to 4.0.26
2. Upgrade PHP to 4.4.2 if you use phpadsnew make sure to update to phpadsnew 2.0.7 to work with PHP 4.4.1/4.4.2
3. Edit /etc/my.cnf and place the following mysql server settings in /etc/my.cnf and restart mysql server afterwards


[mysqld]
safe-show-database
skip-innodb
max_connections = 650
key_buffer = 64M
myisam_sort_buffer_size = 64M
join_buffer_size = 1M
read_buffer_size = 1M
sort_buffer_size = 2M
table_cache = 1800
thread_cache_size = 384
wait_timeout = 90
connect_timeout = 10
tmp_table_size = 128M
max_heap_table_size = 128M
max_allowed_packet = 64M
max_connect_errors = 10
read_rnd_buffer_size = 524288
bulk_insert_buffer_size = 8M
query_cache_limit = 8M
query_cache_size = 80M
query_cache_type = 1
query_prealloc_size = 163840
query_alloc_block_size = 32768

[mysqld_safe]
nice = -5
open_files_limit = 8192

[mysqldump]
quick
max_allowed_packet = 16M

[myisamchk]
key_buffer = 64M
sort_buffer = 64M
read_buffer = 16M
write_buffer = 16M

[mysqlhotcopy]
interactive-timeout


4. Install APC Cache lastest version from http://pecl.php.net/package/APC. Read install guide at http://www.vbulletin.com/forum/showthread.php?t=165367 - please remove Zend Optimizer from php.ini before installing APC Cache

5. If you just upgraded to vB 3.5.x try to disable these 4 options:

Admin CP -> vBulletin Options -> Forums Home Page Options -> Display Logged in Users?

Admin CP -> vBulletin Options -> Forum Display Options (forumdisplay) -> Show Users Browsing Forums

Admin CP -> vBulletin Options -> Thread Display Options -> Show Users Browsing Thread

Admin CP -> vBulletin Options -> Message Searching Options -> Automatic Similar Thread search

uae2k
Mon 6th Mar '06, 7:19am
Fantastic

This is the 3rd day and the server working smoothly

I havn't upgrade PHP and MySQL ... I will upgrade it soon and install APC Cache

Thanks Eva

eva2000
Mon 6th Mar '06, 9:20am
Good to hear so you upgraded kernel ?

uae2k
Thu 9th Mar '06, 6:04am
Check it out


Top status with 400 users online
top - 13:59:33 up 16:56, 1 user, load average: 0.86, 0.50, 0.40
Tasks: 122 total, 1 running, 121 sleeping, 0 stopped, 0 zombie
Cpu(s): 0.2% us, 1.2% sy, 17.1% ni, 80.4% id, 0.8% wa, 0.0% hi, 0.3% si
Mem: 1031516k total, 1016064k used, 15452k free, 39664k buffers
Swap: 3148700k total, 128k used, 3148572k free, 568736k cached
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
2847 nobody 19 4 22296 12m 2512 S 11.0 1.2 8:43.09 httpd
20139 nobody 20 4 19192 8412 1732 S 7.0 0.8 0:00.24 httpd
20137 nobody 19 4 22280 11m 1888 S 6.0 1.1 0:00.34 httpd
20136 nobody 20 4 21924 10m 1860 S 5.0 1.1 0:00.73 httpd
20142 nobody 19 4 19388 8724 1848 S 4.0 0.8 0:00.79 httpd
20135 nobody 19 4 21820 10m 1704 S 1.3 1.1 0:00.29 httpd
14671 mysql 22 6 153m 68m 1440 S 1.0 6.8 3:13.75 mysqld
20143 nobody 19 4 18632 7952 1832 S 1.0 0.8 0:00.26 httpd
15804 mysql 21 6 153m 68m 1440 S 0.7 6.8 0:31.81 mysqld
2201 snort 15 0 31224 28m 2748 S 0.3 2.8 0:13.19 snort
8022 mysql 21 6 153m 68m 1440 S 0.3 6.8 1:29.81 mysqld
1 root 16 0 1684 552 476 S 0.0 0.1 0:00.98 init
2 root RT 0 0 0 0 S 0.0 0.0 0:00.02 migration/0
3 root 34 19 0 0 0 S 0.0 0.0 0:00.00 ksoftirqd/0
4 root RT 0 0 0 0 S 0.0 0.0 0:00.00 watchdog/0
5 root RT 0 0 0 0 S 0.0 0.0 0:00.16 migration/1
6 root 34 19 0 0 0 S 0.0 0.0 0:00.00 ksoftirqd/1


Kernel version 2.6.15.6 with MySQL 4.0.26 and PHP 4.4.2

Work Smoothly

Thanks again Eva2000

eva2000
Thu 9th Mar '06, 6:07am
Awesome so 2.6.15.6 is out now