mchen
June 28, 2025, 2:38pm
1
I’m updating my mysqlcheck.sh to:
#!/bin/sh
[[ -f /etc/sysconfig/argos ]] && . /etc/sysconfig/argos
declare -x HOME=/root
MYSQLBIN=/usr/bin/mysql
[[ -L /usr/bin/mysql ]] && MYSQLBIN=“$(readlink /usr/bin/mysql)”
MAXCONN=${MYSQL_MAXCONN:-100}
CONNECTED=$(echo ‘show status where variable_name = “Threads_connected”;’ | “$MYSQLBIN” --connect-timeout=10 -rq --column-names=false | awk ‘{print $2}’)
Don’t trigger a restart if MySQL is starting up…
[[ -z $CONNECTED || $CONNECTED -lt $MAXCONN ]]
RET=$?
echo $CONNECTED
exit $RET
As we handle a lot of concurrent connections, although it keeps reverting to 40 max connections, which is constantly killing my MySQL process.
That file may not be directly modified. To increase the connection threshold, create a file named /etc/sysconfig/argos if it does not already exist. In it add the following line:
MYSQL_MAXCONN=100
mchen
June 28, 2025, 4:31pm
3
Got it, just made the change. Thank you.
mchen
August 29, 2025, 10:54am
4
Seems like the file was reverted back to 40 again even after creating the file “argos” in the folder: /etc/sysconfig/
[root@apiscp sysconfig]# cat /etc/sysconfig/argos
MYSQL_MAXCONN=500
lgtm.
[[ -f /etc/sysconfig/argos ]] && . /etc/sysconfig/argos
declare -x HOME=/root
MYSQLBIN=/usr/bin/mysql
[[ -L /usr/bin/mysql ]] && MYSQLBIN="$(readlink /usr/bin/mysql)"
MAXCONN=${MYSQL_MAXCONN:-40}
Sample code to test:
[[ -f /etc/sysconfig/argos ]] && . /etc/sysconfig/argos
MAXCONN=${MYSQL_MAXCONN:-40}
echo $MAXCONN
500 is reported.
mchen
August 29, 2025, 2:24pm
6
I’m a fool, I see it works. Thank you.
1 Like