Monitoring memcached and Restart it if it is stopped or terminated unexpectedly.

Your ads will be inserted here by

Easy Plugin for AdSense.

Please go to the plugin admin page to
Paste your ad code OR
Suppress this ad slot.

If you are experiencing memcache process went down unexpectedly. You can create a script like this

if ps -u memcached |grep -E 'memcached$' > /dev/null
  echo "memcached is running."
  echo "starging memcache."
  /etc/init.d/memcached restart

ps -u memcached, here you can change memcached to the user account which is used for starting memcache depends on your operating system settings. For example, ps -u root if you are on root.

Name the script, change the permission make it available for execution. Then create a job in crontab to run the script periodically.

*/5 * * * * /scripts/ &> /dev/null

Leave a Reply

Your email address will not be published. Required fields are marked *