The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

chkserv.d mutiple commands per service???

Discussion in 'General Discussion' started by x-man, Oct 3, 2013.

  1. x-man

    x-man Well-Known Member

    Joined:
    Jan 25, 2004
    Messages:
    118
    Likes Received:
    0
    Trophy Points:
    16
    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.
     
  2. kernow

    kernow Well-Known Member

    Joined:
    Jul 23, 2004
    Messages:
    865
    Likes Received:
    9
    Trophy Points:
    18
    cPanel Access Level:
    Root Administrator
    Instead of "reload" try restart:
    Code:
    /etc/init.d/memcached restart
    Mysql is extremely stable usually, so you should try to figure out why its crashing. Check you logs.
     
  3. x-man

    x-man Well-Known Member

    Joined:
    Jan 25, 2004
    Messages:
    118
    Likes Received:
    0
    Trophy Points:
    16
    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
     
  4. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,811
    Likes Received:
    672
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    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.
     
  5. x-man

    x-man Well-Known Member

    Joined:
    Jan 25, 2004
    Messages:
    118
    Likes Received:
    0
    Trophy Points:
    16
    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.
     
  6. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,811
    Likes Received:
    672
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    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.
     
Loading...

Share This Page