Go to the CMD command line and enter Telnet 127.0.0.1 11211 (memcached default port is 11211)
Stats: Use the stats command to view the status of the current memcache Server
Command line display code
- Stat PID 924
- Statuptime 21057
- Stat time 1303194576
- Stat version 1.2.4
- Stat pointer_size 32
- Stat curr_items 0
- Stat total_items 3
- Stat bytes 0
- Stat curr_connections 1
- Stat total_connections 28
- Stat connection_structures 8
- Stat performance_get 12
- Stat performance_set 7
- Stat get_hits 3
- Stat get_misses 9
- Stat evictions 0
- Stat bytes_read 772
- Stat bytes_written 2514
- Stat limit_maxbytes 67108864
- Stat threads 1
- End
Properties are interpreted as follows: From http://www.51testing.com /? Uid-116228-action-viewspace-itemid-107545
PID |
Memcache server process ID |
Uptime |
Number of seconds that the server has run |
Time |
Current UNIX timestamp of the server |
Version |
Memcache version |
Pointer_size |
CurrentOperating SystemPointer size (32-bit system is generally 32bit) |
Rusage_user |
Cumulative user time of the process |
Rusage_system |
Cumulative system time of processes |
Curr_items |
Number of items currently stored on the server |
Total_items |
Total number of items stored after server startup |
Bytes |
Number of bytes occupied by items stored on the current server |
Curr_connections |
Number of currently opened connections |
Total_connections |
Number of connections that have been opened since the server is started |
Connection_structures |
Number of connections allocated by the server |
Pai_get |
Total get command (get) Requests |
Performance_set |
Total number of SET command (SAVE) Requests |
Get_hits |
Total hits |
Get_misses |
Total number of missed hits |
Evictions |
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) |
Bytes_read |
Total number of read bytes (number of request bytes) |
Bytes_written |
Total number of sent bytes (number of returned bytes) |
Limit_maxbytes |
Memory size (bytes) allocated to memcache) |
Threads |
Current thread count |
Set, add, replace
<Command name> <key> <flags> <exptime> <bytes> \ r \ n <data block> \ r \ n
Note: \ r \ n is the Enter key in windows.
A) <command name> can be set, add, or replace ".
"Set" indicates that the data is stored according to the corresponding <key>. If not, it is added and some are overwritten.
"Add" means to add the data according to the corresponding <key>, but if the <key> already exists, the Operation will fail.
"Replace" indicates that data is replaced according to the corresponding <key>, but the operation fails if the <key> does not exist.
Sometimes "add" and "replace" cannot be stored.
B) <key> key of the data to be saved on the client.
C) <flags> is a 16-bit unsigned integer (expressed in decimal format ).
This flag is stored together with the data to be stored and returned when the client get data.
The customer can use this flag for special purposes, which is not transparent to the server.
D) <exptime> expiration time.
If the value is 0, the stored data will never expire (but can be replaced by server algorithms such as LRU ).
If it is not 0 (UNIX time or the number of seconds from this time point), after expiration, the server can ensure that the user does not get the data (based on the server time ).
E) <bytes> the number of bytes to be stored. If you want to store NULL data, the value <bytes> can be 0.
F) <data block> the content to be stored. After the input is complete, the client must add "\ r \ n" (in windows, click Enter) as the end mark of the "Command Header.
Command Line Code
- Set key 24 10 2
- SD
- Stored
- Replace key 24 10 3
- SDD
- Stored
- Add key1 24 10 4
- Sdsd
- Stored