Linux View memcached Status

Source: Internet
Author: User
Tags cas touch command

First, using the Memcache top script memcache-top is a Perl-written command-line gadget for real-time access to memcached cache server details, such as cache hit ratio. To the official website to download the script, put in the user directory, directly run.  /home/nihaoya/memcache-top  instance                 usage   hit%   conn    time     evict/s read/s  write/s10.50.11.5:11211        88.8%    69.6%   1123    1.9ms   0.3     13.1k   36.2K   10.50.11.5:11212        88.7%   69.6%   1175    0.6ms   0.3     12.4k   28.1k    10.50.11.5:11213        88.8%   69.4%   1148     0.7ms   0.0     16.6k   32.1k   10.50.12.5:11211         89.3%   81.5%   1460    0.7ms   0.3      17.7k   204.0k  10.50.12.5:11212        89.4%   69.3%   1174    0.6ms   1.0     28.9k    63.5k   10.50.12.5:11213        89.3%   69.4%    1158    0.7ms   0.7     166.3k  194.4K   10.50.15.5:11211        89.3%   71.8%   1472     0.8ms   0.0     37.3k   59.2k   10.50.15.5:11212         89.4%   69.3%   1143    0.7ms    0.7     44.9k   35.4k   10.50.15.5:11213      & NBsp; 89.3%   84.5%   1371    0.7ms   0.7      49.0K   187.2k  10.50.9.90:11211        30.2%   76.3%   259     0.7ms   0.0     243      999     10.50.9.90:11212        19.2%   60.3%   261     0.7ms   0.0     40       801     10.50.9.90:11213        17.5%    16.9%   235     0.6ms   0.0     70       600      average:                 72.4%   67.3%   998     0.8ms   0.3     32.2k   70.2k    total:                   23.4GB           11.7k   9.2ms   4.0     386.4k   842.3k   Second, use Telnet mode, can only view a node  [[email protected] ~]# telnet 127.0.0.1 11211 trying 127.0.0.1... connected to 127.0.0.1. escape character is ' ^] '.  stats stat pid 22362   & Nbsp;//memcache server's process ID  www.2cto.com   stat uptime 1469315    //The number of seconds the server has been running  STAT Time 1339671194    //Server current UNIX timestamp  stat version 1.4.9    //memcache release  stat Libevent 1.4.9-stable    //libevent version  stat pointer_size The current operating system pointer size (32-bit system is generally 32bit,64 is a 64-bit operating system)  stat Rusage_user 3695.485200    //Process Cumulative User Time  staT Rusage_system 14751.273465    //Process Cumulative system time  stat curr_connections The number of items currently stored by the server  stat total_connections 855430    //The total number of items stored since the server was started  stat Connection_ Structures    //Number of connection constructs allocated by server  stat Reserved_fds    // stat cmd_get 328806688    //get Command (GET) total number of requests  stat cmd_set 75441133    //set Command (SAVE) total requests   www.2cto.com   stat cmd_flush    //flush command request number  stat Cmd_touch 0    // Touch Command Requests  stat get_hits 253547177    //Total Hits  stat get_misses 75259511    / /total number of misses  stat delete_misses 4    //delete command misses  stat delete_hits 565730    / /delete command hit Count  stat incr_misses 0    //incr command misses  stat incr_hits 0    // INCR command hit Count  stat decr_misses 0    //decr command misses  stat decr_hits 0     //DECR command hit Count  stat cas_misses 0    //cas command misses  stat cas_hits 0         //cas command hit Count  stat cas_badval 0    //Use wipe count  stat touch_hits 0    //touch command misses  stat touch_misses 0    //touch command hit count  stat Auth_cmds 0    //Authentication command processing number of times  stat auth_errors 0    //authentication failures  stat Bytes_read 545701515844        //Total Bytes read (request bytes)  stat Bytes_written 1649639749866     //Total Bytes sent (bytes of result)  stat limit_maxbytes 2147483648        // Memory size allocated to Memcache (bytes)  stat Accepting_conns 1            Whether the  //server has reached the maximum connection (0/1)  stat listen_disabled_num 0    //The number of failed listeners  stat Threads 4         //Current number of threads  stat conn_yields    //Connection Operation active Discard number  stat hash _Power_level    // stat hash_bytes 524288 stat hash_is_expanding 0 STAT expired_ unfetched 30705763 stat evicted_unfetched 0 stat bytes 61380700    //Current storage consumption of bytes  stat Curr_items 28786    //The total number of data currently stored  stat total_items 75441133    //total data stored since startup   STAT Evictions 0    //The number of items deleted for free memory (the space allocated to memcache needs to be removed after the old items are allocated to the new items)  stat Reclaimed 39957976    //An expired data entry to store the number of new data  END  exit: Quit or CTRL +] and then press Q on the line.   Install Telenet method  1, yum install Telnet-server server  2, yum install telnet client  3, vi/etc/xinetd.d/telnet  service Telnet{       flags               = Reuse       socket_type      = Stream              wait  & nbsp;      = No       user         = Root       server              =/usr/sbin/in.telnetd       log_on_failure       += userid       disable            = yes}  Changes the Disable item from Yes to No.   4,/etc/init.d/xinetd restart   Other ways:   pre-project, Linux under memcached start/End Way    By default, memcached is installed under/usr/local/bin.    Enter the installation directory, start memcached:/usr/local/memcached/bin/memcached-d-c 10240-m 1024-u root   get running Status: Echo Stats | NC localhost 11211 (can view PID) or use Ps-ef|grep memcached    stop memcached:kill-9 pid   (-9 means forced kill, PID The process identifier for the process   -d option is to start a daemon,  -m is allocated to memcache using the amount of memory, in megabytes, here is 1024MB, the default is 64mb -u is run mEmcache user, here is Root -l is listening server IP address, default should be native  -p is set memcache listening port, default is 11211, preferably more than 1024 port  -c option is the maximum number of concurrent connections to run, the default is 1024, here set 10240, according to the load of your server set  -P is set to save memcache PID file location  -h printing Help information  -v output warning and error message  -VV Print client request and return information  ps-ef|grep memcached (command description)   grep: Function Description: Find the string that matches the criteria in the file.  |: Pipeline command operator  PS (process status): Function Description: Report the status of the program.   Connect to memcached: telnet IP ports, such as Telnet 192.168.100.11 11211 stats view status, Flush_all: Clear Cache    To view the basic commands for the memcached status, this command allows you to see the following information:  stat PID 22459                                Process Id stat uptime 1027046                          server running seconds  stat time 1273043062                         Server current UNIX timestamp  stat version 1.4.4                           Server version  stat Pointer_size                         OS Word size (this server is 64-bit)  stat Rusage_user 0.040000                    process Cumulative User Time  stat Rusage_system 0.260000                 Process Cumulative system time  stat curr_connections                     Current number of open connections  stat total_connections-                   Total connections opened  stat connection_structures                number of connection structures allocated by the server  stat cmd_get                               Execute get Command total  stat cmd_set                               total number of execute SET commands  stat Cmd_flush 3                             points to the total number of FLUSH_ALL commands  stat get_hits 9                             get hit count  stat get_misses                           get number of misses  stat delete_misses 5                        delete number of misses  stat delete_hits 1                           delete hit Count  stat incr_misses 0                          INCR Number of Misses  stat incr_hits 0                            INCR hit Count  stat decr_misses 0                           DECR number of misses  stat decr_hits 0                             DECR hit Count  stat Cas_misses 0                           cas number of misses  stat cas_hits 0                              cas hit Count  stat cas_badval 0                            Use wiping times  stat auth_cmds 0 stat auth_errors 0 stat bytes_read 15785        & nbsp;              Read Bytes Total  stat bytes_ Written 15222                     Writing wordsTotal nodes  stat limit_maxbytes 1048576                  amount of memory allocated (bytes)  stat Accepting_conns 1                       number of links currently accepted  stat Listen_disabled_num 0                  stat Threads 4                                thread Count  stat conn_yields 0 stat bytes 0                                  Store Item bytes  stat Curr_items 0                         &nbSp;  item number  stat Total_items             Total             item  stat Evictions 0                              to get the space to delete the total of item   Another example: Start/End  memcached-d-M 10-u root-l 192.168.0.122 -P 11200-c 256-p/tmp/memcached.pid -d option is to start a daemon,  -m is allocated to memcache using the amount of memory, in megabytes, here is 10mb -u Is the user running memcache, here is Root -l is the server IP address of the listener, if there are more than one address, here specify the IP address of the server 192.168.0.122 -p is set memcache listening port, Here set 12000, preferably more than 1024 port  -c option is the maximum number of concurrent connections, the default is 1024, here set 256, according to the load of your server to set  -P is set to save memcache PID file   Kill ' Cat/tmp/memcached.pid '   get run status  echo stats | NC 192.168.1.123 11200 watch "echo Stats | NC 192.168.1.123 11200 "(real-time status)

Linux View memcached status

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.