Introduction to memcache startup and telnet commands

Source: Internet
Author: User
This article provides a detailed analysis of memcache startup and telnet commands. For more information, see

1. start common Memcache parameters
The code is as follows:
-P TCP port of The Listener (default: 11211)
-U UDP listening port (default: 11211, disabled at 0)
-D run as a daemon
-U The account running Memcached is not a root user.
-M The maximum memory usage unit is MB. the default value is 64 MB.
-C The default number of soft connections is 1024.
-V output warning and error message
-Vv: print the client's request and return information
-H: Print Help information
-I print the copyright information of memcached and libevent.
-L Binding address (default: all allow, regardless of the intranet and internet or the local machine to change the IP address, there is a security risk, if set to 127.0.0.1, only local access is allowed)
-P Write PID to file In this way, the following process can be terminated quickly and must be used together with-d.

2. Memcache telnet commands
COMMAND DESCRIPTION EXAMPLE
Get Reads a value Get mykey
Set Set a key unconditionally Set mykey 0 60 5
Add Add a new key Add newkey 0 60 5
Replace Overwrite existing key Replace key 0 60 5
Append Append data to existing key Append key 0 60 15
Prepend Prepend data to existing key Prepend key 0 60 15
Incr Increments numerical key value by given number Incr mykey 2
Decr Decrements numerical key value by given number Decr mykey 5
Delete Deletes an existing key Delete mykey
Flush_all Invalidate specific items immediately Flush_all
Invalidate all items in n seconds Flush_all 900
Stats Prints general statistics Stats
Prints memory statistics Stats slabs
Prints memory statistics Stats malloc
Print higher level allocation statistics Stats items
Stats detail
Stats sizes
Resets statistics Stats reset
Version Prints server version. Version
Verbosity Increases log level Verbosity
Quit Terminate telnet session Quit

3. stats command details
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 Pointer size of the current operating system (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

4. start tips for Memcache
A: listener intranet address
B: modify the default port number.
C: set the maximum number of connections and the maximum memory usage.

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.