As a database engineer, I need to perform some DBA tasks, and accessing the desk and running some old-style scripts is still required. Besides the best solution if you are living in the cloud is to use some compute instances.
AWS EC2 comes in handy, however, to get the best out of your instance, you should tune your EBS volume and your instance to increase speed, reliability and fault-tolerant
We have an external replication stream from an Aurora cluster to the MySQL server version 5.7.29
The ec2 instance used is
Following are the best settings that I tuned to get the best performance out of the server
MySQL variable configurations
System variables
The innodb_flush_sync variable, which is enabled by default, causes the innodb_io_capacity setting to be ignored during bursts of I/O activity that occur at checkpoints. To adhere to the I/O rate defined by the innodb_io_capacity setting, disable innodb_flush_sync
sync_binlog=0: Disables synchronization of the binary log to disk by the MySQL server. Instead, the MySQL server relies on the operating system to flush the binary log to disk from time to time as it does for any other file. This setting provides the best performance, but in the event of a power failure or operating system crash, it is possible that the server has committed transactions that have not been synchronized to the binary log.
sync_binlog=1: Enables synchronization of the binary log to disk before transactions are committed. This is the safest setting but can have a negative impact on performance due to the increased number of disk writes. In the event of a power failure or operating system crash, transactions that are missing from the binary log are only in a prepared state. This permits the automatic recovery routine to roll back the transactions, which guarantees that no transaction is lost from the binary log.
- innodb_log_compressed_pages is enabled by default to prevent corruption that could occur if a different version of the zlib compression algorithm is used during recovery. If you are certain that the zlib version is not subject to change, you can disable innodb_log_compressed_pages to reduce redo log generation for workloads that modify compressed data.
How was the performances tests done
- IOSTAT
- IFTOP
- Is the audit_log on the server? - Disable
- is the perf_schema on? - Disable
- Run i/o disk performance test sudo fio --directory=/mnt/db_main/stress-test/ --name fio_test_file --direct=1 --rw=randwrite --bs=16k --size=1G --numjobs=16 --time_based --runtime=900 --group_reporting --norandommap