0

I am using MySQL 8.0.18 in a group replication (multi-master) infrastructure. There are currently 4 master servers connected to each other and everything seems to be working fine but over the course of around 2 weeks all mysqld process on all servers uses up all the swap. ram usage stays at 800Mb as I suspect innodb_log_buffer_size is doing its job.

Server Specs:

  • Debian 10
  • 1Gb RAM
  • 3GB SWAP
  • 20GB ssd

Mysql.cnf:

max_connections=20
innodb_log_buffer_size=800M
key_buffer_size=50M
super_read_only=off
gtid_mode = ON
enforce_gtid_consistency = ON
master_info_repository = TABLE
relay_log_info_repository = TABLE
binlog_checksum = NONE
log_slave_updates = ON
log_bin = binlog
binlog_format = ROW
transaction_write_set_extraction = XXHASH64
loose-group_replication_bootstrap_group = OFF
loose-group_replication_start_on_boot = OFF
loose-group_replication_ssl_mode = REQUIRED
loose-group_replication_recovery_use_ssl = 1
loose-group_replication_unreachable_majority_timeout=80
loose-group-replication-autorejoin-tries=2015
loose-group-replication-transaction-size-limit=0

Related OS config:

vm.swappiness=5

How do I make mysql stop using so much swap?

1
0

innodb_log_buffer_size=800M is probably using more than the available memory (after allowing for the OS, MySQL code, etc, etc).

Use the default value.

2
  • The correct answer was to purge bin logs using option like expire_logs_days
    – Ken
    Mar 20 '20 at 5:07
  • @Ken - No. -- innodb_log_buffer_size impacts RAM usage. Excessive RAM usage leads to swap. expire_logs_days controls files on disk -- nothing to do with RAM or swap.
    – Rick James
    Mar 20 '20 at 21:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.