Ask HN: Is there any tool for benchmarking responsiveness for Linux?
System76 recently announced their responsiveness optimizer, System76 Scheduler [0], which basically works as a daemon, adjusting the nice value and the CFS knobs for processes in the box for increased responsiveness. They've claimed that the responsiveness is therefore increased, which I'm also believed so.
However, this got me wondering, is there exists any tool that can report the "numbers" (e.g., scheduling latency) regarding to the responsivenss? Maybe Google has such tool for testing regression for Android or Chrome OS, sadly, I didn't managed to find one.
Thanks!
47 comments
[ 3.2 ms ] story [ 124 ms ] threadI very often use num lock and caps lock responsiveness to check if my PC has hard-locked, and I just recently suffered hard locks while testing S3 on Linux on a new PC. So I am very sure at this point :)
For the camera measurement, I would just press the key as fast as possible and pick about 3/4 of the way down as the trigger point.
https://danluu.com/keyboard-latency/ puts a lot of keyboards >= 30 ms which is an insane amount of latency
It's a fair point for the gaming argument they make, if you want to jump 30ms quicker you'll need shorter keys. But it's not really correct to say the keyboard is adding so much latency when it's actually the user.
The key travel time on https://www.amazon.com/gp/product/B0000U1DJ2/ and https://www.amazon.com/gp/product/B00DGJALYW is substantially the same, yet one has 20 ms of latency, and the other 55 ms.
https://github.com/willmuldrew/lagmeter
(It attempts to do a few other things but it’s best for measuring keyboard event to screen update latency)
[1]: https://www.nvidia.com/en-us/geforce/news/nvidia-reviewer-to...
SchedLat (https://tanelpoder.com/posts/schedlat-low-tech-script-for-me...) is one tool/approach to doing this, but it's a bit out of date.
Was mentioned on HN some time ago.
[0] https://github.com/zen-kernel/zen-kernel
[1] https://liquorix.net/
https://github.com/zen-kernel/zen-kernel
One of the good things it's that includes patches that allow Anbox to run so I can use Android apps.
Note that Liqourix is not the Zen kernel though.
How much can you slow down a cpu anyway? Can you slow it to 1/10th its clock speed? I would think the best way to measure things like this is to slow down the overall system speed as much as possible.
https://wiki.linuxfoundation.org/realtime/documentation/howt...
But beware, "scheduling latency" has very little to do with responsiveness as it would appear to a user of some desktop environment.
You can also watch FPS of supertuxkart when the system is under load: https://www.youtube.com/watch?v=c5bAOJkX_uc https://github.com/hakavlad/le9-patch
But yes, we need a popular well behaved benchmark to measure desktop responsiveness.
It has the advantage of using game console joypads as inputs, and hacking them to read the buttons etc directly, i.e. without relying on USB. I imagine a specialized version that just sampled a mouse button would be more useful in the context of a computer running desktop apps.
Apologies if I completely misunderstood the intent of this post.
[1] https://www.benheck.com/xbox1monitor/
And afaik, the 'sauce' used in Liquorix is MuQSS, by Con Kolivas. But the project has been put on ice somewhat recently[0].
[0]https://ck-hack.blogspot.com/2021/08/514-and-future-of-muqss...
- eBPF script: https://www.brendangregg.com/blog/2016-10-08/linux-bcc-runql...
- perf sched: https://www.brendangregg.com/blog/2017-03-16/perf-sched.html
- schedlat: https://tanelpoder.com/posts/schedlat-low-tech-script-for-me...
The last one (written by me) is using /proc/PID/schedstat pseudofile for monitoring % time spent in the CPU runqueue of a single process (not systemwide). I don't always have (root) access for running perf or eBPF scripts (or the old Linux/kernel version don't allow that). But I can still measure how much time a process on a request's critical path (like a RDBMS transaction log writer on commit) spent waiting to get back onto CPU before doing any work.
Like others have already said, the OS CPU queuing/scheduling latency is just one component contributing to the total responsiveness/reaction latency of your app.
This is the goto tool for measuring SCHED_FIFO (realtime) scheduling performance. If you really care about responsiveness in a broad sense (not just user/GUI), this is likely to play some role your testing process.
I'd be curious to know your results regardless of the technique used.
[0] https://pavelfatin.com/typing-with-pleasure/ [1] https://github.com/pavelfatin/typometer