Redis Fragmentation on AIX

41 views
Skip to first unread message

Rangan

unread,
Aug 27, 2015, 11:36:17 AM8/27/15
to Redis DB
Hi folks, 
I am running a local Redis server with persistence disabled on AIX. The instance is configured for a maxmemory of 30gb with lru eviction policy.

Currently when I run INFO on my server, I get 

# Server
redis_version:3.0.3
redis_git_sha1:00000000
redis_git_dirty:0
redis_build_id:ae051bbcbfe30e86
redis_mode:standalone
os:AIX 1 00F79B9A4C00
arch_bits:64
multiplexing_api:select
gcc_version:4.8.4

uptime_in_seconds:147212
uptime_in_days:1
hz:10
lru_clock:14624050

# Memory
used_memory:23058325856
used_memory_human:21.47G
used_memory_rss:23058288192
used_memory_peak:23217251248
used_memory_peak_human:21.62G
used_memory_lua:36864
mem_fragmentation_ratio:1.00
mem_allocator:libc


However, top and other similar tools on my machine reports that the Redis server is taking around 28gb. 

I am guessing this is a result of fragmentation but I am curious why is this not reported in the mem_fragmentation_ratio (1.00 in fragmentation_ratio seems very suspicious)? 

Didier Spezia

unread,
Aug 27, 2015, 12:51:55 PM8/27/15
to Redis DB

Because there is no AIX specific code to evaluate the resident set size ...

size_t zmalloc_get_rss(void) {
    /* If we can't get the RSS in an OS-specific way for this system just
     * return the memory usage we estimated in zmalloc()..
     *
     * Fragmentation will appear to be always 1 (no fragmentation)
     * of course... */
    return zmalloc_used_memory();
}

Rangan

unread,
Aug 27, 2015, 1:05:58 PM8/27/15
to Redis DB
Ah , indeed ! Thanks , I can add a block for that and submit a PR for the same. 

Also does eviction policy kick in when memory used by Redis reaches maxmemory or when RSS memory reported hits maxmemory ? 

Didier Spezia

unread,
Aug 27, 2015, 4:20:48 PM8/27/15
to Redis DB
AFAIK, it kicks in when used memory (as accounted by Redis)  reaches maxmemory.
It does not take in account the internal or external fragmentation overhead.
That's why it is probably wise to be conservative when setting maxmemory.

Regards,
Didier.
Reply all
Reply to author
Forward
0 new messages