CentOS 7 tuned profile for redisUpdated at by ospi
Redis might spill a few warnings about transparent hugepages, overcommit memory or tcp backlog during startup depending on your OS and redis configuration. Instead of fiddling with
/etc/sysctl.conf, kernel line
/etc/rc.local and whatnot, you can use a tuned profile to fix all of those.
Check the current active profile, which is
virtual-guest in this example.
cat /etc/tuned/active_profile virtual-guest
Create a new profile for redis
Copy the current active profile from
cp /usr/lib/tuned/virtual-guest/tuned.conf /etc/tuned/hurr-durr-redis/
/etc/tuned/hurr-durr-redis/tuned.conf and add the blocks and/or lines depending on what warnings you got.
[main] include=throughput-performance [vm] # Redis : WARNING you have Transparent Huge Pages (THP) support enabled in your kernel. This will create latency and memory usage issues with Redis. # Fix by disabling THP transparent_hugepages=never [sysctl] # Copied from 'virtual-guest' in /usr/lib/tuned/virtual-guest/tuned.conf vm.dirty_ratio = 30 vm.swappiness = 30 # Redis : WARNING overcommit_memory is set to 0! Background save may fail under low memory condition. # Fix by enabling vm.covercommit_memory vm.overcommit_memory = 1 # Redis : WARNING: The TCP backlog setting of 511 cannot be enforced because /proc/sys/net/core/somaxconn is set to the lower value of 128 # Fix by setting somaxconn value over 511 net.core.somaxconn = 512
Reload tuned.service (might not be necessary)
systemctl reload tuned.service
List all profiles and you should see your new redis profile in the list.
Set the new profile as active
tuned-adm profile hurr-durr-redis
And restart redis
systemctl restart redis.service
Update 2018-04-30 tuned version and After
Thank you Mufit Eribol for pointing out that on reboot tuned profile was not applied in time. Extend
redis.service configuration with following snippet in
An issue on Github also affects this setup as CentOS 7 @updates has tuned 2.8. In order to update tuned to version 2.9 you need to enable continous release repository.
Hopefully no more warnings :)