Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8383845
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T17:16:07+00:00 2026-06-09T17:16:07+00:00

I am writing a python script which will periodically check redis memory usage. Now

  • 0

I am writing a python script which will periodically check redis memory usage. Now I know that used_memory or used_memory_human from redis info will tell us how much memory redis is using currently. But I want to know how much percentage of memory has been utilised.

In redis info we don’t get something like max_memory because of the fact that redis uses up as much memory available to the system. But what if maxmemory option in the redis.conf was set?

What if my system has 1 GB of RAM but maxmemory was set to 100MB? How can we know the memory utilisation then?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T17:16:09+00:00Added an answer on June 9, 2026 at 5:16 pm

    You can use CONFIG command to get needed info about maximum memory and memory policy. The syntax of getting configuration info is:

    config get <option-name>
    

    Here’s an example of how you can get maxmemory setting:

    redis 127.0.0.1:6379> config get maxmemory
    1) "maxmemory"
    2) "0"
    

    Here’s and example of how you can get maxmemory-policy setting:

    redis 127.0.0.1:6379> config get maxmemory-policy
    1) "maxmemory-policy"
    2) "volatile-lru"
    

    There’are different policies of maxmemory management (you can get their description from sample Redis config file):

    MAXMEMORY POLICY: how Redis will select what to remove when maxmemory
    is reached? You can select among five behavior:

    1. volatile-lru -> remove the key with an expire set using an LRU algorithm
    2. allkeys-lru -> remove any key accordingly to the LRU algorithm
    3. volatile-random -> remove a random key with an expire set
    4. allkeys->random -> remove a random key, any key
    5. volatile-ttl -> remove the key with the nearest expire time (minor TTL)
    6. noeviction -> don’t expire at all, just return an error on write operations

    And here’s and example of how similar result can be achieved with pyredis (assuming that we have localhost database on standard port):

    >>> import redis
    >>> c = redis.Redis()
    >>> print c.config_get('maxmemory')
    {'maxmemory': '0'}
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm writing a small Python script which will periodically pull information from a 3rd
I amm writing a little python script that will grab information from VMs of
I'm writing a python CGI script that will query a MySQL database. I'm using
I am currently writing a Python script for use on Linux machines that will
I'm writing a script in Python that will allow the user to input a
I'm writing a script in Python that will spit out some data organized as
I am writing python script which gets links from website. But when I tried
Folks, I have a problem. I am a writing a script in python which
I'm writing a Python script at work that contains a part with a large
I'm writing a script which will have to work on directories which are modified

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.