Answer the question
In order to leave comments, you need to log in
How to configure MQSQL server to reduce query execution time?
Friends, please advise.
On the Wordpress site, posts are filtered by taxonomies and custom fields. It is clear that meta_query is traditionally slow, but there is a caveat. On the local Open Server, the request, depending on the complexity, takes from 0.5 to 4.5 seconds.
And on VDS hosting, a complex request takes from 25 to 45 seconds, and it may not be executed at all!
I'm more than sure that the matter is in the hosting MYSQL settings. Please let me know what settings to look out for.
MQSQL hosting SETTINGS
symbolic-links=0
skip-external-locking
key_buffer_size = 32M
max_allowed_packet = 16M
table_open_cache = 10000
sort_buffer_size = 2M
read_buffer_size = 2M
read_rnd_buffer_size = 2M
= 1M
net_buffer_length thread_stack = 240K
myisam_max_sort_file_size = 256M
#innodb_use_native_aio = 0
innodb_file_per_table
max_connections = 64
max_user_connections = 20
wait_timeout = 10
interactive_timeout = 50
long_query_time = 5
SET OPEN SERVER-a, which is fast:
character_set_server = utf8mb4
collation_server = utf8mb4_unicode_ci
datadir = "% dprogdir %\\userdata\\%mysql_driver%"
default_authentication_plugin = mysql_native_password
default_storage_engine = InnoDB
explicit_defaults_for_timestamp = 1
ft_min_word_len = 3
local_infile = 0
lower_case_table_names = 1
max_allowed_packet = 256M
mysqlx = 0
pid_file = "%dprogdir%\\userdata\\temp\\mysql.pid"
port = %mysqlport%
secure-file-priv = "%dprogdir%\\userdata\\ temp\\upload"
#skip_name_resolve = 1
skip-ssl
tmpdir = "%dprogdir%\\userdata\\temp"
# Buffer Settings
bulk_insert_buffer_size = 8M
join_buffer_size = 2M
read_buffer_size = 2M
read_rnd_buffer_size = 4M
sort_buffer_size = 2M
Connection Settings #
max_connections = 64
max_connect_errors = 32
back_log = 128
thread_cache_size = 8
interactive_timeout = 180
wait_timeout = 180
# InnoDB Settings
innodb_adaptive_hash_index = 0
innodb_buffer_pool_instances = 1
innodb_buffer_pool_size = 128M
innodb_data_file_path = ibdata1: 10M: autoextend
innodb_data_home_dir = "% dprogdir userdata% \\ \ \%mysql_driver%"
innodb_file_per_table = 1
#innodb_force_recovery = 1
innodb_log_file_size = 64M
innodb_read_io_threads = 8
#innodb_thread_concurrency = 4
innodb_write_io_threads = 8
# Logging
%log%general_log = 1
%log%general_log_file = "%dprogdir%\\userdata\\logs\\%mysql_driver%_queries.log"
log_error = "%dprogdir%\\ userdata\\logs\\%mysql_driver%_error.log"
skip-log-bin
#log_queries_not_using_indexes = 1
#long_query_time = 5
#slow_query_log = 1
#slow_query_log_file = "%dprogdir%\\userdata\\logs\\%mysql_driver%_slow. log"
# MyISAM Settings
key_buffer_size = 32M
myisam_max_sort_file_size = 256M
myisam_recover_options = the backup, force
# the Table the Settings
table_definition_cache = 10000
table_open_cache = 10000
open_files_limit = 60000
max_heap_table_size = 128M
tmp_table_size = 128M
[the mysqldump]
quick
quote_names
the max_allowed_packet = 16M
[ `myisamchk ']
key_buffer_size = 64M
sort_buffer_size = 64M
read_buffer = 2M
write_buffer = 2M
[mysqld_safe]
open_files_limit = 60000
What can you tell me?
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question