We recently migrated our MySQL 5.5 community edition servers to Percona MySQ. 5.7.19. Migration went smooth. New serves have the following specification:
- 54 core CPUs
- 256 GB memory
- Mirroring (RAID 1+0) - 894GB of usable space
- CentOS 6.9
Percona MySQ. 5.7.19 was installed on new servers, which were slaved to servers running MySQL 5.5. There were no issues during the migration.
All our web properties are running perfectly, but there are two, which share code base and have similar data patters, that started showing performance decline after two weeks, which we detected using NewRelic. These sites are running in PHP. We collected some data from PMM (see attachments - they show before and after restart graphs).
Temporary solution to this problem currently is: Restarting mysql service. Note that innodb buffer pool is not saved and restored. The servers performance is restored immediately after restart.
There were other changes done during that period:
- We installed pmm-client on each server (We love PMM - Kudos to the PMM team :).
- Some of the tables were migrated from latin1 to utf8mb4 - We ran optimize on tables after data migration
This is the servers’ my.cnf file:
[mysqld]
init-file=/etc/memory_table_startup.sql
default_time_zone=US/Eastern
validate_password_policy=LOW
validate_password_length=0
sql_mode = “ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION”
server-id = 203
auto_increment_increment = 3
auto_increment_offset = 1
character-set-server=utf8mb4
collation-server=utf8mb4_unicode_ci
user=mysql
performance_schema
skip-name-resolve
autocommit=on
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
binlog_cache_size=2M
expire_logs_days=8
replicate-same-server-id = 0
max_connections=1600
max_connect_errors=999999999
key_buffer_size=16M
max_allowed_packet=16MB
table_open_cache = 10000
#sort_buffer_size = 2M
read_buffer_size = 512K
read_rnd_buffer_size = 8M
myisam_sort_buffer_size = 8M
thread_cache_size = 50
query_cache_size = 0
query_cache_type = 0
query_cache_limit= 400k
query_cache_min_res_unit= 1400
long_query_time = 1
slow_query_log_file=/var/log/mysql/slow_query.log
slow_query_log=1
log_queries_not_using_indexes = 0
tmp_table_size=128M
max_heap_table_size=128M
join_buffer_size = 32M
innodb_file_per_table
innodb_buffer_pool_size = 158640840kB
innodb_buffer_pool_instances=41
innodb_log_file_size=2G
innodb_log_buffer_size=8M
innodb_flush_log_at_trx_commit=1
write performance recommendation 5.5 performance tuning
innodb_flush_method=O_DIRECT
binlog_cache_size=1M
sync_binlog = 1
slave_load_tmpdir=/var/lib/mysql
tmpdir=/var/lib/mysql
innodb_read_io_threads=8
innodb_write_io_threads=8
innodb_io_capacity=2700
log-bin = mysql-bin
log-slave-updates
binlog-format=STATEMENT
Percona specific config
userstat=1
thread_statistics=1
query_response_time_stats = on
performance-schema-consumer-events-statements-history-long=ON
[mysql.server]
user=mysql
basedir=/usr
[client]
user=mysql
socket=/var/lib/mysql/mysql.sock
#default-character-set=utf8mb4
We also changed these variables suggested by “mysqltunner”, but reverted the changes because there were no improvements.
tmp_table_size=256M
max_heap_table_size=256M
thread_pool_size=36
join_buffer_size=32
Before this last restart innodb_buffer_pool_instances = 8.
Do you have any suggestion on what else I can try?
Thank you,
Alex Malberty
BabyCenter, LLC