TE
ТехЭхо
ГлавнаяТоп за 24 часаНовейшиеЛучшиеВопросыПоказатьВакансии
GitHubTwitter
Главная

ТехЭхо

Платформа технологических новостей, созданная с использованием Next.js, предоставляющая глобальные технологические новости и обсуждения.

GitHubTwitter

Главная

ГлавнаяНовейшиеЛучшиеВопросыПоказатьВакансии

Ресурсы

HackerNews APIОригинальный HackerNewsNext.js

© 2025 ТехЭхо. Все права защищены.

Understanding the Go Scheduler

179 балловавтор: gnabgib7 дней назад

6 comments

__turbobrew__4 дня назад
Make sure you set GOMAXPROCS when the runtime is cgroup limited.<p>I once profiled a slow go program running on a node with 168 cores, but cpu.max was 2 cores for the cgroup. The runtime defaults to set GOMAXPROCS to the number of visible cores which was 168 in this case. Over half the runtime was the scheduler bouncing goroutines between 168 processes despite cpu.max being 2 CPU.<p>The JRE is smart enough to figure out if it is running in a resource limited cgroup and make sane decisions based upon that, but golang has no such thing.
评论 #44055856 未加载
评论 #44058136 未加载
评论 #44056125 未加载
jasonthorsness4 дня назад
It&#x27;s always a sign of good design when something as complex as the scheduler described &quot;just works&quot; with the simple abstraction of the goroutine. What a great article.<p>&quot;1&#x2F;61 of the time, check the global run queue.&quot; Stuff like this is a little odd; I would have thought this would be a variable dependent on the number of physical cores.
评论 #44058144 未加载
kortex4 дня назад
Fantastic writeup! Visualizations are great, the writeup is thorough but readable.
weiwenhao3 дня назад
Your write-up is so detailed that I even feel like I could implement a complete golang scheduler myself
davidw3 дня назад
I&#x27;d be interested in seeing a comparison of this and the BEAM&#x2F;Erlang&#x2F;Elixir scheduler by someone paying attention to the details.
90s_dev4 дня назад
I heard that the scheduler is a huge obstacle to many potential optimizations, is that true?
评论 #44055453 未加载