Hello everybody,<br><br>I've conducted quite a lot of performance research recently, mostly concerning desktop use case, but I've got some things to share about realtime use cases too.<br><br>Ulatencyd would probably be handy for you; it's a supervisor daemon which prioritizes processes for resource allocation, gives some processes realtime privileges if needed and arranges processes in cgroups. It can decrease latency by smarter resource allocation and getting low-priority tasks out of the way of media apps. It's being tested in elementary OS daily builds and the results we've got so far are impressive. I'm currently working with its author on expanding default configs to accommodate more use cases.<br>
<br>Another useful thing would be avoiding swapping for as long as possible. In Linux there are several facilities competing for RAM - in Ubuntu's stock configuration executable code often gets swapped to disk to make way for various caches. Here's the best article I've found about it so far: <a href="http://rudd-o.com/linux-and-free-software/tales-from-responsivenessland-why-linux-feels-slow-and-how-to-fix-that">http://rudd-o.com/linux-and-free-software/tales-from-responsivenessland-why-linux-feels-slow-and-how-to-fix-that</a> Maybe there's something better in kernel documentation, but I'm not aware of that.<br>
<br>Apart from tuning RAM allocation you can compress less important parts of RAM instead of swapping them to disk using zcache or zram (depending on what's more important for you - caches or code). I've got an overview of both at <a href="http://shnatsel.blogspot.com/2012/04/5-ideas-that-every-desktop-os-should.html">http://shnatsel.blogspot.com/2012/04/5-ideas-that-every-desktop-os-should.html</a><br>
<br>The most recent item and probably the hardest for you to implement is using a different CPU scheduler. Linux's default CFS is not a good thing for realtime workloads mostly because it's not designed for them. For example, it may very well make two realtime processes compete for accessing one CPU core even if there are "spare" cores availalble (according to <a href="http://ck.kolivas.org/patches/bfs/bfs-faq.txt">BFS FAQ</a> anyway). So it might be a good idea to look into using RIFS: <a href="http://www.phoronix.com/scan.php?page=news_item&px=MTEwMjQ">http://www.phoronix.com/scan.php?page=news_item&px=MTEwMjQ</a><br>
Unlike I/O schedulers, changing CPU scheduler requires patching the kernel, so I doubt you'll be able to tackle it soon.<br><br>Hope this will be useful for you. Corrections and suggestions are always welcome.<br><br>
Cheers,<br>-- <br>Sergey "Shnatsel" Davidoff<br>OS integrator @ elementary<br><br>