Analyzing Redis memory usage with Redis-rdb-tools

Source: Internet
Author: User
Tags redis redis server

Background: Production of a Redis server, physical memory 32G, several projects are in use, often less than a month memory will be exhausted, and then start to use Swap, when the swap is exhausted, the system will go down. The Redis configuration has also been optimized several times, but no results have been achieved. So I decided to look at the memory size of the Redis storage data to see if there are any abnormal data.

First, install redis-rdb-tools tools

# wget Https://github.com/sripathikrishnan/redis-rdb-tools/archive/master.zip
# Unzip Master
# CD redis-rdb-tools-master/
# python setup.py Install

Second, generate DUMP.RDB file Genetic memory report

Generate a memory report in CSV format. The included columns are: Database ID, data type, key, memory usage (byte), encoding. Memory usage contains key, value, and other values.
Note: Memory usage is approximate. In general, slightly lower than the actual value.
The content of the report can be filtered based on key or database ID or data type.

# rdb-c memory./dump.rdb > Redis_memory_report.csv

# sort-t,-k4nr redis_memory_report.csv

Submit the analysis results to the developer to confirm, and then find out that these data types are list key originally intended to do queue use, but the actual situation is not in. The list is growing in size, taking up more memory.

Remove a few memory-intensive keys and discover that the memory has been freed up in part:

Analyzing Redis memory usage with Redis-rdb-tools

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.