私はOVH上に2台のサーバを持っていますが、それらはヨーロッパの異なるデータセンターにあります(SBG1とGRA1)。私の制御されたpingは10msです。 私のウェブサイトでは、多くの挿入と読み取りのクエリが実行されています。リモートmysqlサーバでより高速なクエリを作成するには
ローカルのmysqlサーバを試すと非常に高速ですが、リモートのmysqlサーバを使用するとクエリの実行が遅くなります。
マイリモートMySQL設定
# Percona Server template configuration
[mysqld]
# Remove leading # to set options mainly useful for reporting servers.
# The server defaults are faster for transactions and fast SELECTs.
# Adjust sizes as needed, experiment to find the optimal values.
# join_buffer_size = 128M
# sort_buffer_size = 2M
# read_rnd_buffer_size = 2M
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
# Disabling symbolic-links is recommended to prevent assorted security risks
symbolic-links=0
pid-file=/var/run/mysqld/mysqld.pid
skip-name-resolve
bind-address = 5.196.77.XXX
# skip-networking
sql-mode = 'NO_AUTO_CREATE_USER'
explicit_defaults_for_timestamp = 1
# MyISAM #
key_buffer_size = 2G
# SAFETY #
max_allowed_packet = 10G
# CACHES AND LIMITS #
tmp_table_size = 32M
max_heap_table_size = 32M
query_cache_type = 1
query_cache_size = 2M
query_cache_limit = 1M
join_buffer_size = 6M
max_connections = 600
thread_cache_size = 100
open_files_limit = 65535
table_definition_cache = 4096
table_open_cache = 4096
# INNODB #
innodb_flush_method = O_DIRECT
innodb_log_files_in_group = 2
innodb_log_file_size = 512M
innodb_flush_log_at_trx_commit = 1
innodb_file_per_table = 1
innodb_buffer_pool_size = 20G
innodb_data_file_path =ibdata1:20M:autoextend
# LOGGING #
log_error = /var/log/mysql/mysql-error.log
log-queries-not-using-indexes = 1
slow_query_log = 1
long_query_time = 3
slow_query_log_file = /var/log/mysql/mysql-slow.log
私は、各サーバーのローカル接続を接続する方法を知りません。
私はvRackを使用する必要がありますか? (私は持っているが、わからない) または サーバを同じ場所に移動する必要がありますか?
私は
サーバーを移動する前に、レプリケーションを試しましたか? –
私は以前にそれを疲れたことはありません – Tan