PDA

View Full Version : Server optimization request


mindbuster
Thu 24th Nov '05, 9:35pm
1. Is this on dedicated or shared virual server.

Dedicated

2. your server specs. For example:

cpu speed/type single or dual cpus): Single P4 3.0Ghz
how much memory installed: 1024mb ram
hard drive type/configuration: 60GB SATA non raid
linux distributor or windows version: 2.4.20-021stab028.19.777-enterprise
apache/IIS version: apache 1.3.33
PHP version: php 4.3.10
MySQL version: mysql 4.0.22


3. if you use mysql 4.x instead of mysql 3.23.x, do you have any innodb type databases/tables on your server ?

No (Well, atleast not what i know of, it is set to DISABLED)

4. if possible how mysql was compiled/installed

Dunno (Likely through cpanel, but not certain about that)

5. your top stats

19:39:43 up 1 day, 5:51, 0 users, load average: 0.44, 0.49, 0.59
130 processes: 129 sleeping, 1 running, 0 zombie, 0 stopped
CPU0 states: 14.0% user 23.0% system 0.0% nice 0.0% iowait 61.0% idle
CPU1 states: 15.0% user 6.0% system 0.0% nice 0.0% iowait 78.0% idle
Mem: 1021492k av, 970620k used, 50872k free, 0k shrd, 148056k buff
297996k active, 538964k inactive
Swap: 4192880k av, 40312k used, 4152568k free 470836k cached

6. your mysql configuration variables

my.cnf content
[mysqld]
skip-innodb
skip-networking
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
max_connections = 650
key_buffer = 16M
myisam_sort_buffer_size = 64M
join_buffer_size = 1M
read_buffer_size = 1M
sort_buffer_size = 2M
table_cache = 1024
thread_cache_size = 64
wait_timeout = 10800
connect_timeout = 10
tmp_table_size = 32M
max_allowed_packet = 16M
max_connect_errors = 10
query_cache_limit = 1M
query_cache_size = 32M
query_cache_type = 1

[mysql.server]
user=mysql
basedir=/var/lib

[safe_mysqld]
err-log=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid
open_files_limit = 8192

[mysqldump]
quick
max_allowed_packet = 16M

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

The variables from adminCP:

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 10
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 DISABLED
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_buffer_pool_size 8388608
innodb_data_file_path
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 1044480
key_buffer_size 16777216
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 16776192
max_binlog_cache_size 4294967295
max_binlog_size 1073741824
max_connections 650
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 67108864
net_buffer_length 16384
net_read_timeout 30
net_retry_count 10
net_write_timeout 60
new OFF
open_files_limit 3260
pid_file /var/lib/mysql/vps.entropiaforum.com.pid
log_error
port 0
protocol_version 10
query_alloc_block_size 8192
query_cache_limit 1048576
query_cache_size 33554432
query_cache_type ON
query_prealloc_size 8192
range_alloc_block_size 2048
read_buffer_size 1044480
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 ON
skip_show_database OFF
slow_launch_time 2
socket /var/lib/mysql/mysql.sock
sort_buffer_size 2097144
sql_mode 0
table_cache 1024
table_type MYISAM
thread_cache_size 64
thread_stack 126976
tx_isolation REPEATABLE-READ
timezone EST
tmp_table_size 33554432
tmpdir /tmp/
transaction_alloc_block_size 8192
transaction_prealloc_size 4096
version 4.0.22-standard
version_comment Official MySQL RPM
version_compile_os pc-linux
wait_timeout 10800

7. your mysql extended-status

Aborted_clients 2
Aborted_connects 0
Bytes_received 553719404
Bytes_sent 4038411883
Com_admin_commands 0
Com_alter_table 0
Com_analyze 0
Com_backup_table 0
Com_begin 0
Com_change_db 175171
Com_change_master 0
Com_check 0
Com_commit 0
Com_create_db 0
Com_create_function 0
Com_create_index 0
Com_create_table 0
Com_delete 2933
Com_delete_multi 0
Com_drop_db 0
Com_drop_function 0
Com_drop_index 0
Com_drop_table 0
Com_flush 0
Com_grant 0
Com_ha_close 0
Com_ha_open 0
Com_ha_read 0
Com_insert 66272
Com_insert_select 353
Com_kill 0
Com_load 0
Com_load_master_data 0
Com_load_master_table 0
Com_lock_tables 878
Com_optimize 0
Com_purge 0
Com_rename_table 0
Com_repair 0
Com_replace 7405
Com_replace_select 0
Com_reset 0
Com_restore_table 0
Com_revoke 0
Com_rollback 0
Com_savepoint 0
Com_select 806708
Com_set_option 418
Com_show_binlog_events 0
Com_show_binlogs 0
Com_show_create 0
Com_show_databases 1
Com_show_fields 0
Com_show_grants 0
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 359
Com_show_slave_hosts 0
Com_show_slave_status 0
Com_show_status 2
Com_show_innodb_status 0
Com_show_tables 1
Com_show_variables 3
Com_slave_start 0
Com_slave_stop 0
Com_truncate 0
Com_unlock_tables 878
Com_update 190961
Connections 176165
Created_tmp_disk_tables 10014
Created_tmp_tables 23959
Created_tmp_files 0
Delayed_insert_threads 0
Delayed_writes 0
Delayed_errors 0
Flush_commands 1
Handler_commit 0
Handler_delete 25844
Handler_read_first 133370
Handler_read_key 21588268
Handler_read_next 40630366
Handler_read_prev 233069
Handler_read_rnd 15987296
Handler_read_rnd_next 2131858088
Handler_rollback 0
Handler_update 539932
Handler_write 2570438
Key_blocks_used 15586
Key_read_requests 43192827
Key_reads 21266
Key_write_requests 345318
Key_writes 188634
Max_used_connections 63
Not_flushed_key_blocks 0
Not_flushed_delayed_rows 0
Open_tables 392
Open_files 500
Open_streams 0
Opened_tables 398
Questions 2244255
Qcache_queries_in_cache 5286
Qcache_inserts 792360
Qcache_hits 815741
Qcache_lowmem_prunes 8351
Qcache_not_cached 14348
Qcache_free_memory 18202056
Qcache_free_blocks 4225
Qcache_total_blocks 15190
Rpl_status NULL
Select_full_join 1814
Select_full_range_join 0
Select_range 102632
Select_range_check 0
Select_scan 352763
Slave_open_temp_tables 0
Slave_running OFF
Slow_launch_threads 2
Slow_queries 81
Sort_merge_passes 0
Sort_range 118930
Sort_rows 32650125
Sort_scan 41705
Table_locks_immediate 2004267
Table_locks_waited 3916
Threads_cached 62
Threads_created 64
Threads_connected 2
Threads_running 1
Uptime 107772

8. is your vB the only thing on the server? or other scripts & sites which utilise php and mysql?

vBa CMPS
vBa Gallery
Numerous vB hacks

9. how many average and max concurrent users on your vB forum ? and what your cookie timeout is ?

Average: 100-150
Max: 300-350
Timeout: 900

10. create a file named phpinfo.php and place this code in it and post the url/link to it from your web site.

Here (http://www.entropiaforum.com/info.php)

11. if you run Apache and you have your own dedicated server or access to your httpd.conf (apache configuration file) can you post the values you have set for the following :

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

AND Maxrequestsperchild value = 0

12. what version of vB are you running ?

3.0.5 (patched with all security updates up to 3.0.9)

13. check to see if any files i.e. apache log files are hitting 2GB or 4GB max file size limits

None

mindbuster
Thu 24th Nov '05, 9:39pm
Requesting optimization of my.cnf and httpd.conf.

Would very much like to avoid upgrading anything. :p

eva2000
Fri 25th Nov '05, 5:33am
bad news upgrades are needed :)

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


[mysqld]
skip-networking
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
safe-show-database
skip-innodb
max_connections = 650
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 = 180
connect_timeout = 10
tmp_table_size = 64M
max_allowed_packet = 64M
max_connect_errors = 10
query_cache_limit = 1M
query_cache_size = 64M
query_cache_type = 1
query_prealloc_size = 16384
query_alloc_block_size = 16384

[mysqld_safe]
[mysql.server]
user=mysql
basedir=/var/lib
open_files_limit = 8192

[mysqldump]
quick
max_allowed_packet = 16M

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


4. Install APC Cache lastest version from http://pecl.php.net/package/APC

5. upgrade to vB 3.0.10

6. change in httpd.conf

Maxrequestsperchild value from 0 to 500

and restart apache