我最近将一个生产系统从单个MySQL实例移动到具有三个节点的Galera集群。一切似乎工作正常,但对于SELECT查询;查询性能已经大幅下降,现在处于难以忍受的一面。查询性能不佳我Galera集群
任何人都有Galera的任何性能调整提示?我是Galera的新手,我所做的设置可能是最简单的。
这是my.cnf文件的加莱拉部分:
# Galera
wsrep_provider =/usr/lib/galera/libgalera_smm.so
wsrep_cluster_address ="gcomm:// 213.179.3.90, 213.179.3.91, 213.179.3.92"
wsrep_sst_method =rsync
wsrep_cluster_name =galera_cluster
binlog_format =ROW
default_storage_engine =InnoDB
innodb_autoinc_lock_mode=2
innodb_locks_unsafe_for_binlog=1
,这里是一个查询需要永远:
SELECT
r.customerid,
r.operator,
r.account,
CAST(r.requesttype AS char),
CAST(SUM(r.nofsms) AS char),
COALESCE(r.subid1, ''),
COALESCE(r.subid2, ''),
COALESCE(r.subid3, '')
FROM
`smspro`.`smspro_cc_result` r
INNER JOIN smspro.smspro_customer sc ON sc.customerid = r.customerid
AND sc.smsproinvoice = 0
WHERE
r.status = 0
AND r.timestamp >= '2016-05-25'
AND r.timestamp < '2016-06-25'
AND r.requesttype IN (1 , 2, 4, 5)
GROUP BY r.customerid , r.operator , r.account , r.requesttype , r.subid1 , r.subid2 , r.subid3
ORDER BY r.customerid , r.operator , r.account , r.requesttype , r.subid1 , r.subid2 , r.subid3
而且一些统计
mysql> select count(*) from smspro_cc_result;
+----------+
| count(*) |
+----------+
| 9170870 |
+----------+
mysql> show index from smspro_cc_result;
+------------------+------------+---------------+--------------+-------------+-----------+-------------+----------+--------+------+------------+---------+---------------+
| Table | Non_unique | Key_name | Seq_in_index | Column_name | Collation | Cardinality | Sub_part | Packed | Null | Index_type | Comment | Index_comment |
+------------------+------------+---------------+--------------+-------------+-----------+-------------+----------+--------+------+------------+---------+---------------+
| smspro_cc_result | 0 | PRIMARY | 1 | smsproid | A | 8825169 | NULL | NULL | | BTREE | | |
| smspro_cc_result | 1 | idx_sms_req_1 | 1 | customerid | A | 14757 | NULL | NULL | | BTREE | | |
| smspro_cc_result | 1 | idx_sms_req_2 | 1 | timestamp | A | 4412584 | NULL | NULL | | BTREE | | |
| smspro_cc_result | 1 | idx_sms_req_3 | 1 | customerid | A | 18233 | NULL | NULL | | BTREE | | |
| smspro_cc_result | 1 | idx_sms_req_3 | 2 | msisdn | A | 8825169 | NULL | NULL | | BTREE | | |
| smspro_cc_result | 1 | idx_sms_req_3 | 3 | timestamp | A | 8825169 | NULL | NULL | | BTREE | | |
| smspro_cc_result | 1 | idx_sms_req_5 | 1 | msisdn | A | 8825169 | NULL | NULL | | BTREE | | |
+------------------+------------+---------------+--------------+-------------+-----------+-------------+----------+--------+------+------------+---------+---------------+
难道我在这里忘记了任何东西或是所有背景材料?
“查询”含义是“SELECT”还是所有查询? –
就我所知,SELECT是问题。系统生成数据似乎没有问题;这是报道,已经受到重创,成绩显着。 – koenig
你是CPU绑定还是磁盘绑定?这些机器与前一台服务器相媲美吗?特别是关于磁盘性能和内存,还有内核的类型和数量? 'innodb_buffer_pool_size'可比吗? –