THP

239 views
Skip to first unread message

Kevin Burton

unread,
Feb 28, 2015, 5:48:33 PM2/28/15
to redi...@googlegroups.com
I get a warning that Transparent Huge Pages (THP) support is enabled along with a reommendation that I put 'echo never > /sys/kernel/mm/transparent_hugepage/enabled' in the rc.local. I did that and I still get the warning.

Jan-Erik Rediger

unread,
Mar 1, 2015, 6:45:42 AM3/1/15
to redi...@googlegroups.com
What's the current value?

cat /sys/kernel/mm/transparent_hugepage/enabled

Did you restart? Do even have a system that still uses rc.local?
If you did not restart, did you enable it manually?
> --
> 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+u...@googlegroups.com.
> To post to this group, send email to redi...@googlegroups.com.
> Visit this group at http://groups.google.com/group/redis-db.
> For more options, visit https://groups.google.com/d/optout.

Kevin Burton

unread,
Mar 1, 2015, 1:47:34 PM3/1/15
to redi...@googlegroups.com, jan...@fnordig.de
Thank you for your interest.

cat /sys/kernel/mm/transparent_hugepage/enabled  -> always madvise [never]

I have restarted a few times.

I don't know how to tell whether my system uses rc.local. I am just following the instructions in the warning. I am running Ubuntu
.
I try sudo echo never > /sys/kernel/mm/transparent_hugepage/enabled 

and I get

bash: /sys/kernel/mm/transparent_hugepage/enabled: Permission denied

so if I get permission denied even when I 'sudo' maybe that is why the rc.local is not taking into effect?

Thanks again.

Jan-Erik Rediger

unread,
Mar 1, 2015, 4:07:45 PM3/1/15
to redi...@googlegroups.com
Well, the "Permission denied" error is because the sudo only applies to
the "echo never", not to the stdout redirection.

Use "echo never | sudo tee /sys/kernel/mm/transparent_hugepage/enabled"
to manually set it to never.

But if your output already gives "[never]" that means THP is disabled,
so it's not clear why Redis is still giving you the warning.
> > an email to redis-db+u...@googlegroups.com <javascript:>.
> > > To post to this group, send email to redi...@googlegroups.com
> > <javascript:>.

Kevin Burton

unread,
Mar 2, 2015, 12:37:01 AM3/2/15
to redi...@googlegroups.com, jan...@fnordig.de
Thank you for your help. I guess it will remain a mystery.

Have you any clue on how to get rid of the second warning?

1096:M 01 Mar 23:31:19.123 # WARNING: The TCP backlog setting of 511 cannot be enforced because /proc/sys/net/core/somaxconn is set to the lower value of 128.

Here I cannot edit the file because when I save it I get an 'fcync' error.

Greg Andrews

unread,
Mar 2, 2015, 2:49:56 AM3/2/15
to redi...@googlegroups.com
Files under /proc are not really files, so you can't use a text editor on them.  The Linux kernel exposes a number of internal variables and data structures as if they were directories and files in a filesystem mounted under /proc.  For writable things like /proc/sys/net/core/somaxconn, you simply write to them, with a command like "echo 512 > /proc/sys/net/core/somaxconn".  You can read the file to verify your change was made.

Such changes are temporary - after a reboot, the kernel will revert to its default value.  See the man page for the sysctl command for info on how to make changes that will be automatically re-applied during a reboot (the /etc/sysctl.conf file).

  -Greg



To unsubscribe from this group and stop receiving emails from it, send an email to redis-db+u...@googlegroups.com.
To post to this group, send email to redi...@googlegroups.com.

Kevin Burton

unread,
Mar 2, 2015, 8:28:49 AM3/2/15
to redi...@googlegroups.com
Thank you. Two questions.

1) Given the man page looks like:
NAME
       sysctl - configure kernel parameters at runtime

SYNOPSIS
       sysctl [-n] [-e] variable ...
       sysctl [-n] [-e] [-q] -w variable=value ...
       sysctl [-n] [-e] [-q] -p [filename]
       sysctl [-n] [-e] -a
       sysctl [-n] [-e] -A

What is the 'variable' for this setting? when I do sysctl -a I don't see just these variable names (I do see net.ipv4.tcp_max_syn_backlog and net.core.somaxcon. Are they the same thing? So I am assuming that the warning will be fixed with:
sysctl -w net.core.somaxconn=511
sysctl -w net.ipv4.tcp_max_syn_backlog=511
When I reboot the setting remains unchanged (e.g. using sysctl -a | grep somaxconn)
2) I am assuming that since this seems to be a default value it is the recommended setting for Redis. But what does 'TCP backlog setting" control? I see in the commented redis conf:
# TCP listen() backlog.
#
# In high requests-per-second environments you need an high backlog in order
# to avoid slow clients connections issues. Note that the Linux kernel
# will silently truncate it to the value of /proc/sys/net/core/somaxconn so
# make sure to raise both the value of somaxconn and tcp_max_syn_backlog
# in order to get the desired effect.
tcp-backlog 511

It mentions two settings. Are this 'variables' in sysctl speak? I am not sure what each 'variable' is doing?

Thanks again.

Dominic Hopf

unread,
Mar 3, 2015, 5:32:56 PM3/3/15
to redi...@googlegroups.com
You'd either need to reboot the machine after that or execute the
command once:

echo never > /sys/kernel/mm/transparent_hugepage/enabled

Please also have a look into the documentation on this topic:

http://redis.io/topics/latency


Best Regards,
Dominic


--
Dominic Hopf
http://dominichopf.de/

Key Fingerprint: A7DF C4FC 07AE 4DDC 5CA0 BD93 AAB0 6019 CA7D 868D
signature.asc

Kevin Burton

unread,
Mar 5, 2015, 9:29:00 AM3/5/15
to redi...@googlegroups.com
Like I posted towards the beginning of the thread. I think it is already set:

Kevin Burton

unread,
Apr 9, 2015, 10:30:14 AM4/9/15
to redi...@googlegroups.com
Any word on this? Anyone else get this warning?
Reply all
Reply to author
Forward
0 new messages