Why Go Scales?
summary
Explains why Go scales: goroutines start with 2KB stacks that double when needed and shrink after use, so 10,000 goroutines cost ~20MB of stack, not gigabytes; the runtime uses a user‑space scheduler with cooperative preemption triggered by stack checks, channel ops and syscalls; network IO runs on a netpoll event loop while file IO uses a thread pool; a real Gett driver‑location service rewritten in Go handles ~2,000 req/min with ~2 ms latency using only a few instances.
AI-written summary · about
chapters (17)
- 0:00Start
- 3:38System K Problem
- 4:45The Issues with Thread per Connection
- 7:38How Does the Node Js Code Looks like
- 7:56The Benefits for Node Js
- 9:54How Does Gold Work Differently
- 10:24How Does Go Handle the Stack Why Do We Need a Stack
- 12:46Assembly Code
- 15:48Go Scheduler
- 18:17Pre-Emptive Scheduling
- 21:32Context Switching
- 22:06Thread Switching
- 23:17Go Routines Behave Differently
- 25:10What Happens with File I / O and Cisco
- 27:19Cpu Memory
- 36:12Inline Optimization
- 37:51The Reaction of the Engineers
