logoalt Hacker News

AWS engineer reports PostgreSQL perf halved by Linux 7.0, fix may not be easy

347 pointsby crcastletoday at 12:13 AM105 commentsview on HN

https://lore.kernel.org/lkml/yr3inlzesdb45n6i6lpbimwr7b25kqk...


Comments

lfittltoday at 12:35 AM

Its worth reading this follow-up LKML post by Andres Freund (who works on Postgres): https://lore.kernel.org/lkml/yr3inlzesdb45n6i6lpbimwr7b25kqk...

show 5 replies
monocasatoday at 2:14 AM

I feel like using spinlocks in user space at all without kernel support like rseq is just asking for weird performance degradations.

show 2 replies
dsr_today at 12:45 AM

Nobody sensible runs the latest kernel; nobody running PG in production should be afraid of setting a non-default at either boot time or as a sysctl. So this will, most likely, be another step in building a PG database server (turn off pre-emption if your kernel is 7.0 or later and PG is pre-whatever-version).

At worst it might become a permanent part of building a PG server and a FAQ... but if it affects one thing this badly, it will affect others.

show 7 replies
harshrealitytoday at 1:43 AM

Background on PREEMPT_LAZY:

https://lwn.net/Articles/994322/

longislandguidotoday at 2:00 AM

Anyone check to see if Jia Tan has submitted any kernel patches lately?

show 1 reply
bob1029today at 7:54 AM

I'm struggling a bit with why we need all these fancy dynamic preemption modes. Is this about hyperscalars shoving more VMs per physical machine? What does a person trying to host a software solution gain from this kernel change?

If a user wants to spin in an infinite loop all day every day, I don't see the problem with that. Even if the spinning will provably never do any useful work.

show 1 reply
cpercivatoday at 2:09 AM

This makes me feel better about the 10% performance regression I just measured between FreeBSD 14 and FreeBSD 15.0.

show 1 reply
Deeg9rie9usitoday at 7:03 AM

Once again phoronix shoot out an article without further researching nor letting the mail thread in question cool down. The follow up mails make clear that the issue is more or less a non-issue since the benchmark is wrong.

show 1 reply
galbartoday at 1:17 AM

It's not a good look to break userspace applications without a deprecation period where both old and new solutions exist, allowing for a transition period.

show 1 reply
FireBeyondtoday at 12:40 AM

Once upon a time, Linus would shout and yell about how the kernel should never "break" userspace (and I see in some places, some arguments of "It's not broken, it's just a performance regression" - personally I'd argue a 50% hit to performance of a pre-eminent database engine is ... quite the regression).

Now, the kernel engineer who introduced the brand new mechanism (introduced in Linux 7.0) for handling pre-emption says the "fix" is for Postgres to start using this new mechanism (I think the sister comment below links to what one of the Postgres engineers thinks of that, and I'm inclined mostly to agree).

show 6 replies
anal_reactortoday at 5:43 AM

Can someone explain to me what's the problem? I have very little knowledge of Linux kernel, but I'm curious. I've tried reading a little, but it's jargon over jargon.

show 2 replies
up2isomorphismtoday at 6:24 AM

Not sure why people have to upgrade to the newest major kernel version as soon as it is released.

show 3 replies
lossothtoday at 8:51 AM

[dead]

carlsborgtoday at 9:34 AM

Perhaps in due time we will see workload specific forks of Linux maintained by a team of agents