FAQ
In the doc http://redis.io/commands/info, it mentions "Ideally, the
used_memory_rss value should be only slightly higher than used_memory". So,
I suppose the mem_fragmentation_ratio should be not around 1.0 ~ 1.2.

Now, I have a Redis instance running with 2G max memory. The INFO reports:
Cache Hit Rate: 91.0046%
evicted_keys:0
used_memory_human:16.99M
used_memory_peak_human:24.03M
mem_fragmentation_ratio:1.52

It only uses peak 24.03M, but the mem_fragmentation_ratio is 1.52. It seems
abnormal to me. The redis should not have any memory pressure, and the
mem_fragmentation_ratio should be lower than 1.0, right? or, 1.5 is OK in
this case?

Thanks
-Morgan

--
You received this message because you are subscribed to the Google Groups "Redis DB" group.
To unsubscribe from this group and stop receiving emails from it, send an email to redis-db+unsubscribe@googlegroups.com.
To post to this group, send email to redis-db@googlegroups.com.
Visit this group at http://groups.google.com/group/redis-db?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.

Search Discussions

  • Didier Spezia at May 3, 2013 at 4:59 pm
    The fragmentation ratio is defined as the ratio between RSS memory and used
    memory.

    /* Fragmentation = RSS / allocated-bytes */
    float zmalloc_get_fragmentation_ratio(void) {
    return (float)zmalloc_get_rss()/zmalloc_used_memory();
    }

    When there is no paging (which should be the normal situation with Redis),
    the RSS
    memory is a good indicator of Redis memory consumption as seen from the
    system.

    The used memory is the amount of memory given to Redis by the memory
    allocator,
    so it represents memory consumption as seen by Redis.

    When there is no paging, rss memory > used memory because of fragmentation
    and
    memory retention. So you should have a memory fragmentation ratio > 1.
    Something between
    1 and 1.5 looks perfectly fine to me (especially considering you had a
    previous peak
    of memory consumption up to 24M, down to 17M).

    When part of Redis memory has been swapped out (i.e. paging activity),
    the fragmentation ratio is meaningless, because RSS memory does not
    represent anymore the total memory consumption.

    Regards,
    Didier.

    On Friday, May 3, 2013 5:38:23 AM UTC+2, Morgan Cheng wrote:

    In the doc http://redis.io/commands/info, it mentions "Ideally, the
    used_memory_rss value should be only slightly higher than used_memory". So,
    I suppose the mem_fragmentation_ratio should be not around 1.0 ~ 1.2.

    Now, I have a Redis instance running with 2G max memory. The INFO reports:
    Cache Hit Rate: 91.0046%
    evicted_keys:0
    used_memory_human:16.99M
    used_memory_peak_human:24.03M
    mem_fragmentation_ratio:1.52

    It only uses peak 24.03M, but the mem_fragmentation_ratio is 1.52. It
    seems abnormal to me. The redis should not have any memory pressure, and
    the mem_fragmentation_ratio should be lower than 1.0, right? or, 1.5 is OK
    in this case?

    Thanks
    -Morgan
    --
    You received this message because you are subscribed to the Google Groups "Redis DB" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to redis-db+unsubscribe@googlegroups.com.
    To post to this group, send email to redis-db@googlegroups.com.
    Visit this group at http://groups.google.com/group/redis-db?hl=en.
    For more options, visit https://groups.google.com/groups/opt_out.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupredis-db @
categoriesredis
postedMay 3, '13 at 9:32a
activeMay 3, '13 at 4:59p
posts2
users2
websiteredis.io
irc#redis

2 users in discussion

Morgan Cheng: 1 post Didier Spezia: 1 post

People

Translate

site design / logo © 2022 Grokbase