Comprehensive memcached Analysis

Source: Internet
Author: User
Directory
Translated ...................................... ........................................ ........................................ ........................... 4
Chapter 4 basics of memcached ................................... ........................................ ...................................... 5
1.1 What is memcached ?................................... ........................................ .................................... 5
1.2 memcached features .................................... ........................................ ....................................... 6
The Protocol is simple ...................................... ........................................ ........................................ .............. 6
Libevent-based event processing ................................... ........................................ ............................... 6
Built-in memory storage .................................... ........................................ ......................................... 6
Distributed memcached does not communicate with each other .................................. ........................................ ................... 6
1.3 install memcached ..................................... ........................................ ......................................... 7
Install memcached ..................................... ........................................ ........................................ 7
Start memcached ..................................... ........................................ ........................................ 8
1.4 connect to the client .................................... ........................................ ........................................ ....... 8
1.5 Use cache :: memcached ....................................... ........................................ ........................... 9
Use cache :: memcached connects to memcached ..................................... ........................................... 9
Save the data ...................................... ........................................ ........................................ ............ 10
Retrieve data ...................................... ........................................ ........................................ ............ 10
Delete data ...................................... ........................................ ........................................ ............ 10
Add and subtract one operation ................................... ........................................ ........................................ .... 10
1.6 conclusion ...................................... ........................................ ........................................ .................. 11
Chapter 4 understanding memcached memory storage ................................. ........................................ ..................... 12
2.1 slab allocation mechanism: sort out the memory so that you can reuse it ................................... ................................ 12
Main terminologies of slab allocation ................................... ........................................ .......................... 13
2.2 how record caching works in slab ................................ ........................................ ............................ 13
2.3 disadvantages of Slab allocator ................................... ........................................ .................................. 13
2.4 use the growth factor for tuning ................................. ........................................ ....................... 14
2.5 check the internal status of memcached .................................. ........................................ ...................... 15
2.6 view slabs usage .................................. ........................................ ................................. 16
2.7 conclusion ...................................... ........................................ ........................................ .................. 17
Chapter 4 Delete mechanism and development direction of memcached ............................... ........................................ ............ 18
3.1 memcached effectively uses resources for data deletion ............................... ........................................ .. 18
The data will not actually disappear from memcached ................................. ........................................ ............. 18
Lazy expiration ...................................... ........................................ ........................................ .. 18
3.2 LRU: how data is effectively deleted from the cache ................................ ........................................ ......... 18
3.3 The Latest Development Direction of memcached .................................. ........................................ ....................... 18
About the binary protocol ..................................... ........................................ ........................................ .. 19
The format of the binary protocol .................................... ........................................ ....................................... 19
What is striking in the header .................................. ........................................ ........................ 20
2
Idv2.com
3.4 external engine support .................................... ........................................ ........................................ .... 20
The necessity of external engine support ................................... ........................................ ................................ 20
The key to successful API design ................................. ........................................ .......................... 21
Review the current system ................................... ........................................ .................................... 21
3.5 conclusion ...................................... ........................................ ........................................ ................. 22
Chapter 2 distributed memcached Algorithm ........................................ ........................................ ................... 23
4.1 distributed memcached .................................... ........................................ ................................. 23
What does memcached's distributed architecture mean ?................................. ........................................ .............. 23
4.2 cache :: the distributed method of memcached .................................... ........................................ ............ 25
Calculate the number of scattered values by using the remainder .................................... ........................................ ....................................... 25
Disadvantages of dispersion calculated based on the remainder .................................. ........................................ ............................. 26
4.3 consistent hashing ..................................... ........................................ .................................... 27
A simple description of consistent hashing ................................... ........................................ .................... 27
Supports the function library of consistent hashing ................................... ........................................ ............... 29
4.4 conclusion ...................................... ........................................ ........................................ ................. 29
Chapter 2 Application and compatibility of memcached Program ........................................ ........................................ ........... 30
5.1 Mixi case study .................................... ........................................ ........................................ ..... 30
Server Configuration and quantity .................................... ........................................ ....................................... 30
Memcached process ...................................... ........................................ ......................................... 31
Memcached usage and client ................................... ........................................ .................... 31
5.2 memcached Application Experience .................................... ........................................ ................................. 32
Use daemontools to start ..................................... ........................................ ................................ 33
Monitor ....................................... ........................................ ........................................ ................... 33
Memcached performance ..................................... ........................................ ...................................... 33
5.3 compatibility with applications .................................... ........................................ ........................................ .... 35
Case study of Tokyo tyrant ..................................... ........................................ ........................................ 35
5.4 conclusion ...................................... ........................................ ........................................ ................. 36
3

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.