Skip to content

Commit

Permalink
add ReportingDBParameters DB parameter group to data stack template
Browse files Browse the repository at this point in the history
[ci skip]
  • Loading branch information
wjordan committed May 10, 2018
1 parent 101fbfd commit e028163
Showing 1 changed file with 61 additions and 0 deletions.
61 changes: 61 additions & 0 deletions aws/cloudformation/data.yml.erb
Original file line number Diff line number Diff line change
Expand Up @@ -107,3 +107,64 @@ Resources:
TableMappings: !Sub |
<%= table_mappings.to_json %>
<% end -%>
ReportingDBParameters:
Type: AWS::RDS::DBParameterGroup
Properties:
Description: !Sub "Reporting Read Replica DB Parameters for ${AWS::StackName}."
Family: mysql5.7
Parameters:
# Allow redo log to grow larger before flushing for better write I/O efficiency.
innodb_adaptive_flushing_lwm: 40
# Improve insert/update concurrency for autoincrement tables.
innodb_autoinc_lock_mode: 2
# Reduce durability for better performance.
innodb_flush_log_at_trx_commit: 0
# Neighbor flushing reduces performance without any benefit on SSD.
innodb_flush_neighbors: 0
# IO capacity controls background flushing rate (IO/sec).
innodb_io_capacity: 1000
# IO capacity max controls maximum background flushing rate when certain thresholds are reached.
innodb_io_capacity_max: 3000
# Larger log buffer size allows larger transactions without writing to disk.
innodb_log_buffer_size: <%=16.megabytes%>
# Larger redo log file size allows write combining for better write I/O efficiency.
innodb_log_file_size: <%=2.gigabytes%>
# LRU scan depth controls LRU flushing rate (IO/sec).
innodb_lru_scan_depth: 1000
# Enable all InnoDB performance schema monitors for better debugging.
innodb_monitor_enable: all
# Random read ahead can improve overall read-query performance, important for reporting.
innodb_random_read_ahead: 1
# Increase number of threads for background reads (read-ahead)
innodb_read_io_threads: 8
# Increase sample pages for more accurate statistics for query plans.
innodb_stats_persistent_sample_pages: 60
# 'Splits an internal data structure used to coordinate threads, for higher concurrency in workloads with large numbers of waiting threads.'
# AWS recommended increasing to max (1024).
innodb_sync_array_size: 1024
# Number of threads for background writes
innodb_write_io_threads: 8
# Reporting DB currently needs write access for contact rollup staging table.
read_only: 0
# Don't resolve DNS on usernames.
skip_name_resolve: 1
# Use compression for replication.
slave_compressed_protocol: 1
# Enable parallel replication.
slave_parallel_workers: 8
# Enable parallel replication without violating consistency.
slave_parallel_type: LOGICAL_CLOCK
slave_preserve_commit_order: 1
# Enable slow query log.
slow_query_log: 1
# Reduce durability for better performance.
sync_binlog: 0
# Fully cache all open tables and table definitions.
table_definition_cache: 20000
table_open_cache: 20000
# Relax transaction isolation for improved concurrency under load.
tx_isolation: READ-COMMITTED
# Requirements for DMS Change Data Capture.
# Ref: https://docs.aws.amazon.com/dms/latest/userguide/CHAP_Source.MySQL.html#CHAP_Source.MySQL.AmazonManaged
binlog_format: ROW
binlog_checksum: NONE

0 comments on commit e028163

Please sign in to comment.