IssueRaiser

runtime: investigate possible Go scheduler improvements inspired by Linux Kernel's CFS

***First, please let me pay tribute to your contributions. You guys are awesome! And Go is so marvelous!*** It has been more than ten years, and Go has already been very successful. So, I think it is time to give Go a better scheduler -- maybe like the [CFS scheduler](https://en.wikipedia.org/wiki/Completely_Fair_Scheduler) of Linux kernel. The current implementation of the scheduling strategy of the Go runtime scheduler is basically Round-Robin scheduling. But in practical application scenarios, priority relationships may need to exist between different types of tasks or even between tasks of the same type. For example, if we want to use Go to implement a storage engine, in general, I/O tasks should have higher priority than any other CPU intensive tasks. Because in this case, the system bottleneck is more likely to be in disk I/O, not CPU. For another example, we may use Go to implement a network service, which is required to ensure the latency of some certain lightweight tasks even while other goroutines are quite CPU intensive. However, in the current implementation of Go runtime, if there are a certain number of CPU intensive tasks that need to run for a long time, it will inevitably impact the scheduling latency. Therefore, we need a real mature Go scheduler like the CFS scheduler in kernel. From another perspective, we could compare the thread model provided by kernel with the goroutine model provided by Go. In addition to the inherent low-cost and high-concurrency

Posted by hnes on Feb 8, 2022, 2:02 PM

Tags

Related issues

Raise real-world problems, find people facing the same issue, and discuss solutions.2,500 issues0 comments

pricing (Network)

runtime: investigate possible Go scheduler improvements inspired by Linux Kernel's CFS

hnesFeb 8, 2022, 2:02 PM

***First, please let me pay tribute to your contributions. You guys are awesome! And Go is so marvelous!*** It has been more than ten years, and Go has already been very successful. So, I think it is time to give Go a better scheduler -- maybe like the [CFS scheduler](https://en.wikipedia.org/wiki/Completely_Fair_Scheduler) of Linux kernel. The current implementation of the scheduling strategy of the Go runtime scheduler is basically Round-Robin scheduling. But in practical application scenarios, priority relationships may need to exist between different types of tasks or even between tasks of the same type. For example, if we want to use Go to implement a storage engine, in general, I/O tasks should have higher priority than any other CPU intensive tasks. Because in this case, the system bottleneck is more likely to be in disk I/O, not CPU. For another example, we may use Go to implement a network service, which is required to ensure the latency of some certain lightweight tasks even while other goroutines are quite CPU intensive. However, in the current implementation of Go runtime, if there are a certain number of CPU intensive tasks that need to run for a long time, it will inevitably impact the scheduling latency. Therefore, we need a real mature Go scheduler like the CFS scheduler in kernel. From another perspective, we could compare the thread model provided by kernel with the goroutine model provided by Go. In addition to the inherent low-cost and high-concurrency

Comments (0)

No comments yet. Start the discussion.

Comment on this issue