Garbage Collector Pauses Due to Swapping During Go Program Execution for 40ms(frn.sh)
Writing language: KoreanRead in the original language
Plain summary
- The garbage collector (GC) in Go language reads metadata during execution pauses, and if this data resides in the disk swap area, delays of tens of milliseconds occur.
- An experiment under Linux kernel 6.8 environment showed pauses lasting up to 40ms when reading GC metadata stored in swap, about 800 times longer than usual pauses (test conducted on Hetzner cloud).
- Swap manages pages on a cgroup basis, so memory of other processes grouped with the Go process can be swapped as well. GC interruptions were observed 312 times over 30 minutes.
- Unlike metadata pauses, message handling time for 511KiB increased from 3~5ms to 105ms on NVMe drives, and up to 903ms on remote network storage, but this only affected the goroutine executing the task.
Found on
Hacker News ↗ / 64 votes / 28 comments
Have you run into something like this? Tell us in a line or two what you did. You do not need to know the product.