PDA

View Full Version : Server Optimization Request


rockergrrl
Thu 19th Apr '07, 12:04pm
I have a managed customer of mine that has a fairly popular forum, but we want to make sure if their server can be optimized further (that it already is) or if in reality they need to just upgrade their server.

So any help would be greatly appreciated!


Information as requested:

1. Dedicated

2.
cpu speed/type single or dual cpus): P4 3.0ghz HT
how much memory installed: 2GB
hard drive type/configuration: 2x160GB SATA - no raid
linux distributor or windows version: CentOS 4.4
apache/IIS version: apache 1.3.37
PHP version: php 4.4.5
MySQL version: mysql 4.1.21-standard

3. 3.5.5

4. YES (cPanel server)
5. (normal cPanel specs)
6. (CPU usage was around 15 - he just closed his forum before releasing it to us)

top - 10:49:41 up 29 days, 18:23, 3 users, load average: 2.16, 2.03, 3.63
Tasks: 249 total, 1 running, 248 sleeping, 0 stopped, 0 zombie
Cpu0 : 7.8% us, 5.8% sy, 0.0% ni, 13.6% id, 72.8% wa, 0.0% hi, 0.0% si
Cpu1 : 40.6% us, 4.0% sy, 0.0% ni, 33.7% id, 21.8% wa, 0.0% hi, 0.0% si
Mem: 2074736k total, 2046404k used, 28332k free, 31740k buffers
Swap: 1052248k total, 121260k used, 930988k free, 739024k cached

7.
[mysqld]
safe-show-database
old_passwords
back_log = 75
skip-innodb
max_connections = 1000
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 = 64M
max_heap_table_size = 64M
max_allowed_packet = 64M
max_connect_errors = 10
read_rnd_buffer_size = 524288
bulk_insert_buffer_size = 8M
query_cache_limit = 3M
query_cache_size = 80M
query_cache_type = 1
query_prealloc_size = 163840
query_alloc_block_size = 32768
default-storage-engine = MyISAM
old-passwords = 1

[mysqld_safe]
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


8. | net_retry_count | 10 |
| net_write_timeout | 60 |
| new | OFF |
| old_passwords | ON |
| open_files_limit | 5010 |
| pid_file | /var/lib/mysql/ok.mixq8.com.pid |
| port | 3306 |
| preload_buffer_size | 32768 |
| prepared_stmt_count | 0 |
| protocol_version | 10 |
| query_alloc_block_size | 32768 |
| query_cache_limit | 3145728 |
| query_cache_min_res_unit | 4096 |
| query_cache_size | 83886080 |
| query_cache_type | ON |
| query_cache_wlock_invalidate | OFF |
| query_prealloc_size | 163840 |
| range_alloc_block_size | 2048 |
| read_buffer_size | 1044480 |
| read_only | OFF |
| read_rnd_buffer_size | 520192 |
| relay_log_purge | ON |
| relay_log_space_limit | 0 |
| rpl_recovery_rank | 0 |
| secure_auth | OFF |
| server_id | 0 |
| skip_external_locking | ON |
| skip_networking | OFF |
| skip_show_database | OFF |
| slave_net_timeout | 3600 |
| slave_transaction_retries | 0 |
| slow_launch_time | 2 |
| socket | /var/lib/mysql/mysql.sock |
| sort_buffer_size | 2097144 |
| sql_mode | |
| sql_notes | ON |
| sql_warnings | ON |
| storage_engine | MyISAM |
| sync_binlog | 0 |
| sync_frm | ON |
| sync_replication | 0 |
| sync_replication_slave_id | 0 |
| sync_replication_timeout | 0 |
| system_time_zone | EDT |
| table_cache | 1800 |
| table_type | MyISAM |
| thread_cache_size | 384 |
| thread_stack | 196608 |
| time_format | %H:%i:%s |
| time_zone | SYSTEM |
| tmp_table_size | 67108864 |
| tmpdir | |
| transaction_alloc_block_size | 8192 |
| transaction_prealloc_size | 4096 |
| tx_isolation | REPEATABLE-READ |
| version | 4.1.21-standard |
| version_comment | MySQL Community Edition - Standard (GPL) |
| version_compile_machine | i686 |
| version_compile_os | pc-linux-gnu |
| wait_timeout | 90 |
+---------------------------------+------------------------------------------+
+----------------------------+------------+
| Variable_name | Value |
+----------------------------+------------+
| Aborted_clients | 25 |
| Aborted_connects | 5 |
| Binlog_cache_disk_use | 0 |
| Binlog_cache_use | 0 |
| Bytes_received | 81176854 |
| Bytes_sent | 3136204324 |
| Com_admin_commands | 3 |
| Com_alter_db | 0 |
| Com_alter_table | 0 |
| Com_analyze | 1 |
| Com_backup_table | 0 |
| Com_begin | 0 |
| Com_change_db | 35605 |
| Com_change_master | 0 |
| Com_check | 138 |
| 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 | 10126 |
| 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 | 3 |
| Com_grant | 2 |
| Com_ha_close | 0 |
| Com_ha_open | 0 |
| Com_ha_read | 0 |
| Com_help | 0 |
| Com_insert | 11518 |
| Com_insert_select | 73 |
| Com_kill | 0 |
| Com_load | 0 |
| Com_load_master_data | 0 |
| Com_load_master_table | 0 |
| Com_lock_tables | 196 |
| Com_optimize | 139 |
| Com_preload_keys | 0 |
| Com_prepare_sql | 0 |
| Com_purge | 0 |
| Com_purge_before_date | 0 |
| Com_rename_table | 0 |
| Com_repair | 1 |
| Com_replace | 718 |
| 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 | 112455 |
| Com_set_option | 141 |
| Com_show_binlog_events | 0 |
| Com_show_binlogs | 1 |
| Com_show_charsets | 10 |
| Com_show_collations | 10 |
| Com_show_column_types | 0 |
| Com_show_create_db | 0 |
| Com_show_create_table | 0 |
| Com_show_databases | 6 |
| Com_show_errors | 0 |
| Com_show_fields | 0 |
| Com_show_grants | 9 |
| 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 | 25 |
| Com_show_slave_hosts | 0 |
| Com_show_slave_status | 0 |
| Com_show_status | 10 |
| Com_show_storage_engines | 0 |
| Com_show_tables | 15 |
| Com_show_variables | 50 |
| Com_show_warnings | 0 |
| Com_slave_start | 0 |
| Com_slave_stop | 0 |
| Com_stmt_close | 0 |
| Com_stmt_execute | 0 |
| Com_stmt_prepare | 0 |
| Com_stmt_reset | 0 |
| Com_stmt_send_long_data | 0 |
| Com_truncate | 0 |
| Com_unlock_tables | 127 |
| Com_update | 11220 |
| Com_update_multi | 1 |
| Connections | 27883 |
| Created_tmp_disk_tables | 20 |
| Created_tmp_files | 4154 |
| Created_tmp_tables | 24800 |
| Delayed_errors | 0 |
| Delayed_insert_threads | 0 |
| Delayed_writes | 0 |
| Flush_commands | 1 |
| Handler_commit | 0 |
| Handler_delete | 1378 |
| Handler_discover | 0 |
| Handler_read_first | 5302 |
| Handler_read_key | 40159429 |
| Handler_read_next | 72727603 |
| Handler_read_prev | 36347 |
| Handler_read_rnd | 118396 |
| Handler_read_rnd_next | 297194654 |
| Handler_rollback | 0 |
| Handler_update | 18011910 |
| Handler_write | 4711437 |
| Key_blocks_not_flushed | 0 |
| Key_blocks_unused | 0 |
| Key_blocks_used | 7248 |
| Key_read_requests | 63907642 |
| Key_reads | 458250 |
| Key_write_requests | 21172 |
| Key_writes | 13737 |
| Max_used_connections | 54 |
| Not_flushed_delayed_rows | 0 |
| Open_files | 700 |
| Open_streams | 0 |
| Open_tables | 503 |
| Opened_tables | 1083 |
| Qcache_free_blocks | 2253 |
| Qcache_free_memory | 64131104 |
| Qcache_hits | 209226 |
| Qcache_inserts | 89864 |
| Qcache_lowmem_prunes | 0 |
| Qcache_not_cached | 22580 |
| Qcache_queries_in_cache | 5343 |
| Qcache_total_blocks | 13213 |
| Questions | 419532 |
| Rpl_status | NULL |
| Select_full_join | 2160 |
| Select_full_range_join | 0 |
| Select_range | 18635 |
| Select_range_check | 0 |
| Select_scan | 16298 |
| Slave_open_temp_tables | 0 |
| Slave_retried_transactions | 0 |
| Slave_running | OFF |
| Slow_launch_threads | 0 |
| Slow_queries | 156 |
| Sort_merge_passes | 2076 |
| Sort_range | 7388 |
| Sort_rows | 39133423 |
| Sort_scan | 28102 |
| Table_locks_immediate | 203746 |
| Table_locks_waited | 3610 |
| Threads_cached | 51 |
| Threads_connected | 3 |
| Threads_created | 54 |
| Threads_running | 1 |
| Uptime | 7496 |
+----------------------------+------------+
Uptime: 7496 Threads: 3 Questions: 419533 Slow queries: 156 Opens: 1083 Flush tables: 1 Open tables: 503 Queries per second avg: 55.968
mysqladmin Ver 8.41 Distrib 4.1.21, for pc-linux-gnu on i686
Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB
This software comes with ABSOLUTELY NO WARRANTY. This is free software,
and you are welcome to modify and redistribute it under the GPL license

Server version 4.1.21-standard
Protocol version 10
Connection Localhost via UNIX socket
UNIX socket /var/lib/mysql/mysql.sock
Uptime: 2 hours 4 min 56 sec

Threads: 3 Questions: 419533 Slow queries: 156 Opens: 1083 Flush tables: 1 Open tables: 503 Queries per second avg: 55.968


9. Yes10. Average: 500-600 Max: 7100

11. http://www.mixq8.com/vb/phpinfo.php

12.

KeepAlive Off
MaxKeepAliveRequests 120
KeepAliveTimeout 6
MinSpareServers 15
MaxSpareServers 20
StartServers 15
MaxClients 512
Maxrequestsperchild 500

13. No

14. uname -a:
Linux ok.mixq8.com 2.6.9-42.0.3.ELsmp #1 SMP Fri Oct 6 06:21:39 CDT 2006 i686 i686 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

cat /proc/cpuinfo:

processor : 0
vendor_id : GenuineIntel
cpu family : 15
model : 4
model name : Intel(R) Pentium(R) 4 CPU 3.00GHz
stepping : 1
cpu MHz : 3001.962
cache size : 1024 KB
physical id : 0
siblings : 2
core id : 0
cpu cores : 1
fdiv_bug : no
hlt_bug : no
f00f_bug : no
coma_bug : no
fpu : yes
fpu_exception : yes
cpuid level : 5
wp : yes
flags : fpu vme de pse tsc msr pae mce cx8 apic mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe pni monitor ds_cpl cid xtpr
bogomips : 6004.00

processor : 1
vendor_id : GenuineIntel
cpu family : 15
model : 4
model name : Intel(R) Pentium(R) 4 CPU 3.00GHz
stepping : 1
cpu MHz : 3001.962
cache size : 1024 KB
physical id : 0
siblings : 2
core id : 0
cpu cores : 1
fdiv_bug : no
hlt_bug : no
f00f_bug : no
coma_bug : no
fpu : yes
fpu_exception : yes
cpuid level : 5
wp : yes
flags : fpu vme de pse tsc msr pae mce cx8 apic mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe pni monitor ds_cpl cid xtpr
bogomips : 5999.39

rockergrrl
Fri 20th Apr '07, 7:54am
No one, eh? :/

eva2000
Sat 21st Apr '07, 12:20pm
You're swapping to disk somewhat

Try the following in this exact order. You can ignore any of the suggestions that you have already done.

1. Upgrade MySQL server to 4.1.22
2. Upgrade PHP to 4.4.6 and/or recompile PHP 4.4.6 after upgrading MySQL
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
old_passwords
back_log = 75
skip-innodb
max_connections = 500
key_buffer = 16M
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 = 30
connect_timeout = 10
tmp_table_size = 64M
max_heap_table_size = 64M
max_allowed_packet = 64M
max_connect_errors = 10
thread_concurrency = 2
read_rnd_buffer_size = 524288
bulk_insert_buffer_size = 8M
query_cache_limit = 3M
query_cache_size = 48M
query_cache_type = 1
query_prealloc_size = 131072
query_alloc_block_size = 65536
default-storage-engine = MyISAM

[mysqld_safe]
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. OR try the alternative PHP caching software, Xcache which seems to be a bit faster than APC Cache - http://www.vbulletin.com/forum/showthread.php?t=213267

5. Ugrade to vB 3.5.8 http://www.vbulletin.com/forum/showthread.php?t=221903 if you're on vB 3.5.x.

6. If you just upgraded to vB 3.5.x/3.6.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

7. Edit httpd.conf values from

KeepAlive Off
MaxKeepAliveRequests 120
KeepAliveTimeout 6
MinSpareServers 15
MaxSpareServers 20
StartServers 15
MaxClients 512
Maxrequestsperchild 500

to

KeepAlive On
MaxKeepAliveRequests 120
KeepAliveTimeout 4
MinSpareServers 15
MaxSpareServers 20
StartServers 15
MaxClients 150
Maxrequestsperchild 1000

restart apache

rockergrrl
Sat 21st Apr '07, 12:33pm
Thanks George!

Customer said the only reason why he hasn't upgraded to the newest version of vB, is because he had mods, that don't have upgraded versions for the newest release -- but has updated the board for security/bug fixes.

Still suggest to upgrade to 3.5.8?

Thanks again!

eva2000
Sun 22nd Apr '07, 8:39pm
should be okay where he is for now