Mysql 5.6.10配置

标签 mysql centos database-performance my.cnf

数据库服务器

16 cores 
63Gb RAM 
CentOS release 6.8

etc/my.cnf

[mysqld]
pid_file=/var/lib/mysql/fatty01.pid

datadir=/var/lib/mysql 
socket=/var/lib/mysql/mysql.sock
user=mysql

innodb_buffer_pool_size = 50G
innodb_log_file_size = 2G
innodb_flush_log_at_trx_commit = 0
sync_binlog = 0
innodb_flush_method = O_DIRECT
innodb_buffer_pool_instances = 16
innodb_thread_concurrency = 16
skip_name_resolve = 1 
innodb_io_capacity = 4000
innodb_io_capacity_max = 6000
innodb_buffer_pool_dump_at_shutdown = 1
innodb_buffer_pool_load_at_startup = 1
query_cache_size = 0
query_cache_type = OFF
innodb_checksum_algorithm = crc32
table_open_cache_instances = 16
innodb_read_io_threads = 20
innodb_write_io_threads = 10
max_connections = 700

when we have peaks of 3000 concurrent clients the mysqld does not seem to pull all the resources posibles from the machine.

New relic

我看到负载为 40,但 cpu 似乎没有超过 60%

That reflects in the front end server

enter image description here

** 我的问题很明确,如何在不影响服务器的情况下提高性能?还有如何减少前端服务器的 MYSQL 等待时间,因为显然是数据库服务器端的配置问题。 **

**

UPDATE After research the problem seem to be in the slow queries, so I guess this configuration is optimal for this hardware

**

最佳答案

不,这不太可能是简单的调整更改。正如我所说,my.cnf 看起来不错 -- 基于有限的信息。

根据图表,突然发生了一些事情。或者一连串的事件。

开启slowlog,设置long_query_time=1,等到问题再次发生,再用pt-query-digest告诉你调皮的query。

关于Mysql 5.6.10配置,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38765807/

相关文章:

php - 使用不同的值更新多行 SQL

php - 具有两个值匹配的MySQL查询

mysql - 意外的字符串转换为十六进制

mysql - 如何在 Spring JpaRepository 中使用自定义 DTO 进行可分页响应

linux - 在 CentOS 上为 Linux 内核 4.14 安装实时内核

linux - 如何编辑 PYTHONPATH?

linux - libstdc++.so.6 缺少更高版本的 GLIBCXX 和 CXXABI,无法更新

mysql - 从 Mysql 中选择一种方法而不是另一种方法来获取数据的复杂性

Mysql 在非常大的表上计算性能

python - 处理两列值的两表连接