Memcached stats command (command line view memcached running status)

Source: Internet
Author: User
Tags memcached stats

It is often necessary to monitor the running status of memcached on the server, such as the number of cache queries and hit rate. But
The memcached-tool is written in Perl in Linux, and I have never tried whether it can be used in windows. Later I found a simple method.
You can do this by using telnet.
First, log on to the server, and then type
Telnet fig 11211
127.0.0.1 is the server address (here it is the local machine), and 11211 is the port number bound to memcached.
The command line window is black. Only the cursor prompt is displayed. Enter stats to obtain the parameter describing the running status of the memcached server.
Number. For example:
 
Here, uptime is the number of seconds for memcached to run, and pai_get is the number of times the cache is queried. The two data can be obtained after division.
Average number of requests cached per second-the recent niupu traffic is very low, so the average number of requests is more than once per second.
It's okay to use the file system cache. it doesn't reflect the advantage of using memcached.
The interval _set below is the number of times key => value is set. The entire memcached is a large hash, which is not found by using ipv_get.
Then, it will call cmd_set to write it into the cache. Followed by get_hits, which is the number of cache hits. Cache hit rate =
Get_hits/cmd_get * 100%.
The following get_misses number plus get_hits should be equal to pai_get. Total_itemscurr_items indicates that
Number of key-value pairs in memory, total_items = pai_set = get_misses in the figure, but when the maximum available memory is used up
, Memcached will delete some content, and the above equation will not be true.
In other words, it would be great for memcached to have a complete set of monitoring tools. For more information about installing memcached and configuring PHP, see
Here.


Memcached stats command

 There are many commands available after telnet to the memcached server, except for the well-known value assignment commands such as ADD, get, set, incr, decr, replace, and delete, there are also a series of commands for getting server information, all of which start with stats.
You can also access these commands using PHP memcache: getstats ($ cmd ).

Common commands

Stats
Display Server Information and statistical data

Stats Reset
Clear statistics

Stats malloc
Display memory allocation data

Stats cachedump slab_id limit_num
Displays the list of the first limit_num keys in an slab. The format is as follows:
Item key_name [value_length B; expire_time | access_time S]
Memcached 1.2.2 and earlier versions show the access time (timestamp)
1.2.4 or later versions, including 1.2.4 display expiration time (timestamp)
If it is a key that never expires, expire_time is displayed as the start time of the server.

Stats cachedump 7 2
Itemcopy_test1 [250 B; 1207795754 S]
Item copy_test [248 B; 1207793649 S]

Stats Slabs
Displays information about each slab, including the chunk size, quantity, and usage.

Stats items
Display the number of items in each slab and the age of the oldest item (the number of seconds from the last visit)

Stats detail [ON | off | dump]
Set or display detailed operation records

The parameter is on.
The parameter is off. Disable detailed operation records.
The parameter is dump, and detailed operation records are displayed (the number of times each key value is get, set, hit, and del)

Stats detail dump
Prefix copy_test2 get 1 hit 1 Set 0 del 0
Prefix copy_test1 get 1 hit 1 Set 0 del 0
Prefix CPY get 1 hit 0 set 0 del 0

Http://www.cnblogs.com/eoiioe/archive/2009/06/03/1495338.html

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.