mirror of
https://github.com/percona/percona-toolkit.git
synced 2025-09-23 04:25:43 +00:00
PT-1554 Improved jemalloc detection
This commit is contained in:
@@ -2254,24 +2254,19 @@ report_jemalloc_enabled() {
|
||||
local JEMALLOC_LOCATION=''
|
||||
|
||||
for PID in $(pidof mysqld); do
|
||||
grep -qc jemalloc /proc/${PID}/environ || ldd $(which mysqld) 2>/dev/null | grep -qc jemalloc
|
||||
JEMALLOC_STATUS=$?
|
||||
if [ $JEMALLOC_STATUS = 1 ]; then
|
||||
echo "jemalloc is not enabled in MySQL config for process with ID ${PID}"
|
||||
grep -qc jemalloc /proc/${pid}/environ || ldd $(which mysqld) 2>/dev/null | grep -qc jemalloc
|
||||
jemalloc_status=$?
|
||||
if [ $jemalloc_status = 1 ]; then
|
||||
echo "jemalloc is not enabled in mysql config for process with id ${pid}"
|
||||
else
|
||||
echo "jemalloc enabled in MySQL config for process with ID ${PID}"
|
||||
echo "jemalloc enabled in mysql config for process with id ${pid}"
|
||||
GENERAL_JEMALLOC_STATUS=1
|
||||
fi
|
||||
done
|
||||
|
||||
if [ $GENERAL_JEMALLOC_STATUS = 1 ]; then
|
||||
for libjemall in "/usr/lib64" "/usr/lib/x86_64-linux-gnu" "/usr/lib"; do
|
||||
if [ -r "$libjemall/libjemalloc.so.1" ]; then
|
||||
JEMALLOC_LOCATION="$libjemall/libjemalloc.so.1"
|
||||
break
|
||||
fi
|
||||
done
|
||||
if [ -z $JEMALLOC_LOCATION ]; then
|
||||
if [ $GENERAL_JEMALLOC_STATUS -eq 1 ]; then
|
||||
JEMALLOC_LOCATION=$(find /usr/lib64/ /usr/lib/x86_64-linux-gnu /usr/lib -name "libjemalloc.*" 2>/dev/null | head -n 1)
|
||||
if [ -z "$JEMALLOC_LOCATION" ]; then
|
||||
echo "Jemalloc library not found"
|
||||
else
|
||||
echo "Using jemalloc from $JEMALLOC_LOCATION"
|
||||
|
@@ -1256,26 +1256,19 @@ report_jemalloc_enabled() {
|
||||
local JEMALLOC_LOCATION=''
|
||||
|
||||
for PID in $(pidof mysqld); do
|
||||
grep -qc jemalloc /proc/${PID}/environ || ldd $(which mysqld) 2>/dev/null | grep -qc jemalloc
|
||||
JEMALLOC_STATUS=$?
|
||||
if [ $JEMALLOC_STATUS = 1 ]; then
|
||||
echo "jemalloc is not enabled in MySQL config for process with ID ${PID}"
|
||||
grep -qc jemalloc /proc/${pid}/environ || ldd $(which mysqld) 2>/dev/null | grep -qc jemalloc
|
||||
jemalloc_status=$?
|
||||
if [ $jemalloc_status = 1 ]; then
|
||||
echo "jemalloc is not enabled in mysql config for process with id ${pid}"
|
||||
else
|
||||
echo "jemalloc enabled in MySQL config for process with ID ${PID}"
|
||||
echo "jemalloc enabled in mysql config for process with id ${pid}"
|
||||
GENERAL_JEMALLOC_STATUS=1
|
||||
fi
|
||||
done
|
||||
|
||||
if [ $GENERAL_JEMALLOC_STATUS = 1 ]; then
|
||||
# Check location for libjemalloc.so.1
|
||||
#for libjemall in "${SCRIPT_PWD}/lib/mysql" "/usr/lib64" "/usr/lib/x86_64-linux-gnu" "/usr/lib"; do
|
||||
for libjemall in "/usr/lib64" "/usr/lib/x86_64-linux-gnu" "/usr/lib"; do
|
||||
if [ -r "$libjemall/libjemalloc.so.1" ]; then
|
||||
JEMALLOC_LOCATION="$libjemall/libjemalloc.so.1"
|
||||
break
|
||||
fi
|
||||
done
|
||||
if [ -z $JEMALLOC_LOCATION ]; then
|
||||
if [ $GENERAL_JEMALLOC_STATUS -eq 1 ]; then
|
||||
JEMALLOC_LOCATION=$(find /usr/lib64/ /usr/lib/x86_64-linux-gnu /usr/lib -name "libjemalloc.*" 2>/dev/null | head -n 1)
|
||||
if [ -z "$JEMALLOC_LOCATION" ]; then
|
||||
echo "Jemalloc library not found"
|
||||
else
|
||||
echo "Using jemalloc from $JEMALLOC_LOCATION"
|
||||
|
@@ -277,5 +277,3 @@ report-port = 12345
|
||||
log-error = mysqld.log
|
||||
innodb_lock_wait_timeout = 3
|
||||
# Memory management library ##################################
|
||||
Jemalloc library not found
|
||||
# The End ####################################################
|
||||
|
@@ -220,5 +220,3 @@ report-port = 12345
|
||||
log-error = mysqld.log
|
||||
innodb_lock_wait_timeout = 3
|
||||
# Memory management library ##################################
|
||||
Jemalloc library not found
|
||||
# The End ####################################################
|
||||
|
@@ -219,5 +219,3 @@ report-port = 12345
|
||||
log-error = mysqld.log
|
||||
innodb_lock_wait_timeout = 3
|
||||
# Memory management library ##################################
|
||||
Jemalloc library not found
|
||||
# The End ####################################################
|
||||
|
@@ -292,5 +292,3 @@ report-port = 12345
|
||||
log-error = mysqld.log
|
||||
innodb_lock_wait_timeout = 3
|
||||
# Memory management library ##################################
|
||||
Jemalloc library not found
|
||||
# The End ####################################################
|
||||
|
@@ -341,5 +341,3 @@ log_queries_not_using_indexes | OFF
|
||||
# Configuration File #########################################
|
||||
Config File | Cannot autodetect or find, giving up
|
||||
# Memory management library ##################################
|
||||
Jemalloc library not found
|
||||
# The End ####################################################
|
||||
|
@@ -295,5 +295,3 @@ log_queries_not_using_indexes | OFF
|
||||
# Configuration File #########################################
|
||||
Config File | Cannot autodetect or find, giving up
|
||||
# Memory management library ##################################
|
||||
Jemalloc library not found
|
||||
# The End ####################################################
|
||||
|
Reference in New Issue
Block a user