Hello, thanks for writing, I read:
> - there is no huge pages, no persistence at all
Warning, huge pages have issues even if persistence is disabled, it is
actually totally switched off? Thanks.
Ok thanks, from the stack trace it looks like due to jemalloc internal
efforts to defragment. Did you tried to compile Redis with just libc
malloc support? Make MALLOC=libc.
If this does not cause fragmentation with your work load, or if it
causes acceptable fragmentation, this may be a possible fix.
You may also try to switch to different version of jemalloc, since
what you are using, 2.8.12, is the first version to adopt jemalloc
3.6.0. However I believe that tuning parameters may prevent this, but
I don't have experience with jemalloc parameter tuning since it's the
first time I see this kind of latency.
Le mardi 9 décembre 2014 17:21:31 UTC+1, Salvatore Sanfilippo a écrit :Ok thanks, from the stack trace it looks like due to jemalloc internal
efforts to defragment. Did you tried to compile Redis with just libc
malloc support? Make MALLOC=libc.
If this does not cause fragmentation with your work load, or if it
causes acceptable fragmentation, this may be a possible fix.
You may also try to switch to different version of jemalloc, since
what you are using, 2.8.12, is the first version to adopt jemalloc
3.6.0. However I believe that tuning parameters may prevent this, but
I don't have experience with jemalloc parameter tuning since it's the
first time I see this kind of latency.
Ok thanks, tomorrow I will try with MALLOC=libc
If it fix the problem, I will test a little further with jemalloc parameters.
Interested to understand what are the cons as well, if there are no
obvious cons in the Redis use case, I'm going to implement this by
default.
AFAIK we have little need for madvise since Redis memory should not
get (and does not) get swapped normally, and to purge pages to reclaim
memory is something you rarely see anyway (if not with very sequential
access patterns) because of fragmentation. Instead latency is a known
nightmare.
Waiting more inputs before to act. Thank you.
Please could you post the info output? Thx
Please could you post the info output? Thx
THP disabled? It's basically the same behavior, latency-wise. A few
peaks. Otherwise it's clear that jemalloc is not the holy allocator
that gets all the tradeoffs right, because libc malloc provides a much
better worst latency experience.
On Fri, Dec 12, 2014 at 9:35 PM, Fabien MARTY <fabien...@gmail.com> wrote:
> Yes, totally switched off:
Ok, I guess that jemalloc + big allocations = latency, at least in the
default configuration. The price here is more fragmentation from libc
malloc(), but if the allocations are large, libc malloc should do a
decent job.
This is what I see from your previous messages:
used_memory_human:311.55M
used_memory_rss:19263098880
used_memory_peak:12889720904
used_memory_peak_human:12.00G
used_memory_lua:33792
mem_fragmentation_ratio:58.97
mem_allocator:libc
Peak 12GB, Used memory 331M. This is not fragmentation, it's just
unreclaimed memory.
When the server was full fragmentation was 1.52, which is not stellar
but is acceptable if it gives you much better latency for your
workload.
So I think you should try to test if fragmentation for your workload
is bound with libc malloc, and is a reasonable value. If it is fixed
at ~1.52 or alike, it can be a good tradeoff.
More or less there are no alternatives, since a slab allocator is also
going to have overhead as well. The other option I see is to tune
jemalloc for latency but this may result into it having the same
fragmentation as libc malloc in the end...
Hello Yiftach, we used to have tcmalloc support, but it rarely
performed better than jemalloc from what I recall, however the support
is still integrated in the makefile AFAIK, and both the allocators
changed over the years.