Download:
Many posts on Google have introduced the installation method of version 1.2.1 in windows, but it has expired. There are also many Windows versions that require the GNU environment to compile, I need to have Linux environment software, so I directly download a 1.2.6 EXE version is compiled,: http://code.jellycan.com/memcached/ select Win32 binary, download complete, decompress to complete, run memcached.exe, open cmd Enter command line input: telnet 127.0.0.1 11211, press enter and switch to another window. Enter stats and press Enter.
Stat PID 2952
Statuptime 23573
Stat time 1295357441
Stat version 1.2.6
Stat pointer_size 32
Stat curr_items 0
Stat total_items 0
Stat bytes 0
Stat curr_connections 2
Stat total_connections 4
Stat connection_structures 3
Stat performance_get 0
Stat performance_set 0
Stat get_hits 0
Stat get_misses 0
Stat evictions 0
Stat bytes_read 30
Stat bytes_written 826
Stat limit_maxbytes 67108864
Stat threads 1
End
Indicates that memcache has been started,
PID process ID of this server process (memcache server process ID)
Uptime number of seconds this server has been running (the number of seconds that the server has run)
Time Current UNIX time according to the server (current UNIX time of the server)
Version version string of this server (memcache Version)
Pointer_size current system pointer size of the current operating system (32-bit systems are generally 32bit)
Rusage_user accumulated user time for this process (the cumulative user time of the process (seconds: subtle ))
Rusage_system accumulated system time for this process (the accumulated system time of the process (seconds: subtle ))
Curr_items current number of items stored by the server (number of contents currently stored on the server)
Total_items Total number of items stored by this server ever since it started (total number of contents stored since the server was started)
Bytes current number of bytes used by this server to store items (number of bytes occupied by the current storage content on the server)
Curr_connections number of open connections (number of currently opened connections)
Total_connections total number of connections opened since the server started running (total number of connections accepted since the server was running)
Connection_structures Number of connection structures allocated by the server (number of connection structures allocated by the server)
Performance_get cumulative number of retrieval requests (GET command) Total number of requests)
Performance_set cumulative number of storage requests (SET command (SAVE) Total number of requests)
Get_hits number of keys that have been requested and found present (total number of successful requests)
Get_misses number of items that have been requested and not found (total number of failed requests)
Threads current number of threads (current number of threads)
Bytes_read total number of bytes read by this server from network (total number of bytes read by the server from the Network)
Bytes_written total number of bytes sent by this server to network (total number of bytes sent by the server to the network)
Limit_maxbytes number of bytes this server is allowed to use for storage. (total number of bytes allowed by the server during storage)
Evictions Number of valid items removed from cache to free memory for new items space allocated to new items ))
The most important parameters are:
Uptime: the number of seconds that memcached runs.
Pai_get: the number of times the cache is queried.
When _get/uptime results are the average number of requests cached per second-the larger the result value, the higher the memcached utilization, the higher the site traffic. If it is too low, you can use the file system cache, it does not reflect the powerful performance of using memcached.
Performance_set: The number of times key => value is set. The whole memcached is a large hash. If you use the content not found by using mongo_get, you will call mongo_set to write it into the cache.
Get_hits: the number of cache hits. The so-called hit rate = get_hits/pai_get * 100%.
Get_misses: the number of cache miss times. When get_misses is added with get_hits, it is equivalent to pai_get.
Stats: displays server information and statistical data.
Stats Reset: clears statistics.
Stats slabs: displays information about each slab, including the chunk size, number, and usage.
Stats items: displays the number of items and storage duration in each Slab (the number of seconds from the last access)
Quit: Exit
Iii. Use shell commands to operate memcached
1. Data Storage (the key is Wan, and the value is 123)
2. Data Retrieval
3. replace Data (replace the value stored with the WAN key with 122)
4. Increase the value by 1.
5. Reduce the number by 2
6. data deletion
7. view the current status of memcached
Printf "stats/R/N" | NC 127.0.0.1 11211
8. view the Real-Time memcached status
Watch "printf 'stats/R/N' | NC 127.0.0.1 11211"
For more information about memcached protocol, see:
Http://blog.s135.com/book/memcached/
4. View slabs usage
Using memcached to create a Perl script written by Brad named memcached-tool, you can easily get the usage of Slab (it organizes the returned values of memcached into easy-to-read formats ). You can obtain the script from the following address:
Http://code.sixapart.com/svn/memcached/trunk/server/scripts/memcached-tool
[Root @ localhost HTML] # Vim memcached-Tool
[Root @ localhost HTML] # chmod + x memcached-Tool
[Root @ localhost HTML] #./memcached-tool 127.0.0.1: 11211
# Item_size max_age 1mb_pages count full?
1 80 B 0 S 1 0 No
104 B 12175 S 1 1 NO
3 176 B 1339587 s 33 196567 Yes
Meaning of each column:
#: Slab class no.
Item_size: Chunk Size
Max_age: survival time of the oldest record in LRU
1mb_pages: Number of pages allocated to slab
Count: number of records in Slab
Full? : Does slab contain idle chunk?
5. You can also visually monitor the running status of memcached.
Http://livebookmark.net/journal/2008/05/21/memcachephp-stats-like-apcphp/
Is a PHP source file. You only need to modify the username, password, and array $ memcache_servers in the source code.
For other versions of memcache and compilation and installation methods, see http://weimingtom.javaeye.com/blog/745451