Two quick commands for querying the memcached status in real time

Source: Internet
Author: User

Queries the real-time status, similar to the "TOP" command.

 

Execute any command in the command line (the second method requires PHP ):

 

1. Watch "Echo stats | NC 127.0.0.1 11211"

 

The result is as follows:

Stat PID 13785
Statuptime 1377436
Stat time 1227764242
Stat version 1.2.6
Stat pointer_size 32
Stat rusage_user 9.265591
Stat rusage_system 36.541444
Stat curr_items 6
Stat total_items 1093
Stat bytes 24628
Stat curr_connections 19
Stattotal_connections 79352
Stat connection_structures 117
Stat performance_get 609575
Stat performance_set 1093
Stat get_hits 608483
Stat get_misses 1092
Stat evictions 0
Stat bytes_read 14703639
Stat bytes_written 2297950214
Stat limit_maxbytes 52428800
Stat threads 1
End

 

2. watch '/www/PHP/bin/PHP-R' "'" '$ M = new memcache; $ M-> connect ("127.0.0.1", 11211 ); print_r ($ M-> getstats ());'"'"

 

The result is as follows:

Array
(
[Pid] = & gt; 13785
[Uptime] = & gt; 1377469
[Time] = & gt; 1227764275
[Version] => 1.2.6
[Pointer_size] => 32
[Rusage_user] = & gt; 9.266591
[Rusage_system] = & gt; 36.541444
[Curr_items] => 6
[Total_items] = & gt; 1093
[Bytes] = & gt; 24628
[Curr_connections] => 16
[Total_connections] = & gt; 79372
[Connection_structures] = & gt; 117
[Cmd_get] => 609593
[Performance_set] => 1093
[Get_hits] => 608501
[Get_misses] = & gt; 1092
[Evictions] => 0
[Bytes_read] = & gt; 14704073
[Bytes_written] = & gt; 2298032330
[Limit_maxbytes] = & gt; 52428800
[Threads] => 1
)

 

The preceding command assumes that memcached is run by default, that is, the server address is 127.0.0.1 and the port is 11211. Modify according to the actual situation.

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.