On Tue, 19 Mar 2019 00:45:36 -0700 (PDT)
hva...@gmail.com wrote:
> I did a Google search for [ linux kernel "transparent_hugepage" ]
> (without the square brackets). The first answer was from
>
kernel.org:
>
https://www.kernel.org/doc/Documentation/vm/transhuge.txt . The
> sentence "This is the default behavior" was in that doc.
>
> Apparently the maintainers of your Linux distribution changed the
> kernel config from the documented default in the code. That's not
> unusual, though.
Thanks. I hadn't seen that page. I didn't use 'kernel' when searching
so perhaps that's why. BTW, the text doesn't contain the sentence you
'quoted'. The text contains the word 'behaviour' rather than 'behavior'.
The madvise default you mention is in repect of the defrag option, not
the enabled option, and indeed the default on my openSUSE system of the
defrag option is 'madvise'. But it's the enabled option that I'm
interested in and a default for that doesn't appear to be stated.
> The first paragraph from the doc page I linked says:
>
> Performance critical computing applications dealing with large memory
> working sets are already running on top of libhugetlbfs and in turn
> hugetlbfs. Transparent Hugepage Support is an alternative means of
> using huge pages for the backing of virtual memory with huge pages
> that supports the automatic promotion and demotion of page sizes and
> without the shortcomings of hugetlbfs.
>
> The Linux kernel has many, many configuration options, and it's easy
> to start sniffing down the trail of one or two of them, thinking you
> will reap performance rewards, only to find yourself at the end of a
> time-consuming journey that improves your daemon's performance by a
> mere 0.1% with the hardware you have, or with the traffic you'll
> receive for the first 2 years of operation, or the size of your data
> set for those first 2 years. The first 10 words of the THP doc
> (yellow highlighted by me)
Sorry, I read plain text email. But I can count :)
> indicates it's designed for situations
> that will almost never be found on a laptop: (a) performance
> critical and (b) large amounts of data in memory.
True. Fortunately (?) I don't have any laptops.
> I say "performance critical" won't be found on most desktop or laptop
> machines because the overwhelming majority of performance hits a
> daemon like Redis sees on these machines come from the other software
> components it must share memory and cpu with - the graphical
> display's windowing system, unexpected bursts of cpu, memory, and
> disk io usage from compilers or high-level language runtime
> environments (Java, Ruby, Python, etc.), any of which will completely
> overshadow any impediments from not using THP.
>
> I would like to suggest that you don't need to go against Redis's
> advice about THP unless you're handling hundreds of GB of data in
> memory on a server that's dedicated to Redis, where you've solved the
> other sources of latency discussed in
https://redis.io/topics/latency
> (which describes the kind of latency you get when THP is enabled), so
> the primary source of Redis performance trouble will come down to a
> kernel tuning issue.
Well, I tend to agree with your opinion, but equally I tend to trust
openSUSE's settings and don't like arbitrary changes - as you say
chasing rabbits down a hole can be pointless, and I also don't
understand why redis' problem wouldn't be solved by a madvise setting.
Maybe I'll bug-report both redis and openSUSE and see who comes up with
the best-reasoned explanation. But I'd rather avoid bothering the devs
if anybody else actually knows the answers.
Thanks for investigating this with me.