PDA

View Full Version : Server Optimization Request


kwrd
Mon 21st Nov '05, 9:04pm
Can you please check this out and see if there's anything we should be doing differently?

1. dedicated or shared virual server.
DEDICATED

2. server specs:
dual xeon 3 processor with hyperthreading


Processor #1 Vendor: GenuineIntel
Processor #1 Name: Intel(R) Xeon(TM) CPU 3.06GHz
Processor #1 speed: 3065.876 MHz
Processor #1 cache size: 512 KBProcessor #2 Vendor: GenuineIntel
Processor #2 Name: Intel(R) Xeon(TM) CPU 3.06GHz
Processor #2 speed: 3065.876 MHz
Processor #2 cache size: 512 KBProcessor #3 Vendor: GenuineIntel
Processor #3 Name: Intel(R) Xeon(TM) CPU 3.06GHz
Processor #3 speed: 3065.876 MHz
Processor #3 cache size: 512 KBProcessor #4 Vendor: GenuineIntel
Processor #4 Name: Intel(R) Xeon(TM) CPU 3.06GHz
Processor #4 speed: 3065.876 MHz
Processor #4 cache size: 512 KB

Memory: 2GB RAM
2067340k/2096576k available (1619k kernel code, 28848k reserved, 1195k data, 168k init, 1179072k highmem)

hard drive type/configuration:
2 x 40gb IDE + 1 60gb IDE
Disk hda5 (/)
Disk hda1 (/boot)
Disk hda8 (/home)
Disk hda7 (/tmp)
Disk hda2 (/usr)
Disk hda3 (/var)
Disk hdb1 (/backup)
Disk hdc1 (/home2)

Machine type: i686
linux distributor or windows version:linux Fedora core 1
apache/IIS version:apache 1.3.34 (Unix)
PHP version:php 4.3.11
MySQL version: mysql 4.0.25 - standard


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

4. if possible how mysql was compiled/installed Cpanel install

5. your top stats
15:26:27 up 2 days, 12:01, 1 user, load average: 1.27, 1.41, 0.95
163 processes: 161 sleeping, 1 running, 1 zombie, 0 stopped
CPU states: cpu user nice system irq softirq iowait idle
total 1.6% 0.0% 2.8% 0.0% 0.0% 0.0% 395.2%
cpu00 1.9% 0.0% 2.8% 0.0% 0.0% 0.0% 95.2%
cpu01 0.0% 0.0% 0.0% 0.0% 0.0% 0.0% 100.0%
cpu02 0.0% 0.0% 0.0% 0.0% 0.0% 0.0% 100.0%
cpu03 0.0% 0.0% 0.0% 0.0% 0.0% 0.0% 100.0%
Mem: 2067672k av, 2000044k used, 67628k free, 0k shrd, 150612k buff
1151612k active, 556884k inactive
Swap: 2096440k av, 133328k used, 1963112k free 480836k cached


6. your mysql configuration variables

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 800
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 4010
pid_file /var/lib/mysql/wardwebworks.digitalscrapbookplace.com.pid
log_error
port 3306
protocol_version 10
query_alloc_block_size 8192
query_cache_limit 1048576
query_cache_size 16777216
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 EST
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


7. your mysql extended-status output



Aborted_clients 1805
Aborted_connects 7
Bytes_received 701714175
Bytes_sent 2655495971
Com_admin_commands 76
Com_alter_table 0
Com_analyze 0
Com_backup_table 0
Com_begin 172
Com_change_db 599821
Com_change_master 0
Com_check 0
Com_commit 172
Com_create_db 0
Com_create_function 0
Com_create_index 0
Com_create_table 0
Com_delete 53401
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 73195
Com_insert_select 207
Com_kill 0
Com_load 0
Com_load_master_data 0
Com_load_master_table 0
Com_lock_tables 25978
Com_optimize 2
Com_purge 0
Com_rename_table 0
Com_repair 0
Com_replace 96027
Com_replace_select 0
Com_reset 0
Com_restore_table 0
Com_revoke 0
Com_rollback 0
Com_savepoint 0
Com_select 4522550
Com_set_option 13716
Com_show_binlog_events 0
Com_show_binlogs 0
Com_show_create 0
Com_show_databases 15
Com_show_fields 2574
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 778
Com_show_slave_hosts 0
Com_show_slave_status 0
Com_show_status 3
Com_show_innodb_status 0
Com_show_tables 53
Com_show_variables 40
Com_slave_start 0
Com_slave_stop 0
Com_truncate 0
Com_unlock_tables 13149
Com_update 314684
Com_update_multi 88
Connections 506299
Created_tmp_disk_tables 20359
Created_tmp_tables 199416
Created_tmp_files 1843
Delayed_insert_threads 0
Delayed_writes 0
Delayed_errors 0
Flush_commands 1
Handler_commit 0
Handler_delete 49558
Handler_read_first 865108
Handler_read_key 197946940
Handler_read_next 1093389086
Handler_read_prev 4494875
Handler_read_rnd 589394418
Handler_read_rnd_next 1769544500
Handler_rollback 0
Handler_update 74224661
Handler_write 49783050
Key_blocks_used 7793
Key_read_requests 338672807
Key_reads 914641
Key_write_requests 430623
Key_writes 317722
Max_used_connections 23
Not_flushed_key_blocks 0
Not_flushed_delayed_rows 0
Open_tables 64
Open_files 123
Open_streams 0
Opened_tables 55052
Questions 18161339
Qcache_queries_in_cache 4512
Qcache_inserts 3427341
Qcache_hits 11939359
Qcache_lowmem_prunes 821285
Qcache_not_cached 1095121
Qcache_free_memory 6914320
Qcache_free_blocks 1428
Qcache_total_blocks 10730
Rpl_status NULL
Select_full_join 686
Select_full_range_join 0
Select_range 253037
Select_range_check 0
Select_scan 713908
Slave_open_temp_tables 0
Slave_running OFF
Slow_launch_threads 1
Slow_queries 5
Sort_merge_passes 920
Sort_range 275266
Sort_rows 591358163
Sort_scan 218910
Table_locks_immediate 8173613
Table_locks_waited 6255
Threads_cached 0
Threads_created 506298
Threads_connected 4
Threads_running 1
Uptime 235519


8. is your vB the only thing on the server? or other scripts & sites which utilise php and mysql? Also are using PhotoPost PHP 5.2 vB3 Enhanced photo gallery and 123 Flash Chat chat room

9. Average concurrent users: 200
Maximum concurrent users: 700
Cookie timeout: 1200

10. phpinfo.php file link:
http://www.digitalscrapbookplace.com/phpinfo.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 10
MaxClients 150
AND Maxrequestsperchild value = 0


12. what version of vB are you running ? 3.5.1

13. check to see if any files i.e. apache log files are hitting 2GB or 4GB max file size limits i.e. see if you have max file size exceeded messages in apache error log

find: /proc/4850: No such file or directory
find: /proc/5380/fd: No such file or directory
find: /proc/5496/fd/4: No such file or directory
find: /proc/5814/fd: No such file or directory
find: /proc/6355: No such file or directory
/backup/cpbackup/weekly/digital.tar.gz
/backup/cpbackup/monthly/digital.tar.gz

eva2000
Tue 22nd Nov '05, 3:55am
try the following

1. 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
2. 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 = 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 = 180
connect_timeout = 10
tmp_table_size = 128M
max_allowed_packet = 64M
max_connect_errors = 10
thread_concurrency = 4
query_cache_limit = 2M
query_cache_size = 96M
query_cache_type = 1
query_prealloc_size = 16384
query_alloc_block_size = 16384

[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


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

4. Change httpd.conf value for

Maxrequestsperchild value to 500

restart apache server

kwrd
Mon 28th Nov '05, 12:03am
Lately we've been having extremely high memory usage, which has been causing the site to crash on an almost-daily basis (which is why I posted this thread in the first place). After passing your suggestions on to our web host, they said none of these items would effect the memory usage.

Do you agree?
Do you have any suggestions that would help with the high memory usage?

eva2000
Mon 28th Nov '05, 7:50am
how high is high for memory usage ? can you post top stats from ssh telnet ?

yes the settings above can help memory usage as you were running on mysql default settings which table_cache when set too small can lead to memory swapping to disk.. not that the new my.cnf i suggested above has higher table_cache value it can help lower potential for swapping to disk but can also increase memory usage (in the right way due to higher allocation to other mysql memory buffers)

basically you want to implement my suggestions and then in 24-72hrs time come back and repost output from question #6 and #7 as well as ssh telnet top stats