Hi Folks,
We’re moving up from PXC8.0 to PXC8.4 and have noticed that the initial memory usage of the mysqld process in PXC8.4 seems much higher compared to, say, PXC8.0.35.
Example running on a 32GB RAM RHEL8.10 server where we allow mysql pretty much 80% of system ram for innodb_buffer_pool - these are the only innodb settings we explicitly set in my.cnf:
# INNODB #
innodb-flush-method = O_DIRECT
innodb-log-files-in-group = 2
innodb-log-file-size = 1024M
innodb-flush-log-at-trx-commit = 2
innodb-file-per-table = 1
innodb-buffer-pool-size = 25347M
innodb_buffer_pool_instances = 3
innodb_autoinc_lock_mode = 2
On startup in PXC8.0.35 (and with no connections or workload and essentially empty DB) the mysqld process consumes around 2.7GB RAM (as reported by top) but in PXC8.4.3 its using 22.8GB right off the bat.
We would find that, in PXC8.0.35, over time and under load the mysqld process would obviously consume up to and beyond 25GB RAM but I’m interested to know if anything obvious has changed in PXC8.4 to account for it seemingly grabbing the memory up front.
The “How MySQL Uses Memory” chapter in the official MySQL docs states that " InnoDB allocates memory for the entire buffer pool at server startup, using malloc() operations." in both the 8.0 and 8.4 variants.
Is it the case then that PXC8.0 is in the wrong here and should have been grabbing the memory straight away?
If its useful I did a pt-config-diff of the ‘innodb%’ variables from both versions:
[root@qatest1 ~]# pt-config-diff /tmp/pxc8035.cnf /tmp/pxc843.cnf
12 config differences
Variable /tmp/pxc8035.cnf /tmp/pxc843.cnf
========================= ================ ===============
innodb_adaptive_hash_i... ON OFF
innodb_buffer_pool_in_... ON OFF
innodb_change_buffering all none
innodb_doublewrite_files 6 2
innodb_doublewrite_pages 4 128
innodb_io_capacity 200 10000
innodb_io_capacity_max 2000 20000
innodb_log_buffer_size 16777216 67108864
innodb_numa_interleave OFF ON
innodb_purge_threads 4 1
innodb_use_fdatasync OFF ON
innodb_version 8.0.35-27 8.4.3-3
Thanks in advance for any pointers/wisdom.
Neil