Discussion: How to analyze the internal status of Memcached through the stats command_PHP tutorial

WBOY
Release: 2016-07-21 15:06:28
Original
980 people have browsed it

Memcached has a stats command, through which you can view many status information of the Memcached service. The usage is as follows:
First enter the telnet host name and port number directly on the command line to connect to the memcached server, and then after the connection is successful, 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
STAT uptime 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 cmd_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: memcached service process Process ID
2. uptime: The time elapsed from the start of the memcached service to the current time, the unit is seconds.
3. Time: The current system time of the host where the memcached server is located, in seconds.
4. version: The version of the memcached component. Here's the 1.2.6 I'm currently using.
5. Pointer_size: The pointer size of the host operating system where the server is located, usually 32 or 64.
6. curr_items: Indicates the number of all cache objects stored in the current cache. Excludes objects that have currently been removed from the cache.
7. total_items: Indicates the number of all objects stored in the system from the start of the memcached service to the current time, including objects that have been deleted from the cache.
8. bytes: Indicates the storage space used by the system to store cache objects, in bytes.
9. curr_connections: Indicates the number of connections currently opened by the system.
10. total_connections: Indicates the total number of connections opened by the system from the start of the memcached service to the current time.
11. connection_structures: Indicates the number of connection structures allocated by the server from the start of the memcached service to the current time. This explanation is given by the protocol document. I haven’t figured out what it means yet.
12. cmd_get: The cumulative number of data obtained, here is 3, because I tested it 3 times. The first time, the data acquisition failed because there was no serialized object, and it was null. The next two times, I used different objects. Tested 2 times.
13. cmd_set: The cumulative number of saved data settings, here is 2. Although I stored it 3 times, the first time was not saved to the cache because it was not serialized, and there was no record.
14. get_hits: Indicates the number of successful data acquisitions.
15. get_misses: Indicates the number of failures to obtain data.
16. evictions: The number of cache objects removed from the cache in order to free up space for new data items. For example, objects that are removed according to the LRU algorithm when the cache size is exceeded, and expired objects.
17. bytes_read: The total number of bytes read by the memcached server from the network.
18. bytes_written: The total number of bytes sent by the memcached server to the network.
19. limit_maxbytes: The maximum number of bytes allowed to be used by the memcached service cache. Here it is 67108864 bytes, which is 64M. It is consistent with the size we set when starting the memcached service.
20. threads: The total number of requested worker threads. This explanation is given in the protocol document. I haven’t figured out what it means yet.
Summary: The stats command is generally very useful. Through this command, we know all aspects of the current memcached service information.

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/327617.htmlTechArticleMemcached has a stats command through which you can view many status information of the Memcached service. The usage method is as follows: First enter the telnet host name and port number directly on the command line and connect to m...
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!