# High Memory Usage on One Percona XtraDB Cluster Node (Node A) Post Restart

**URL:** <https://forums.percona.com/t/high-memory-usage-on-one-percona-xtradb-cluster-node-node-a-post-restart/37718>\
**Category:** Percona XtraDB Cluster 5.x\
**Created:** [April 24, 2025, 11:50am UTC](https://forums.percona.com/t/high-memory-usage-on-one-percona-xtradb-cluster-node-node-a-post-restart/37718 "2025-04-24T11:50:36Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![rahul\_ambekar](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/rahul_ambekar/32/18551_2.png) [@rahul\_ambekar](https://forums.percona.com/u/rahul_ambekar)\
**Post date:** [April 24, 2025, 11:50am UTC](https://forums.percona.com/t/high-memory-usage-on-one-percona-xtradb-cluster-node-node-a-post-restart/37718/1 "2025-04-24T11:50:36Z")

</div>

Hi Percona Team,

We are currently running a 4-node Percona XtraDB Cluster (Nodes A, B, C, and D) along with a slave node (Node E) replicating from master Node D. We also have two application nodes connecting to the cluster.

Recently, we performed a simultaneous MySQL service restart on all four DB nodes. Post-restart, we observed unusually high memory consumption specifically on Node A compared to the other nodes. Below is a snapshot of the memory usage across all nodes:

NodeA:  
total used free shared buff/cache available  
Mem: 62 56 5 0 0 5  
Swap: 31 0 31

Node B:  
total used free shared buff/cache available  
Mem: 62 45 17 0 0 16  
Swap: 31 0 31

Node C:  
total used free shared buff/cache available  
Mem: 62 51 10 0 0 10  
Swap: 31 0 31

Node D:  
total used free shared buff/cache available  
Mem: 62 46 15 0 0 15  
Swap: 31 10 21

Slave Node E:  
total used free shared buff/cache available  
Mem: 62 43 18 0 0 18  
Swap: 31 0 31

We did not observe any connection threshold, long-running query, or unusually high query volume alerts specific to Node A during this time.

Additionally, we’ve noticed a recurring pattern: memory consumption steadily grows over 2–3 weeks until one of the nodes (not always the same) experiences low available memory, which is temporarily resolved by restarting the MySQL service.

We are planning to implement a load balancer in the near future. Could you please advise:  
(1)What might be causing the persistent high memory usage on a specific node post-restart?  
(2)Could the issue be related to uneven query routing from the application layer?  
(3)Would introducing a load balancer help evenly distribute load and potentially resolve this issue?  
(4)Are there any memory-related configurations or diagnostics you recommend reviewing?

Your guidance will be highly appreciated to help us address this anomaly and prevent recurrence.

Please refer below my.cnf file which we are using currently in our production environment.  
Note: We have 62GB RAM memory on our server.

# Template my.cnf for PXC

# Edit to your requirements.

[mysqld]  
server-id=1  
datadir=/var/lib/mysql  
socket=/var/run/mysqld/mysqld.sock  
log-error=/var/log/mysqld.log  
pid-file=/var/run/mysqld/mysqld.pid  
log-bin  
log\_slave\_updates  
expire\_logs\_days=7  
skip-name-resolve

# Disabling symbolic-links is recommended to prevent assorted security risks

symbolic-links=0

sql\_mode = ONLY\_FULL\_GROUP\_BY,STRICT\_TRANS\_TABLES,NO\_ZERO\_IN\_DATE,ERROR\_FOR\_DIVISION\_BY\_ZERO,NO\_AUTO\_CREATE\_USER,NO\_ENGINE\_SUBSTITUTION

# innodb perf settings

innodb\_file\_per\_table=ON  
innodb\_stats\_on\_metadata = OFF  
innodb\_read\_io\_threads=16  
innodb\_write\_io\_threads=16  
innodb\_buffer\_pool\_instances=32  
innodb\_buffer\_pool\_size=40GB  
innodb\_buffer\_pool\_load\_at\_startup=ON  
innodb\_log\_file\_size = 8G # equal to 1/4 of buffer pool size  
innodb\_log\_files\_in\_group=2  
innodb\_file\_per\_table=1  
innodb\_flush\_method=O\_DIRECT  
innodb\_flush\_log\_at\_trx\_commit=2  
innodb\_thread\_concurrency = 0  
max\_connections=1000  
max\_connect\_errors=100  
max\_allowed\_packet= 32M  
max\_heap\_table\_size = 128M  
tmp\_table\_size = 128M  
thread\_cache\_size = 2000  
open\_files\_limit = 65535

# Time out setting

#wait\_timeout=300  
#interactive\_timeout = 300

Thanks and Regards,  
Rahul Ambekar  
MySQL DBA

---

<div class="post-metadata">

**Author:** ![matthewb](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/matthewb/32/34_2.png) [@matthewb](https://forums.percona.com/u/matthewb)\
**Post date:** [April 24, 2025, 1:34pm UTC](https://forums.percona.com/t/high-memory-usage-on-one-percona-xtradb-cluster-node-node-a-post-restart/37718/2 "2025-04-24T13:34:23Z")

</div>

> [@rahul\_ambekar](#):
>
> We are planning to implement a load balancer in the near future.

Be sure to make it so WRITEs only go to one node. You can spread READs evenly to other nodes.

> [@rahul\_ambekar](#):
>
> (2)Could the issue be related to uneven query routing from the application layer?

Yes. If you have PMM setup, you should be able to compare QPS to CPU/Memory quite easily.

> [@rahul\_ambekar](#):
>
> (4)Are there any memory-related configurations or diagnostics you recommend reviewing?

I would install jemalloc library as a preload library to mysql. jemalloc does a better job of managing memory than the standard libc.

---

<div class="post-metadata">

**Author:** ![rahul\_ambekar](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/rahul_ambekar/32/18551_2.png) [@rahul\_ambekar](https://forums.percona.com/u/rahul_ambekar)\
**Post date:** [April 24, 2025, 2:50pm UTC](https://forums.percona.com/t/high-memory-usage-on-one-percona-xtradb-cluster-node-node-a-post-restart/37718/3 "2025-04-24T14:50:40Z")

</div>

![image](https://us1.discourse-cdn.com/flex019/uploads/percona1/original/3X/c/4/c45243eddd6467e67e41cf5735622feafc941729.png)

Hi Matthew,

We really appreciate your quick response.  
Answering to your response:

(1) Be sure to make it so WRITEs only go to one node. You can spread READs evenly to other nodes.  
– Yes we are using only one write node.

(2)Yes. If you have PMM setup, you should be able to compare QPS to CPU/Memory quite easily.  
– We do not have PMM but we have Zabbix monitoring tool through which I got QPS and uploaded the same.  
We will try installing PMM for better MySQL performance overview.

(3)I would install jemalloc library as a preload library to mysql. jemalloc does a better job of managing memory than the standard libc.  
– We will try installing jemalloc library.

(4) Installing load balancer like HAproxy will that be helpful ?  
so that random traffic is not targeting one db node.

Thank you in advance !

Best Regards,  
Rahul Ambekar  
MySQL DBA
