Hello there.
I’m preparing to upgrade our Percona Server 5.7 cluster to Percona Server 8 and I figured that on the new machines, I would follow the advice in https://www.percona.com/blog/dont-start-using-your-mysql-server-until-youve-configured-your-os/
However, the Jemalloc stuff is giving me some headaches. When testing on lab servers, everything looks fine after installing libjemalloc2 (from Ubuntu repos) and Percona Server 5.7:
# dpkg -l |egrep "(percona|jem)" |awk '{print $2,$3}'
libjemalloc2:amd64 5.2.1-4ubuntu1
percona-release 1.0-27.generic
percona-server-client-5.7 5.7.44-48-1.jammy
percona-server-common-5.7 5.7.44-48-1.jammy
percona-server-server-5.7 5.7.44-48-1.jammy
percona-toolkit 3.2.1-1
# pt-mysql-summary | grep -A5 -i "memory management"
# Memory management library ##################################
jemalloc enabled in mysql config for process with id 9823
Using jemalloc from /usr/lib/x86_64-linux-gnu/libjemalloc.so.2
# The End ####################################################
# grep -i jem /proc/$(pidof mysqld)/maps
7ff2a4e71000-7ff2a4e77000 r--p 00000000 08:01 73744 /usr/lib/x86_64-linux-gnu/libjemalloc.so.2
7ff2a4e77000-7ff2a4f14000 r-xp 00006000 08:01 73744 /usr/lib/x86_64-linux-gnu/libjemalloc.so.2
7ff2a4f14000-7ff2a4f21000 r--p 000a3000 08:01 73744 /usr/lib/x86_64-linux-gnu/libjemalloc.so.2
7ff2a4f21000-7ff2a4f22000 ---p 000b0000 08:01 73744 /usr/lib/x86_64-linux-gnu/libjemalloc.so.2
7ff2a4f22000-7ff2a4f27000 r--p 000b0000 08:01 73744 /usr/lib/x86_64-linux-gnu/libjemalloc.so.2
7ff2a4f27000-7ff2a4f28000 rw-p 000b5000 08:01 73744 /usr/lib/x86_64-linux-gnu/libjemalloc.so.2
But, when I rip out Percona Server 5.7 and install version 8, jemalloc is no longer enabled:
# pt-mysql-summary | grep -A5 -i "memory management"
# Memory management library ##################################
jemalloc is not enabled in mysql config for process with id 12453
# The End ####################################################
After some searching, I ended up adding LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libjemalloc.so.2
to /etc/default/mysql and restarted mysqld, and now I get:
# grep -i jem /proc/$(pidof mysqld)/maps
7f26349a1000-7f26349a7000 r--p 00000000 fd:00 6820 /usr/lib/x86_64-linux-gnu/libjemalloc.so.2
7f26349a7000-7f2634a44000 r-xp 00006000 fd:00 6820 /usr/lib/x86_64-linux-gnu/libjemalloc.so.2
7f2634a44000-7f2634a51000 r--p 000a3000 fd:00 6820 /usr/lib/x86_64-linux-gnu/libjemalloc.so.2
7f2634a51000-7f2634a52000 ---p 000b0000 fd:00 6820 /usr/lib/x86_64-linux-gnu/libjemalloc.so.2
7f2634a52000-7f2634a57000 r--p 000b0000 fd:00 6820 /usr/lib/x86_64-linux-gnu/libjemalloc.so.2
7f2634a57000-7f2634a58000 rw-p 000b5000 fd:00 6820 /usr/lib/x86_64-linux-gnu/libjemalloc.so.2
But pt-mysql-summary
doesn’t say that it is enabled:
# pt-mysql-summary | grep -A5 -i "memory management"
# Memory management library ##################################
# The End ####################################################
Any ideas here? Is it enabled or not? The “system” appears to think so, but not the tool from percona-toolkit.