Inspiration
in our cdn company, we ran into a problem where our dns servers were hitting cpu starvation under heavy proxy loads. to fix this, we started playing with the kernel scheduler’s behavior, modifying parameters and approaches to find the most efficient setup. the process was slow and repetitive. I had to write and compile eBPF programs and hand them off to the SRE team to deploy and observe. after a few rounds of this, I realized we needed something simpler. what if the SREs could experiment on their own, using an easy-to-use tool like bpftrace? then, once they found a promising direction, we could step in to build an optimized eBPF implementation. that idea became the inspiration for building a flexible, human-friendly scripting language to explore scheduler tuning.
How we built it
i built this using the new feature in eBPF (sched_ext), which lets us to customize scheduler logic safely. to make it easy for others to experiment, I started with a simple parser, so no one has to write kernel code by hand! my livestreams on parts of the build process are available here: https://www.youtube.com/watch?v=u3aTpKRcXQQ
Challenges we ran into
at first, i wanted to use existing engines (E.g. v8) as its frontend. but i figured out that i want to build sth more friendly, simpler and light-weight for the end users. so i developed my own DSL. currently, it's not that optimized and works like an interpreter. I prepared a roadmap for schedra, in order to have more advanced optimizations (E.g. migrating to LLVM) so that we won't be worried about having more complicated scripts.
What's next for schedra
take a look at roadmap: https://github.com/amiremohamadi/schedra/tree/master?tab=readme-ov-file#roadmap
Log in or sign up for Devpost to join the conversation.