-
Notifications
You must be signed in to change notification settings - Fork 23.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Check that THP is not set to always (madvise is ok) #4001
Conversation
Thanks @badboy, please could you make |
THP can also be set to madvise, in which case it shouldn't cause problems for Redis. Fixes #3895
Force-pushed with the changes. |
@badboy Wait a minute. According to this blog at DigitalOcean, using Redis with madvise actually caused memory release problems: https://blog.digitalocean.com/transparent-huge-pages-and-alternative-memory-allocators/ Wouldn't that mean that both "enabled" and "madvise" are problematic options and that the current warning as shown by Redis (with the recommendation to completely disable THP by setting it to "never") is actually justified? Or did I misread the blog? |
From my limited understanding of |
@volkertb I read the article and the problem there is caused by huge-pages, not by the
As neither Redis nor the bundled jemalloc will use the |
OK, thanks for checking and clarifying this, @badboy. I hope this pull request gets reviewed and approved soon. 🙂 |
With the kernel option set to Another thing: why are the server and the latency report using different ways to detect THP? |
Based on this thread I would rather be strict than wrong and leave things as they are, requiring |
i think @badboy is correct and that this pr can be merged as-is. when the setting is set to |
Ran across this when adding redis to a kubernetes cluster. Since it's a host/node level modification I would prefer using |
So that means this PR can now be merged, right? Or does it still require additional code reviews? |
@antirez Is the decision to leave this open then? Personally I've had customers ask about the message (when the value is set to 'madvise'). It is annoying THP doesn't impact redis (or jemalloc) and the theory that hugepaged causes latency issues when 'madvise' is set, is just that. Theory. There is no information, that I am aware of, that having the value set to 'madvise' and there being no THP consumers can cause a latency issue in redis. |
Assuming whoever changes the kernel config to |
I wonder how Google solved this for their "Memorystore" https://cloud.google.com/memorystore/docs/redis/. Maybe Redis team could leverage their Google Cloud partnership https://redislabs.com/partner/google/ and share the information? FWIW, the 190 Google Container Engine VMs I checked (COS images) all have |
Could redis maybe use this option?
This way, even if THP is always,it should in theory disable hugepages for redis memory allocations?... |
So what is the conclusion of this? Is the DO blog post valid for normal use cases? Like a stock Ubuntu 18.04 install? Since Ubuntu 18.04 madvise is the default both for transparent_hugepage/enabled and /defrag, and configuring it is really not simple anymore (no rc.local supplied, systemd unit needs to be created), it'd be a huge help for installlations if the default madvise could be used. |
@badboy considering the feedback we got from Jason in #3895 (comment) |
Since redis/redis#4001 included in 6.2.0 transparent hugepages works when being set to madvise which is the NixOS and upstream recommended default.
Since redis/redis#4001 included in 6.2.0 transparent hugepages works when being set to madvise which is the NixOS and upstream recommended default.
Since redis/redis#4001 included in 6.2.0 transparent hugepages works when being set to madvise which is the NixOS and upstream recommended default.
Since redis/redis#4001 included in 6.2.0 transparent hugepages works when being set to madvise which is the NixOS and upstream recommended default.
Since redis/redis#4001 included in 6.2.0 transparent hugepages works when being set to madvise which is the NixOS and upstream recommended default.
Since redis/redis#4001 included in 6.2.0 transparent hugepages works when being set to madvise which is the NixOS and upstream recommended default.
Since redis/redis#4001 included in 6.2.0 transparent hugepages works when being set to madvise which is the NixOS and upstream recommended default.
Since redis/redis#4001 included in 6.2.0 transparent hugepages works when being set to madvise which is the NixOS and upstream recommended default.
Since redis/redis#4001 included in 6.2.0 transparent hugepages works when being set to madvise which is the NixOS and upstream recommended default.
Since redis/redis#4001 included in 6.2.0 transparent hugepages works when being set to madvise which is the NixOS and upstream recommended default.
Since redis/redis#4001 included in 6.2.0 transparent hugepages works when being set to madvise which is the NixOS and upstream recommended default.
Since redis/redis#4001 included in 6.2.0 transparent hugepages works when being set to madvise which is the NixOS and upstream recommended default.
Since redis/redis#4001 included in 6.2.0 transparent hugepages works when being set to madvise which is the NixOS and upstream recommended default.
Since redis/redis#4001 included in 6.2.0 transparent hugepages works when being set to madvise which is the NixOS and upstream recommended default.
Since redis/redis#4001 included in 6.2.0 transparent hugepages works when being set to madvise which is the NixOS and upstream recommended default.
Since redis/redis#4001 included in 6.2.0 transparent hugepages works when being set to madvise which is the NixOS and upstream recommended default.
Since redis/redis#4001 included in 6.2.0 transparent hugepages works when being set to madvise which is the NixOS and upstream recommended default.
Since redis/redis#4001 included in 6.2.0 transparent hugepages works when being set to madvise which is the NixOS and upstream recommended default.
Since redis/redis#4001 included in 6.2.0 transparent hugepages works when being set to madvise which is the NixOS and upstream recommended default.
Since redis/redis#4001 included in 6.2.0 transparent hugepages works when being set to madvise which is the NixOS and upstream recommended default.
Since redis/redis#4001 included in 6.2.0 transparent hugepages works when being set to madvise which is the NixOS and upstream recommended default.
Since redis/redis#4001 included in 6.2.0 transparent hugepages works when being set to madvise which is the NixOS and upstream recommended default.
Since redis/redis#4001 included in 6.2.0 transparent hugepages works when being set to madvise which is the NixOS and upstream recommended default.
Since redis/redis#4001 included in 6.2.0 transparent hugepages works when being set to madvise which is the NixOS and upstream recommended default.
Since redis/redis#4001 included in 6.2.0 transparent hugepages works when being set to madvise which is the NixOS and upstream recommended default.
Since redis/redis#4001 included in 6.2.0 transparent hugepages works when being set to madvise which is the NixOS and upstream recommended default.
Since redis/redis#4001 included in 6.2.0 transparent hugepages works when being set to madvise which is the NixOS and upstream recommended default.
Since redis/redis#4001 included in 6.2.0 transparent hugepages works when being set to madvise which is the NixOS and upstream recommended default.
Since redis/redis#4001 included in 6.2.0 transparent hugepages works when being set to madvise which is the NixOS and upstream recommended default.
Since redis/redis#4001 included in 6.2.0 transparent hugepages works when being set to madvise which is the NixOS and upstream recommended default.
THP can also be set to madvise, in which case it shouldn't cause
problems for Redis.
Fixes #3895