Monitoring Memcached Using a PHP Script

I wrote a PHP script that I planned with CRON to run every minute. The purpose of the script is to verify that the memcached server is on the network. My strategy is to just try connecting to the memcached server. If I connect successfully, I close the connection. If I do not connect, I send an email warning that memcached is disconnected.

My question is: is this a sufficient test that memcached is up and running, or is it a common practice to do more than just connect to memcached? Should I also verify that I can set and get a key / value pair?

In addition, in the future we may need more careful monitoring of memcached so that we can monitor memory usage, connections, number of requests, etc. Are there open source libraries for this with PHP? If so, which of them performed beautifully in your experience?

+5
source share
1 answer

You do not need to build anything. There are several PHP scripts designed to monitor, debug, and display statistics for the Memchached server.

There are two that I know and work well:

+6
source

All Articles