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.