The running status monitoring of memcached servers can generally be monitored using a dedicated operating system. However, developers can use the statistical commands (Stats) supported by memcached protocol in Linux.
1. Use telnet to connect to the memcached Server
telnet 10.10.10.10 11211
2. memcached statistical command
Common statistics or configuration information can be obtained through the stats command. Complete Step 1. Connect to the memcached server and enter the Telnet command line and stats. Press enter to obtain the statistics. The statistics include the following information:
PID: process ID of this server process (memcached server process number) uptime: Number of secs since the server started (memcache server running time, in seconds) Time: current UNIX time according to the server (time of the memcached service machine, in seconds) version: version string of this server (current memcached version) pointer_size: default size of pointers on the host OS (generally 32 or 64) (default pointer address length, which can be 32 or 64 according to the operating system) rusage_user: accumulated user time for this process (seconds: microseconds) (accumulative user usage time, accurate to milliseconds) rusage_system: accumulated system time for this process (seconds: microseconds) (accumulative system usage time, accurate to milliseconds) curr_items: current number of items stored (number of data items currently stored) total_items: Total number of items stored since the server started (after self-startup, the number of data items stored on this server) bytes: current number of bytes used to store items (memory occupied by the memcached server, in bytes) curr_connections: number of open connections (the number of currently opened connections) total_connections: Total number of connections opened since the server started running (the number of connections opened by this server after the startup) connection_structures: number of connection structures allocated by the server (the connection structure allocated by this server) pai_get: Cumulative number of retrieval reqs (obtain the number of requests) pai_set: Cumulative number of storage reqs (number of storage requests) get_hits: number of keys that have been requested and found present (number of keys successfully requested, cache hit rate = get_hits/cmd_get * 100%) get_misses: number of items that have been requested and not found (number of keys that failed requests) delete_misses: Number of deletions reqs for missing keys (number of keys not hit in data deletion requests) delete_hits: number of deletion reqs resulting in an item being removed. (number of keys hit by data deletion requests) incr_misses: Number of incr reqs against missing keys. incr_hits: Number of successful incr reqs. decr_misses: Number of decr reqs against missing keys. decr_hits: Number of successful decr reqs. cas_misses: Number of CAS reqs against missing keys. cas_hits: Number of successful CAS reqs. cas_badval: Number of CAS reqs for which a key was found, but the CAS value did not match. auth_cmds: Number of authentication commands handled, success or failure. auth_errors: number of failed authentications. evictions: Number of valid items removed from cache to free memory for new items (to store new data, use the LRU algorithm to remove the number of valid data) reclaimed: number of times an entry was stored using memory from an expired entry (the number of times new data is stored in the space occupied by expired data, memcached preferentially uses the space occupied by expired data) bytes_read: Total number of bytes read by this server from network (total number of bytes stored) bytes_written: Total number of bytes sent by this server to network (total number of bytes sent) limit_maxbytes: number of bytes this server is allowed to use for storage. threads: Number of worker threads requested. (See Doc/threads.txt) conn_yields: Number of times any connection yielded to another due to hitting the-r limit.
3. References
Memcached text protocol: https://github.com/memcached/memcached/blob/master/doc/protocol.txt