‹ BackHN Continuity

Thread

A 40ms Go garbage collector pause caused by swap

94 points · 92 comments · shellpipe

  1. jacobgold · · focus · HN ↗
    "It hurts when I do this"

    "Stop doing that"

    If you care about latency, disable swap. System wide or for the specific the cgroup.

    1. delamon · · focus · HN ↗
      This is not entirely correct. If you care about latency, then it doesn't matter on which major fault your application gets paused. Disabling swap protects you from data pages being evicted, but code pages can still be paged out.

      If you care about latency, mlock() your memory, do not disable swap. Swap is good and gives the kernel an equal opportunity to evict data and code pages.

      1. quotemstr · · focus · HN ↗
        Plus, it wouldn't necessarily be that hard to selectively mlock the pages accessed in STW critical regions.
Open on Hacker News to reply ↗

Unofficial Hacker News client; not affiliated with Y Combinator.