Memcached has a stats command that allows you to view many status information of the memcached service. The usage is as follows:
First, enter the Telnet host name and port number in the command line to connect to the memcached server. Then, enter the stats command to display the status information of the current memcached service.
For example, the test on my local machine is as follows:
Stats
Stat PID 1552
Statuptime 3792
Stat time 1262517674
Stat version 1.2.6
Stat pointer_size 32
Stat curr_items 1
Stat total_items 2
Stat bytes 593
Stat curr_connections 2
Stat total_connections 28
Stat connection_structures 9
Stat cmd_get 3
Stat performance_set 2
Stat get_hits 2
Stat get_misses 1
Stat evictions 0
Stat bytes_read 1284
Stat bytes_written 5362
Stat limit_maxbytes 67108864
Stat threads 1
End
A lot of status information is displayed here. Each status item is explained in detail below:
1. PID: ID of the memcached service process
2. uptime: the time that the memcached service has elapsed since it was started. The unit is seconds.
3. Time: the current system time of the host where the memcached server is located, in seconds.
4. Version: version of The memcached component. Here is my current 1.2.6.
5. pointer_size: pointer size of the operating system of the host where the server is located, generally 32 or 64.
6. curr_items: Number of cache objects in the current cache. Does not include objects that have been deleted from the cache.
7. total_items: indicates the number of all objects stored by the system from the memcached service start time to the current time, including the objects that have been deleted from the cache.
8. Bytes: the storage space used by the system to store cached objects. The unit is byte.
9. curr_connections: Number of connections opened by the current system.
10. total_connections: Total number of connections opened by the system from memcached service start to current time.
11. connection_structures: indicates the number of connection structures allocated by the server from the memcached service start time to the current time. This explanation is given in the Protocol document. What does it mean? I haven't figured it out yet.
12. performance_get: the cumulative amount of data to be obtained. Here it is 3, Because I tested it three times. For the first time, because no serialized object exists, data acquisition failed. It is null, I tested it twice with different objects.
13. accumulate _set: indicates the number of data sets to be stored cumulatively. Here is 2. Although I have stored the data three times, for the first time, there is no record because the data is not serialized, so it is not saved to the cache.
14. get_hits: indicates the number of successful data acquisition times.
15. get_misses: indicates the number of failed attempts to obtain data.
16. evictions: Number of cached objects removed from the cache to release space for new data projects. For example, objects removed by the LRU algorithm and expired objects that exceed the cache size.
17. bytes_read: Total number of bytes read by the memcached server from the network.
18. bytes_written: Total number of bytes that the memcached server sends to the network.
19. limit_maxbytes: Maximum number of bytes allowed by the memcached service cache. The value is 67108864 bytes, that is, 64 mb. It is consistent with the size set when we start the memcached service.
20. threads: Total number of requested worker threads. This explanation is given in the Agreement document. What does it mean? I haven't understood it yet.
Summary: The stats command is useful in general. Through this command, we can clearly understand all aspects of the current memcached service.