概要 christina04.hatenablog.com 以前上の記事でGOMAXPROCSはCPU数程度が適切に動くという話をしました。 これはこれで正しいのですが、一方でdockerのようにcgroupsでCPU Quotaを制限するケースではこれに当てはまらなくなります。 Kubernetesでいうと Kubernetesのresource requests, limits - Carpe Diem のようにlimitsを設定した場合ですね。 今回はその検証と対応方法についてまとめます。 環境 go 1.14.2 docker 19.03.8 CPU Quotaを制限してベンチマーク 以下の素数を算出するというCPUバウンドなプログラムを使います。 gotutorials/concprime at master · embano1/gotutorials · GitHub PCのC