chkserv.d mutiple commands per service???

x-man

Well-Known Member
Jan 25, 2004
118
0
166
I have big problem with mysql+memcached, if mysql crash for few seconds, php/apache continue to work and because I have bad php cms it simple caching bad things because can`t get data from mysql and when mysql again start to work (auto restart with chkserv) I have blank homepage because I have bad cache in memcached!

Now I want to auto reload memcached after mysql restart, is it possible?

in /etc/chkserv.d for mysql I have this:
service[mysql]=x,x,x,/usr/local/cpanel/scripts/restartsrv_mysql;/etc/init.d/memcached reload,mysql,mysql

but this simple don`t working, mysql start to work but memcached not reloaded after it, look like second command "/etc/init.d/memcached reload" not executed because mysql start to work after first command!? Is this true or I have some other problem?

How to reload memcached after mysql start/re-start?

Thanks.
 

x-man

Well-Known Member
Jan 25, 2004
118
0
166
reload command working fine but look like chkserv simple stop with first command (mysql restart) if mysql start to work...

I need this because mysql sometimes crashing because on backup TOTAL RAM usage go up from <20GB to over 30GB and mysql process virutal mem usage go up to 25GB+ from ~10GB, I still checking why, in my.cnf I have set total maximum memory usage ~20GB , result from tuning-primer.sh:
MEMORY USAGE
Max Memory Ever Allocated : 9.87 G
Configured Max Per-thread Buffers : 10.35 G
Configured Max Global Buffers : 9.51 G
Configured Max Memory Limit : 19.86 G
Physical Memory : 31.32 G
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,913
2,201
363
I recommend resolving the issue that is causing MySQL to fail that often. You may want to post on our Optimization forums for assistance with troubleshooting the MySQL failures.

Thank you.
 

x-man

Well-Known Member
Jan 25, 2004
118
0
166
Yes, I need to fix it but also I need option to execute multiple commands per service in chkserv.d, is that possible?
On every mysql restart/start I need to reload memcached, is that possible?

Thanks.
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,913
2,201
363
You could try using the "&" symbol rather than a comma when adding the additional command. EX:

Code:
/usr/local/cpanel/scripts/restartsrv_mysql & /etc/init.d/memcached reload
Or, you could manually edit "/usr/local/cpanel/scripts/restartsrv_mysql" to reload memcached.

Thank you.