Debugging MySQL Memory Alerts: When innodb_buffer_pool_size Isn't the Whole Story

Image
Posted on MySQL Ninjas | August 2026 Every DBA has been there. An alert fires. You SSH into the box, run free -h , and see MySQL consuming far more RAM than you configured. You double-check innodb_buffer_pool_size . It's set correctly. So where is the memory going? This is the story of debugging exactly that — on a Google Cloud c4d-standard-4 instance with 14.7 GB RAM, MySQL configured with a 7168 MB buffer pool, and mysqld RSS sitting at 10.4 GB . That's a 3.2 GB gap nobody could explain. The Setup We run a large MySQL fleet on GCP — over 200 DR replica nodes across three datacenters. As part of a buffer pool tuning project (fitting the right pool size to the right machine class), we set innodb_buffer_pool_size = 7168 MB on our c4d-standard-4 nodes (16 GB RAM, 14.7 GB usable). Shortly after, memory alerts started firing. When I looked at what was actually happening: $ ps aux | grep mysqld | awk '{print $6/1024 " MB"}' 10490 MB ...

MySQL BLACKHOLE Engine as Replication Filter



Today, I am going to tell very interesting use-case where we have used Blackhole engine as replication filter.

We have an Aurora Cluster(let's call it C1) where multiple db's are hosted and multiple applications are writing data into it. While in another project one application wanted to read the data from one of the db's hosted on aurora cluster C1 & this new project is hosted into another account.

Now the challenge is we don't want self hosted db which supports replication filters(replicate-do-db) and bring only one db while wanted to use aurora only to in the new project as per the company standards, But problem is Aurora DB doesn't support native replication filters So we were not able to setup replication.
To solve this problem we tried multiple approaches:

Approach 1: Introducing intermediate Slave with replication filters, But using this approach we were introducing more infra and node management and that too self hosted will DB.

Approach 2: Use AWS DMS service which is able to solve our problem easily, But it became quite costly.

Approach 3: Use Blackhole engine and replicate only desired DB. The BLACKHOLE storage engine acts as a “black hole” that accepts data but throws it away and does not store it. Retrievals always return an empty result. This approach is quite cool which is using MySQL native replication and not introducing any new tool in between so less management of infra and nodes.
We followed below steps to setup:

Step 1: Create a new aurora cluster(let's call it C2) from C1 cluster snapshots while don't setup replication from C1.

Step 2: Take full DB dump of DB we want to restore and schema dump for rest of the DB's from C2 and restore on the cluster where new project has to be pointed.

Step 3: alter all the tables and set engine to blackhole except DB we want to replicate.

Step 4: Start replication from co-ordinates found during aurora creation.

And we are done.

Comments

Post a Comment

Popular posts from this blog

Azure VM Application Consistent MySQL DB Disk Snapshots

Debugging MySQL Memory Alerts: When innodb_buffer_pool_size Isn't the Whole Story

MongoDB InPlace Version Upgrade 3.4x to 3.6x