TE
TechEcho
AccueilTop 24hRécentsMeilleursQuestionsPrésentationsEmplois
GitHubTwitter
Accueil

TechEcho

Une plateforme d'actualités technologiques construite avec Next.js, fournissant des nouvelles et discussions technologiques mondiales.

GitHubTwitter

Accueil

AccueilRécentsMeilleursQuestionsPrésentationsEmplois

Ressources

HackerNews APIHackerNews OriginalNext.js

© 2025 TechEcho. Tous droits réservés.

Understanding the Go Scheduler

179 pointspar gnabgibil y a 7 jours

6 comments

__turbobrew__il y a 4 jours
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 未加载
jasonthorsnessil y a 4 jours
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 未加载
kortexil y a 4 jours
Fantastic writeup! Visualizations are great, the writeup is thorough but readable.
weiwenhaoil y a 3 jours
Your write-up is so detailed that I even feel like I could implement a complete golang scheduler myself
davidwil y a 3 jours
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_devil y a 4 jours
I heard that the scheduler is a huge obstacle to many potential optimizations, is that true?
评论 #44055453 未加载