我们目前在几台机器上运行了900个WordPress博客,因此决定使用集群db加载平衡环境。
我遵循http://www.percona.com/doc/percona-xtradb-cluster/5.5/howtos/cenots_howto.html的指示,安装在Percona的XtraDB和导入的DB转储的3个节点上,总DB的大小约为40 GB。
现在,如果DB查询中没有插入,并且一切正常,但是如果我们开始在节点上执行一些插入(每秒4-10个插入),所有查询都会开始非常显着地减慢读写速度。
硬件:
Intel(R) Core(TM) i7 CPU 950 3.07GHz,内存26 GB
Xeon E5-2670 0@ 2.60GHz,内存64 GB
my.conf
[mysqld]
datadir=/var/lib/mysql
user=mysql
wsrep_provider=/usr/lib64/libgalera_smm.so
wsrep_cluster_address=gcomm://192.168.0.93,192.168.0.94,192.168.0.95
binlog_format=ROW
default_storage_engine=InnoDB
innodb_autoinc_lock_mode=2
# Node #2 address
wsrep_node_address=192.168.0.94
# Cluster name
wsrep_cluster_name=my_centos_cluster
# SST method
wsrep_sst_method=xtrabackup
#Authentication for SST method
wsrep_sst_auth="sstuser:s3cret"
innodb_log_file_size = 50331648
# Bellow begins different testing values
wait_timeout=20
interactive_timeout=30
key_buffer_size=256M
query_cache_limit=256M
sort_buffer_size=128M
read_rnd_buffer_size=128M
tmp_table_size=1G
max_heap_table_size=1G
innodb_file_per_table=1
innodb_data_file_path = ibdata1:512M:autoextend
innodb_fast_shutdown = 0
innodb_buffer_pool_size = 6144M
innodb_buffer_pool_instances = 4
innodb_read_io_threads = 64
innodb_write_io_threads = 64
# CACHES AND LIMITS #
max_connections = 200
thread_cache_size = 50
open_files_limit = 65535
table_definition_cache = 1024
table_open_cache = 2048
innodb_flush_log_at_trx_commit = 2
innodb_flush_method=O_DSYNC
#autocommit=OFF
sync_binlog=0
innodb_thread_concurrency = 0
innodb_io_capacity = 5000
bulk_insert_buffer_size = 256M
innodb_locks_unsafe_for_binlog=1
innodb_stats_on_metadata=0有什么问题吗?机器运行在同一个局域网中,延迟~0.1ms
集群部署在OpenVZ虚拟化下。
发布于 2014-07-07 20:44:59
Galera/Percona XtraDB集群是一种提供高可用性、可伸缩性和完全一致性的解决方案。虽然在某些情况下,它可以提供一些写入缩放(主要是由于SQL编写不好),但它没有重点关注它,因为它不提供分片,因此它必须以(实际上)同步方式写入所有节点。这点很重要来决定加雷拉是否适合你。
尽管如此,在您的设置中有一些评论:
https://dba.stackexchange.com/questions/69391
复制相似问题