Memcached has a stats command that allows you to view many of the status information for the Memcached service. here's how to use it:
Enter the Telnet host name port number directly on the command line, connect to the memcached server, and then after successful connection, enter the stats command to display the status information for the current memcached service.
For example, my native test is as follows:
statsstat pid1552STAT Uptime3792STAT Time1262517674STAT version1.2.6STAT pointer_size +STAT Curr_items1STAT Total_items2STAT bytes593STAT curr_connections2STAT total_connections -STAT connection_structures9STAT Cmd_get3STAT Cmd_set2STAT get_hits2STAT get_misses1STAT Evictions0STAT Bytes_read1284STAT Bytes_written5362STAT limit_maxbytes67108864STAT Threads1
END
A lot of status information is shown here, and each state entry is explained in detail below:
1. Process ID of the pid:memcached service process
2. Uptime:memcached the time, in seconds, from the start of the service to the current.
3. The time, in seconds, that the time:memcached server hosts the current system.
4. Version of the version:memcached component. Here is the 1.2.6 I am currently using.
5. Pointer_size: The pointer size of the host operating system on which the server is located, typically 32 or 64.
6. Curr_items: Represents the number of cached objects that are stored in the current cache. Objects that are currently removed from the cache are not included.
7. Total_items: Represents the number of objects that have been stored by the system since the Memcached service was started to the current time, including objects that are currently removed from the cache.
8. Bytes: Represents the storage space used by the system to store cached objects in bytes.
9. Curr_connections: Indicates the number of connections that are open on the current system.
Total_connections: Represents the total number of connections that have been opened by the system from the Memcached service start to the current time.
Connection_structures: Indicates the number of connection structures that have been allocated by the server since the start of the Memcached service to the current time, this explanation is given by the Protocol document, and I do not understand it at this point.
Cmd_get: The cumulative amount of data obtained, here is 3, because I tested 3 times, the first time because there is no serialized object, so get data failure, is NULL, 2 times behind is I tested with different objects 2 times.
Cmd_set: Cumulative number of saved data, here is 2. Although I have stored 3 times, but for the first time because there is no serialization, it is not saved to the cache, there is no record.
Get_hits: Indicates the number of times the data was successfully obtained.
Get_misses: Indicates the number of times the data failed to get.
Evictions: The number of cached objects removed from the cache in order to free up space for new data items. For example, objects that are removed based on the LRU algorithm when the cache size is exceeded, as well as expired objects.
Bytes_read:memcached The total number of bytes that the server reads from the network.
The total number of bytes sent to the network by the bytes_written:memcached server.
The maximum number of bytes allowed to be used by the limit_maxbytes:memcached service cache. This is 67108864 bytes, which is 64M. Match the size of the memcached service setting that we started.
Threads: The total number of worker threads that are requested. This explanation is given in the protocol document, what exactly does it mean, I don't understand yet.
Summary:The Stats command is generally useful, and through this command we are well aware of the various aspects of the current memcached service.
[Go] MemCached stats command