Reduce Redis memory usage and reduce request latency __redis

Source: Internet
Author: User
Tags memory usage redis server

Recently read the "Redis combat", summed up some of the optimization methods mentioned in How to reduce the Redis memory usage: Use the correct data structure key length smaller occupy memory smaller (add up) value can be processed part of the data structure in the length of the smaller, A small number of cases will be using space-saving algorithm storage, can be combined with sharding to reduce total memory usage sharding: Reduce the amount of storage that can be used on a single machine (although not reduce the total amount of memory) how to reduce the latency of request Redis using the correct data structure A hierarchical structure that reduces the latency of read-only commands the overall idea is to reduce the number of traffic, so in general, try to return the results at the end of the Redis server. Common methods are
(1) Some data structures have the command to handle many information, such as Hmget instead of multiple hget
(2) using pipeline instead of multiple commands to communicate with Redis multiple times
(3) Use LUA script instead of pipeline, watch/multi/exec (pessimistic lock), etc.

Related Article

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.