View memcached status in linux

Source: Internet
Author: User
Linux viewing memcached status [root@LinuxAS6-iCloudxinetd.d] # telnet127.0.0.111211Trying127.0.0.1... connectedto127.0.0.1.Escapecharacteris & amp; #39; ^] & amp; #39 ;. statsSTATpid22 linux view memcached status [root @ LinuxAS6-iCloud xinetd. d] # telnet 127.0.0.1 11211 Trying 127.0.0.1... connected to 127.0.0.1.Escape character is '^]'. statsSTAT pid 22362 // memcache server process ID www.2cto.com STAT uptime 1469315 // Number of seconds the server has run STAT time 13396 71194 // Current unix timestamp STAT version 1.4.9 // memcache version STAT libevent 1.4.9-stable // libevent version STAT pointer_size 64 // pointer size of the current operating system (32-bit system generally 32bit, 64 is the 64-bit operating system) STAT rusage_user 3695.485200 // accumulative process user time STAT rusage_system 14751.273465 // accumulative process system time STAT curr_connections 69 // Number of items currently stored on the server STAT total_connections 855430 // after the server is started total number of items stored STAT connection_structures 74 // number of connections allocated by the server STAT reserved_fds 20 // STAT c Md_get 328806688 // get command (get) Total number of requests STAT pai_set 75441133 // set command (save) total number of requests www.2cto.com STAT pai_flush 34 // flush Command request count STAT pai_touch 0 // touch Command request count STAT get_hits 253547177 // total number of hits STAT get_misses 75259511 // total number of missed hits STAT delete_misses 4 // delete command Miss count STAT delete_hits 565730 // delete command Miss count STAT incr_misses 0 // incr command Miss count STAT incr_hits 0 // incr command hit count STAT decr_misses 0 // decr command Miss count STAT decr_hits 0 // decr Command hit count STAT cas_misses 0 // cas command Miss count STAT cas_hits 0 // cas command hit count STAT cas_badval 0 // use Wipe Count STAT touch_hits 0 // touch command Miss count STAT touch_misses 0 // touch command hits STAT auth_cmds 0 // Number of times the authentication command processes STAT auth_errors 0 // Number of authentication failures STAT bytes_read 545701515844 // total number of read bytes (number of request bytes)) STAT bytes_written 1649639749866 // total number of sent bytes (number of result bytes) 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 // number of invalid listeners STAT threads 4 // Current number of threads STAT conn_yields 14 // The connection operation proactively abandons the number of STAT hash_power_level 16 // STAT hash_bytes 524288 STAT hash_is_expanding 0 STAT limit 30705763 STAT evicted_unfetched 0 STAT bytes 61380700 // Number of bytes occupied by the current storage STAT curr_items 28786 // total number of currently stored data STAT total_items 75441133 // total number of data stored since startup STAT evictions 0 // number of items deleted to get idle memory (the old items need to be deleted after the space allocated to memcache is full to get the space allocated to the new items) ST AT reclaimed 39957976 // The number of expired data entries to store new data. END: quit or ctrl +] then Press q. Install telenet method 1, yum install telnet-server 2, yum install telnet client 3, vi/etc/xinetd. d/telnetservice telnet {flags = REUSE socket_type = stream wait = no user = root server =/usr/sbin/in. telnetd log_on_failure + = USERID disable = yes} change the disable item from yes to no. 4./etc/init. d/xinetd restart other methods: in the previous project, the start/end mode of memcached in linux is installed in/usr/local/bin by default. Go to the installation directory and start memcached:/usr/local/memcached/bin/memcached-d-c 10240-m 1024-u root to get the running Status: echo stats | nc localhost 11211 (you can check the pid) or use ps-ef | grep memcached to stop memcached: kill-9 pid (-9 indicates force killing, pid is the process identifier)-d option is to start a daemon process,-m is the amount of memory allocated to Memcache, the unit is MB, where is 1024 MB, the default value is 64 MB-u, which is the user who runs Memcache. here root-l is the IP address of the listening server. the default value is local-p, which is the port for setting Memcache listening. the default value is 11211, it is best to set port-c above 1024 to the maximum number of concurrent connections. the default value is 1024. here, 10240 is set. -P is set to save the pid file location of Memcache-h print help information-v output warning and error information-vv print client request and return information ps-ef | grep memcached (Command description) grep: function description: Searches for matching strings in the file. |: MPs queue command operator ps (process status): function description: Reports program status. Connect to memcached: telnet ip port, for example, telnet 192.168.100.11 11211 stats to check the status. flush_all: Clear the basic command for viewing the memcached status in the cache. you can see the following information through this command: 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 64 operating system 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 10 number of currently open connections STAT total_connections 82 number of previously opened connections STAT connection_structures 13 Number of connection structures allocated by the server STAT cmd_get 54 total number of get commands executed STAT cmd_set 34 total number of set commands executed STAT cmd_flush 3 total number of times flush_all commands STAT get_hits 9 get hits STAT get_misses 45 get misses STAT delete_misses 5 delete misses STAT delete_hits 1 delete hits STAT incr_misses 0 incr misses STAT incr_hits 0 incr hits STAT decr_misses 0 decr misses STAT decr_hits 0 decr hits STAT cas_misses 0 cas misses STAT cas_hits 0 cas hit count STAT cas_badval 0 use Wipe Count STAT auth_cmds 0 STAT auth_errors 0 STAT bytes_read 15785 read bytes total STAT bytes_written 15222 write bytes total STAT limit_maxbytes 1048576 allocated memory (bytes) STAT accepting_conns 1 currently accepts connections STAT listen_disabled_num 0 STAT threads 4 threads STAT conn_yields 0 STAT bytes 0 storage item byte count STAT curr_items 0 item count STAT total_items 34 total item count STAT evictions 0 is another example is to get the total number of items deleted from a space: start/End memcached-d-m 10-u root-l 192.168.0.122-p 11200-c 256-P/tmp/memcached. the pid-d option is to start a daemon.-m indicates the amount of memory allocated to Memcache. the unit is MB. Here 10 MB-u indicates the user who runs Memcache, here, root-l is the IP address of the listening server. if there are multiple IP addresses, the IP address 192.168.0.122-p is specified here to set the port for Memcache listening. here, 12000 is set, it is best to set port-c above 1024 to the maximum number of concurrent connections. the default value is 1024. here, 256 is set, set-P based on the load of your server to set the pid file kill 'cat/tmp/memcached to save Memcache. pid 'get running status echo stats | nc 192.168.1.123 11200 watch "echo stats | nc 192.168.1.123 11200" (real-time 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.