WordPress Optimization « WordPress Codex:: Jump to Virtual / Dedicated Server⠎: In this hosting scenario you have control over your own server. The server might be a dedicated piece of hardware http://codex.wordpress.org/WordPress_OptimizationHOME | Hi eva2000, I got this new Windows server, so not sure whether you can help me, I guess you can only help me with the mysql optimisation? Correct me if I am wrong, anyway here's the informations you need.
1. Is this on dedicated or shared virual server. If shared, how many sites share this server (ask web host if needed)
Dedicated server owned by me. There is 5 website currently on this server and will slowly increase.
2. your server specs. For example:
cpu speed/type single or dual cpus): Intel Pentium 4 3.2Ghz with HT
how much memory installed: 2G ram
hard drive type/configuration: 160G SATA hdd
linux distributor or windows version: Windows 2003 Server Standard Edition
apache/IIS version: IIS 6
PHP version: php 4.4.0
MySQL version: mysql 4.1.13a
3. if you use mysql 4.x instead of mysql 3.23.x, do you have any innodb type databases/tables on your server?
Yes, some database/tables using innodb
4. if possible how mysql was compiled/installed
Download and installed windows version of mysql
5. your top stats
No top command for windows?
6. your mysql configuration variables
Variable_name Value
back_log 50
basedir E:MySQL
binlog_cache_size 32768
bulk_insert_buffer_size 8388608
character_set_client latin1
character_set_connection latin1
character_set_database latin1
character_set_results latin1
character_set_server latin1
character_set_system utf8
character_sets_dir E:MySQLsharecharsets/
collation_connection latin1_swedish_ci
collation_database latin1_swedish_ci
collation_server latin1_swedish_ci
concurrent_insert ON
connect_timeout 5
datadir E:MySQLData
date_format %Y-%m-%d
datetime_format %Y-%m-%d %H:%i:%s
default_week_format 0
delay_key_write ON
delayed_insert_limit 100
delayed_insert_timeout 300
delayed_queue_size 1000
expire_logs_days 0
flush OFF
flush_time 1800
ft_boolean_syntax + -><()~*:""&
ft_max_word_len 84
ft_min_word_len 4
ft_query_expansion_limit 20
ft_stopword_file (built-in)
group_concat_max_len 1024
have_archive NO
have_bdb NO
have_blackhole_engine NO
have_compress YES
have_crypt NO
have_csv NO
have_example_engine NO
have_geometry YES
have_innodb YES
have_isam NO
have_ndbcluster NO
have_openssl NO
have_query_cache YES
have_raid NO
have_rtree_keys YES
have_symlink YES
init_connect
init_file
init_slave
innodb_additional_mem_pool_size 2097152
innodb_autoextend_increment 8
innodb_buffer_pool_awe_mem_mb 0
innodb_buffer_pool_size 49283072
innodb_data_file_path ibdata1:10M:autoextend
innodb_data_home_dir
innodb_fast_shutdown ON
innodb_file_io_threads 4
innodb_file_per_table OFF
innodb_flush_log_at_trx_commit 1
innodb_flush_method
innodb_force_recovery 0
innodb_lock_wait_timeout 50
innodb_locks_unsafe_for_binlog OFF
innodb_log_arch_dir
innodb_log_archive OFF
innodb_log_buffer_size 1048576
innodb_log_file_size 25165824
innodb_log_files_in_group 2
innodb_log_group_home_dir .
innodb_max_dirty_pages_pct 90
innodb_max_purge_lag 0
innodb_mirrored_log_groups 1
innodb_open_files 300
innodb_table_locks ON
innodb_thread_concurrency 8
interactive_timeout 28800
join_buffer_size 131072
key_buffer_size 26214400
key_cache_age_threshold 300
key_cache_block_size 1024
key_cache_division_limit 100
language E:MySQLshareenglish
large_files_support ON
license GPL
local_infile ON
log OFF
log_bin OFF
log_error .dreamer.err
log_slave_updates OFF
log_slow_queries OFF
log_update OFF
log_warnings 1
long_query_time 10
low_priority_updates OFF
lower_case_file_system OFF
lower_case_table_names 1
max_allowed_packet 1048576
max_binlog_cache_size 4294967295
max_binlog_size 1073741824
max_connect_errors 10
max_connections 100
max_delayed_threads 20
max_error_count 64
max_heap_table_size 16777216
max_insert_delayed_threads 20
max_join_size 4294967295
max_length_for_sort_data 1024
max_relay_log_size 0
max_seeks_for_key 4294967295
max_sort_length 1024
max_tmp_tables 32
max_user_connections 0
max_write_lock_count 4294967295
myisam_data_pointer_size 4
myisam_max_extra_sort_file_size 107374182400
myisam_max_sort_file_size 107374182400
myisam_recover_options OFF
myisam_repair_threads 1
myisam_sort_buffer_size 36700160
named_pipe OFF
net_buffer_length 16384
net_read_timeout 30
net_retry_count 10
net_write_timeout 60
new OFF
old_passwords ON
open_files_limit 622
pid_file E:MySQLDatadreamer.pid
port 3306
preload_buffer_size 32768
protocol_version 10
query_alloc_block_size 8192
query_cache_limit 1048576
query_cache_min_res_unit 4096
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 61440
read_only OFF
read_rnd_buffer_size 258048
relay_log_purge ON
relay_log_space_limit 0
rpl_recovery_rank 0
secure_auth OFF
shared_memory OFF
shared_memory_base_name MYSQL
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
sort_buffer_size 262136
sql_mode
storage_engine InnoDB
sql_notes ON
sql_warnings ON
sync_binlog 0
sync_replication 0
sync_replication_slave_id 0
sync_replication_timeout 0
sync_frm ON
system_time_zone Malay Peninsula Standard Time
table_cache 256
table_type InnoDB
thread_cache_size 8
thread_stack 196608
time_format %H:%i:%s
time_zone SYSTEM
tmp_table_size 18874368
tmpdir
transaction_alloc_block_size 8192
transaction_prealloc_size 4096
tx_isolation REPEATABLE-READ
version 4.1.13a-nt
version_comment Official MySQL binary
version_compile_machine ia32
version_compile_os Win32
wait_timeout 28800
7. your mysql extended-status output
Variable_name Value
Aborted_clients 614
Aborted_connects 1
Binlog_cache_disk_use 0
Binlog_cache_use 0
Bytes_received 13470347
Bytes_sent 69741753
Com_admin_commands 0
Com_alter_db 0
Com_alter_table 10
Com_analyze 0
Com_backup_table 0
Com_begin 0
Com_change_db 394
Com_change_master 0
Com_check 186
Com_checksum 0 Managed Dedicated Servers, Dedicated Linux Server Hosting | IvyCat :: Need the power of a dedicated server, but don't have the time or expertise to be Complete Installation, Configuration, Updating & Optimization of standard If you're running WordPress on your site, make sure to check out the new http://www.ivycat.com/hosting/managed-dedicated-servers/HOME |
Com_commit 0
Com_create_db 2
Com_create_function 0
Com_create_index 2
Com_create_table 190
Com_dealloc_sql 0
Com_delete 976
Com_delete_multi 0
Com_do 0
Com_drop_db 1
Com_drop_function 0
Com_drop_index 0
Com_drop_table 95
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 1438
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 188
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 249
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 32968
Com_set_option 33826
Com_show_binlog_events 0
Com_show_binlogs 6
Com_show_charsets 30
Com_show_collations 30
Com_show_column_types 0
Com_show_create_db 0
Com_show_create_table 5
Com_show_databases 23
Com_show_errors 0
Com_show_fields 140
Com_show_grants 6
Com_show_innodb_status 0
Com_show_keys 132
Com_show_logs 0
Com_show_master_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 127
Com_show_variables 77
Com_show_warnings 0
Com_slave_start 0
Com_slave_stop 0
Com_stmt_prepare 0
Com_stmt_execute 0
Com_stmt_send_long_data 0
Com_stmt_reset 0
Com_stmt_close 0
Com_truncate 0
Com_unlock_tables 0
Com_update 2069
Com_update_multi 0
Connections 594
Created_tmp_disk_tables 553
Created_tmp_files 1091
Created_tmp_tables 1188
Delayed_errors 0
Delayed_insert_threads 0
Delayed_writes 0
Flush_commands 1
Handler_commit 384
Handler_delete 14
Handler_discover 0
Handler_read_first 22569
Handler_read_key 166411
Handler_read_next 293739
Handler_read_prev 0
Handler_read_rnd 40472
Handler_read_rnd_next 539102
Handler_rollback 552
Handler_update 14782
Handler_write 86703
Key_blocks_not_flushed 0
Key_blocks_unused 22483
Key_blocks_used 12
Key_read_requests 52707
Key_reads 613
Key_write_requests 18034
Key_writes 45
Max_used_connections 3
Not_flushed_delayed_rows 0
Open_files 42
Open_streams 0
Open_tables 120
Opened_tables 4083
Qcache_free_blocks 0
Qcache_free_memory 0
Qcache_hits 0
Qcache_inserts 0
Qcache_lowmem_prunes 0
Qcache_not_cached 0
Qcache_queries_in_cache 0
Qcache_total_blocks 0
Questions 73595
Rpl_status NULL
Select_full_join 1208
Select_full_range_join 0
Select_range 262
Select_range_check 0
Select_scan 18960
Slave_open_temp_tables 0
Slave_running OFF
Slave_retried_transactions 0
Slow_launch_threads 0
Slow_queries 0
Sort_merge_passes 17
Sort_range 630
Sort_rows 31894
Sort_scan 11038
Table_locks_immediate 44883
Table_locks_waited 0
Threads_cached 1
Threads_connected 2
Threads_created 3
Threads_running 1
Uptime 1556186
8. is your vB the only thing on the server? or other scripts & sites which utilise php and mysql?
Yes, there is also phpbb and ipb
9. how many average and max concurrent users on your vB forum ? and what your cookie timeout is ?
Currently below 100 but will be expecting 100-250 users soon. Cookie timeout is 3600.
10. phpinfo.php
http://www.lovebites.sg/info/
11. Not applicable for my server since using Windows
12. what version of vB are you running ?
2 of my site both using v3.5.3
13. Not applicable for my server since using Windows
Hope to hear from you soon eva2000! Thanks!
Well a few things to do in this order
1. Upgrade MySQL server to 4.1.16
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
old_passwords
back_log = 50
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 = 64M
max_allowed_packet = 64M
max_connect_errors = 10
read_rnd_buffer_size = 524288
bulk_insert_buffer_size = 8M
thread_concurrency = 2
query_cache_limit = 1M
query_cache_size = 64M
query_cache_type = 1
query_prealloc_size = 16384
query_alloc_block_size = 16384
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. If you just upgraded to vB 3.5.x try to disable these 4 options if there are any load issues:
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
just a curious qns eva2000, not sure if you can help... how do i upgrade mysql on windows? do i just download the executable to the server and install it and it will auto detect existing version and upgrade accordingly?
Same goes for php?
by the way eva2000, i notice that the my.cnf you mention above... can I use the same settings you recommend for my Windows version of MySQL (using my.ini instead of my.cnf)
No. Never use the installer to install mysql or php. Install manually. Same for upgrading.
I just wrote this article for installing mysql (http://adminreports.com/archives/2006/01/24/installing-mysql.html) on Windows.
You should be able follow those directions to upgrade mysql or you could wait until I finish my upgrading mysql on Windows Server article tommorrow.
i found another article on how to upgrade mysql... just like what you mention. Thanks!
So same goes for PHP? Had to installed it manually?
remove sync_frm = 1 that's not needed
for innodb is that some tables ? what uses innodb ?
by the way eva2000, i notice that the my.cnf you mention above... can I use the same settings you recommend for my Windows version of MySQL (using my.ini instead of my.cnf)
Yes you can. Just add that to my.ini. Make sure you leave you data and mysql path instact.
Install manually. I also have PHP install on Windows article on the same site.
the safest way to convert would be to mysqldump the innodb databases out to sql file
then while default storage engine is set at MYISAM in my.cnf, create new empty mysql databases and import the mysqldump'd sql file into them again...
hmm can i leave my existing database alone then? (there is only 2-3 of them)
by the way does innodb performs better then myisam? other then taking up resources...
Weird... i use eva2000's configuration... i cannot connect to two database...
safe-show-database
old_passwords
sync_frm = 1
shows as invalid option...
so i corrected old_passwords to old-passwords but still have difficulty connecting to database so in the end i use back the old original my.ini
whats wrong here?
you need to add back the innodb config settings in my.cnf try this
if you really don't need innodb change back to myisam format as you won't use as much memory/disk/server resources as innodb does
Hmm just wondering why my vbuletin uses innodb?
Is it because my original settings has default-storage-engine=INNODB?
I also noticed that the configuration file (where i set my database for my vbulletin) got this new parameter of pointing to a my.ini or my.cnf, do i need to turn it on?
remove sync_frm = 1 that's not needed
for innodb is that some tables ? what uses innodb ?
hi eva2000,
I still got problem connecting (vbulletin got database error so after changing back to default my.ini, it can runs again) even though I use the below :
[mysqld]
basedir=C:/path/to/mysql
datadir=C:/path/to/mysql data
safe-show-database
old_passwords
back_log = 50
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 = 64M
max_allowed_packet = 64M
max_connect_errors = 10
read_rnd_buffer_size = 524288
bulk_insert_buffer_size = 8M
thread_concurrency = 2
query_cache_limit = 1M
query_cache_size = 64M
query_cache_type = 1
query_prealloc_size = 16384
query_alloc_block_size = 16384
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
i got database using innodb... even my vbulletin database is using innodb. I notice there is a setting skip-innodb. Could that be the problem?
Anyway this is the original my.ini settings :
[client]
port=3306
[mysql]
default-character-set=latin1
[mysqld]
port=3306
basedir="C:/path/to/mysql"
datadir="C:/path/to/mysql data"
default-character-set=latin1
default-storage-engine=INNODB
max_connections=100
query_cache_size=0
table_cache=256
tmp_table_size=7M
thread_cache_size=8
myisam_max_sort_file_size=100G
myisam_max_extra_sort_file_size=100G
myisam_sort_buffer_size=12M
key_buffer_size=8M
read_rnd_buffer_size=256K
sort_buffer_size=256K
#skip-innodb
innodb_additional_mem_pool_size=2M
innodb_flush_log_at_trx_commit=1
innodb_log_buffer_size=1M
innodb_buffer_pool_size=10M
innodb_log_file_size=10M
old-passwords
yeah you can leave the innodb databases alone but would need to move the data files outside of mysql data directory so you can disable innodb i.e. /var/lib/mysql/dbname
where dbname is the name of innodb database
MyISAM performance is faster than innodb.. only benefit innodb has for vB use is helps for mysql table locking if there's high concurrency connections to the same database table name i.e. post/postindex/thread tables
you need to add back the innodb config settings in my.cnf try this
[mysqld]
basedir=C:/path/to/mysql
datadir=C:/path/to/mysql data
safe-show-database
old_passwords
back_log = 50
#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 = 64M
max_allowed_packet = 64M
max_connect_errors = 10
read_rnd_buffer_size = 524288
bulk_insert_buffer_size = 8M
thread_concurrency = 2
query_cache_limit = 1M
query_cache_size = 64M
query_cache_type = 1
query_prealloc_size = 16384
query_alloc_block_size = 16384
default-storage-engine = MyISAM
innodb_additional_mem_pool_size=2M
innodb_flush_log_at_trx_commit=1
innodb_log_buffer_size=1M
innodb_buffer_pool_size=10M
innodb_log_file_size=10M
[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
if you really don't need innodb change back to myisam format as you won't use as much memory/disk/server resources as innodb does
okies things working good now. Thanks eva2000!
PS: How do i convert those database that is using innodb to myisam now...
I have found that what works in my.ini for Linux won't work well with Windows. Here is what I have in mine. My hardware specs are the same as your except I have 3.0 processors.
Just change the paths and this one should work well for you.
cool, Thanks! By the way i got innodb tables... do i need to add anything on top of your settings?
No. Never use the installer to install mysql or php. Install manually. Same for upgrading.
I just wrote this article for installing mysql (http://adminreports.com/archives/2006/01/24/installing-mysql.html) on Windows.
You should be able follow those directions to upgrade mysql or you could wait until I finish my upgrading mysql on Windows Server article tommorrow.
I have found that what works in my.ini for Linux won't work well with Windows. Here is what I have in mine. My hardware specs are the same as your except I have 3.0 processors.
[mysqld]
basedir=C:/mysql
datadir=C:/mysql/data
skip-locking
max_connections = 500
key_buffer_size = 64M
max_allowed_packet = 32M
sort_buffer_size = 2M
join_buffer_size = 2M
read_buffer_size = 2M
table_cache = 1024
thread_cache_size = 1064
wait_timeout=600
connect_timeout = 10
max_connect_errors = 10
thread_concurrency = 4
myisam_sort_buffer_size = 64M
query_cache_limit = 1M
query_cache_size = 32M
query_cache_type = 1
server-id = 1
old-passwords
[mysql]
no-auto-rehash
[isamchk]
key_buffer = 64M
sort_buffer = 64M
read_buffer = 2M
write_buffer = 2M
[myisamchk]
key_buffer = 64M
sort_buffer = 64M
read_buffer = 2M
write_buffer = 2M
[mysqlhotcopy]
interactive-timeout
Just change the paths and this one should work well for you.
the safest way to convert would be to mysqldump the innodb databases out to sql file
then while default storage engine is set at MYISAM in my.cnf, create new empty mysql databases and import the mysqldump'd sql file into them again...
Yes you can. Just add that to my.ini. Make sure you leave you data and mysql path instact.
Install manually. I also have PHP install on Windows article on the same site.
Thanks AWS, you have been very helpful. :)
Where was the last debate on wednesday with Mccain and Obama?
INSTANCE / WAITING FOR SPRING
|