Live data from Hacker News

Bpftune uses BPF to auto-tune Linux systems

github.com

11–20 of 78 posts

Re: Bpftune uses BPF to auto-tune Linux systems

#11
post #3

Interesting. But if tuning parameters to their best values were easy, shouldn't the kernel just do that in the first place?

I would reverse the question: if it can be done by a BPF module, why should it be in the kernel? Distributions turning it on by default is another story. Maybe it deserves to be shiped on all the time but that's not the same thing as being part of the kernel.

Indeed!

The kernel might already be too monolithic.

This kernel parameters optimisation reminds me of PGO compilation in programs.

Yet, perhaps the kernel could come with multiple defaults config files, each being a good base for different workloads: server, embedded, laptop, mobile, database, router, etc.

Re: Bpftune uses BPF to auto-tune Linux systems

#13
Two words: “feedback loop”.

That was the first idea that jumped in when thinking in what could go wrong, not because the Linux kernel, or BPF or this program, just for how it is intended to work. There might be no risk of that happening, there may be controls around that, or if they happen they might only converge to an estable state, but still it is something to have in the map.

Re: Bpftune uses BPF to auto-tune Linux systems

#14
I wonder how effective this would be in multi-tenant environments like shared k8s clusters. On the one hand, each application running will have a different purpose and will move around between nodes over time, but on the other hand there are likely broad similarities between most applications.

Re: Bpftune uses BPF to auto-tune Linux systems

#15

Two words: “feedback loop”. That was the first idea that jumped in when thinking in what could go wrong, not because the Linux kernel, or BPF or this program, just for how it is intended to work. There might be no risk of that happening, there may be controls around that, or if they happen they might only converge to an estable state, but still it is something to have in the map.

> or if they happen they might only converge to an stable state

That one will always be dependent on the usage patterns. So the auto-tuner can't guarantee it.

Also, I imagine the risk of the feedback turning positive is related to the system load (not CPU, but the usage of the resources you are optimizing). If so, it will make your computer less able to manage load. But this can still be useful for optimizing for latency.

Re: Bpftune uses BPF to auto-tune Linux systems

#16
post #9

Is tuning the TCP buffer size for instance worth it?

It depends. At home - probably not. On a fleet of 2000 machines where you want to keep network utilisation close to 100% with maximal throughput, and the non-optional settings translate to a not-trivial value in $ - yes.

TCP parameters are a classic example of where an autotuner might bite you in the ass...

Imagine your tuner keeps making the congestion control more aggressive, filling network links up to 99.99% to get more data through...

But then any other users of the network see super high latency and packet loss and fail because the tuner isn't aware of anything it isn't specifically measuring - and it's just been told to make this one application run as fast as possible.

Re: Bpftune uses BPF to auto-tune Linux systems

#17
> bpftune is designed to be zero configuration; there are no options

On behalf of every junior administrator, overworked IT admin, and security-concerned "cattle" wrangler, thank you.

Having to learn a thousand+ knobs & dials means most will never be touched. I for one welcome automated assistance in this area, even if the results are imperfect.

Re: Bpftune uses BPF to auto-tune Linux systems

#20

With this tool I am wary that I'll encounter system issues that are dramatically more difficult to diagnose and troubleshoot because I'll have drifted from a standard distro configuration. And in ways I'm unaware of. Is this a reasonable hesitation?

>"bpftune logs to syslog so /var/log/messages will contain details of any tuning carried out." (from OP GitHub readme)

The rmem example seems to allay fears that it will make changes one can't reverse.

Post reply on HN