Enable memcache_compressed compression "Dilatancy" MemCached

Source: Internet
Author: User
Tags memcached

Try:

The memcache_compressed compression option in the Phpmemcache_set () function is enabled, and Memcache_get () can automatically decompress the compressed cache object during subsequent reads.

Effect:

Test, for the current application of blog bus, to enable compression, the same capacity (2G) storage of the number of objects increased by about one times, cache hit rate from about 50%, raised to about 60%. Further improve the hit rate hardware input is still necessary, and increased the memory twice times after the cache hit rate increased to 90%;

Premise 0: Memory cache is useful, and the hit rate is worth improving;

From 60% to 90%, or from 90% to 95%, to see whether the performance of the hit after the increase is worthwhile;

If the 1:memcached is full

First use Memcached-tool to check the memcached capacity statistics, to see if memcached is already full. If the memcached space is not full when fully running, it is meaningless to enable compression; and: found no full memcached, it is best to reduce the corresponding memcached capacity, spare more memory for other services to do caching;

Premise 2: Compression rate

The cached data does have more than hundreds of bytes, and if it is a key-value pair that is less than 100 bytes, compression may cause bloat. Because the size of the cached object is stored in the memcached by a fixed size block, the smallest is also a B. So the compression of the small data caused by the expansion is not too big problem;

CPU loss for foreground applications:

The additional compression CPU loss on the data is much lower than the cache hit rate elevation reduces the performance of the background database access, and HTTP gzip/deflate compression similar to the compressed data generally for the original data size of about 30%, save 70% The transmission performance consumption will be greater than the performance loss caused by file compression;

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.