Tune GitHub Runner VM options to increase working RAM and improve performance (#10239)
Tune GitHub Runner VM options to increase working RAM and improve performance (#10239)

- The default vm.swappiness setting is 60 which has a tendency to start swapping when memory
  consumption is high.
  - Set vm.swappiness=1 to avoid swapping and allow high RAM usage

- Use "madvise" Linux Transparent HugePages (THP) setting
  - https://www.kernel.org/doc/html/latest/admin-guide/mm/transhuge.html
  - "madvise" is generally a better option than the default "always" setting

- Tune filesystem mount options, https://www.kernel.org/doc/Documentation/filesystems/ext4.txt
  - commit=999999, effectively disables automatic syncing to disk (default is every 5 seconds)
  - nobarrier/barrier=0, loosen data consistency on system crash (no negative impact to empheral CI nodes)

- disable discard/trim at device level since remount with nodiscard doesn't seem to be effective

- disable any background jobs that run SSD discard/trim
  - SSD discard/trim has negative performance impact
    - https://docs.microsoft.com/en-us/azure/virtual-machines/linux/attach-disk-portal#trimunmap-support-for-linux-in-azure
    - On Azure VMs, the reason to use discard/trim is to optimize storage cost on virtual disks.
    - This isn't useful on empheral CI nodes
merlimat/pulsar,massakam/pulsar,merlimat/pulsar,massakam/pulsar,yahoo/pulsar,merlimat/pulsar,merlimat/pulsar,merlimat/pulsar,yahoo/pulsar,massakam/pulsar,yahoo/pulsar,massakam/pulsar,yahoo/pulsar,massakam/pulsar,merlimat/pulsar,massakam/pulsar,yahoo/pulsar,yahoo/pulsar