Memcached Basic Operation

Source: Internet
Author: User

Telnet 127.0.0.1 11211 Connection memcached

Memcached-tool 127.0.0.1:11211 display shows how many page memcached are saved.

memcached Syntax

<command name> <key> <flags><exptime><bytes>\r\n <data block> \ r \ n
\ r \ n indicates enter
<command> has:
set means that the data is stored according to the corresponding <key>, and when there is no time to increase, some words will be overwritten.
Add means that the data is added according to the appropriate <key>, and if the <key> exists, the operation fails.
Replace means that the data is replaced by the corresponding <key>, and if the <key> does not exist, the operation fails.
<key> represents the value that the client needs to hold the data.
<flags> is a 16-bit unsigned (decimal) integer tag. The tag is stored with the data that needs to be stored and returned when the client get data. Customers can use this tag for special purposes, which is opaque to the server.
<exptime> Indicates the expiration time of this data, if 0 means never expires (but can be replaced by server algorithm: LRU, etc.). If it is not 0 (server time is standard), the server deletes this data directly when it expires.
<bytes> represents the number of bytes that need to be stored <bytes> can be 0 when the user wants to store empty data.

<data Block> represents the content that needs to be stored, after the input is completed, you need to add "\ r \ n" to the end flag.

Instance:

650) this.width=650; "src=" Http://s5.51cto.com/wyfs02/M02/82/9D/wKioL1ddAM2CB8jjAADCtuHritM094.png "title=" Image.png "alt=" Wkiol1ddam2cb8jjaadctuhritm094.png "/>

Memcached Basic Operation

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.