Memcached, a key technology for large websites to accelerate access

Source: Internet
Author: User
1. Basic concepts and principles Memcached is a high-performance distributed memory object cache system. It is actually a huge hash table maintained in the memory. Use Memcached: 2. use Telnet to operate memcached3.PHP to operate memcached1) Memcache2

1. Basic concepts and principles

Memcached is a high-performance distributed memory object cache system. It is actually a huge hash table maintained in the memory.

Memcached operation usage:

2. Telnet for memcached

3. PHP operations on memcached

1) Memcache

2) Memcached

4. memcached mechanism

Memcached is a c/s-based architecture and libevent-based event processing (fast response capability is maintained in the case of high concurrency ), built-in memory storage (uses the LRU algorithm to automatically delete older caches when data is full), client-based distributed.

5. memcached details

1) lifecycle

Data is destroyed from the time it is put into memcached until the time reaches. if the time is 0, the data will not expire.

2) how to put the session information in memcached

Configure php. ini as follows:

session.save_handler?=?memcache(d)session.save_path?=?“tcp://localhost:11211,tcp://localhost:9999”.

3) comparison between memcached and session:

Memcached is mainly designed to speed up, so it is a stateless data that is not bound to users.

Session data is bound to users, so it is stateful data.

4) security of memcached

Put it in the intranet, set the firewall to prevent others from accessing, and the memcached Port can only allow Intranet access.

5) which data is suitable for memcached:

Frequent and unstable changes and no real-time data warehouse receiving (online user status, online user count, etc)

6) memcached? And? Comparison of redis:

Different storage media

Lifecycle method

Different problems to be solved

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.