{"id":360044,"date":"2024-05-21T00:45:05","date_gmt":"2024-05-21T00:45:05","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=360044"},"modified":"-0001-11-30T00:00:00","modified_gmt":"2024-05-21T00:45:05","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=360044","title":{"rendered":"<span>\u041a\u0430\u043a \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0440\u0435\u0441\u0443\u0440\u0441\u044b Kubernetes \u043f\u043e \u043c\u0430\u043a\u0441\u0438\u043c\u0443\u043c\u0443 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 Go-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f\u043c\u0438<\/span>"},"content":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u041f\u0440\u0438\u0432\u0435\u0442! \u041c\u0435\u043d\u044f \u0437\u043e\u0432\u0443\u0442 \u0410\u043d\u0442\u043e\u043d \u0416\u0443\u043a\u043e\u0432, \u044f \u0440\u0443\u043a\u043e\u0432\u043e\u0436\u0443 \u0433\u0440\u0443\u043f\u043f\u043e\u0439 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0432 \u0421\u0431\u0435\u0440\u043c\u0430\u0440\u043a\u0435\u0442\u0435. \u0412 \u043f\u0440\u043e\u0444\u0435\u0441\u0441\u0438\u0438 \u044f \u0443\u0436\u0435 \u0431\u043e\u043b\u0435\u0435 12 \u043b\u0435\u0442, \u0441 Golang \u0440\u0430\u0431\u043e\u0442\u0430\u044e \u0441 2016 \u0433\u043e\u0434\u0430, \u0430 \u0441 Kubernetes \u2014 \u0441 2018 \u0433\u043e\u0434\u0430. <\/p>\n<p>\u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0443 \u043e\u0431 \u043e\u0441\u043d\u043e\u0432\u0430\u0445 Kubernetes, \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u0445 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430\u0445 \u0438 \u0440\u0435\u0448\u0435\u043d\u0438\u044f\u0445, \u0430 \u0442\u0430\u043a\u0436\u0435 \u043e\u00a0\u0442\u043e\u043c, \u043a\u0430\u043a <strong>\u0433\u0440\u0430\u043c\u043e\u0442\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0440\u0435\u0441\u0443\u0440\u0441\u044b \u044d\u0442\u043e\u0439 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u044b<\/strong>, \u0447\u0442\u043e\u0431\u044b \u0432\u044b\u0436\u0430\u0442\u044c \u043c\u0430\u043a\u0441\u0438\u043c\u0443\u043c \u0438\u0437 Go-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439. \u041a\u0440\u043e\u043c\u0435 \u0442\u043e\u0433\u043e, \u0432 \u043a\u043e\u043d\u0446\u0435 \u0441\u0442\u0430\u0442\u044c\u0438 \u044f \u043e\u043f\u0438\u0448\u0443 \u043a\u0435\u0439\u0441 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 GOMAXPROCS \u043d\u0430 \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u043d\u0430\u0448\u0435\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0438 \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0443, \u043a\u0430\u043a \u043d\u0430\u043c \u0443\u0434\u0430\u043b\u043e\u0441\u044c \u043f\u043e\u0432\u044b\u0441\u0438\u0442\u044c \u0435\u0433\u043e \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u043d\u0430 20-50%.<\/p>\n<p><a href=\"#issues\">\u041f\u0440\u043e\u0431\u043b\u0435\u043c\u044b \u0438 \u0432\u044b\u0437\u043e\u0432\u044b Kubernetes<\/a><\/p>\n<p><a href=\"#kuber\">\u041f\u043e\u0434 \u043a\u0430\u043f\u043e\u0442\u043e\u043c Kubernetes:<\/a><\/p>\n<ul>\n<li>\n<p><a href=\"#cfc\">CFS (Completely Fair Scheduler)<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"#go\">Goroutines<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"#cgroups\">Cgroups<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"#requests\">Requests &amp; Limits \u0432 Kubernetes<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"#CFS_Bandwidth_Control\">CFS Bandwidth Control<\/a><\/p>\n<\/li>\n<\/ul>\n<p><a href=\"#sbm\">\u041d\u0430\u0448 \u043e\u043f\u044b\u0442 Go-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439 \u0432 \u0431\u043e\u043b\u044c\u0448\u0438\u0445 Kubernetes-\u043a\u043b\u0430\u0441\u0442\u0435\u0440\u0430\u0445<\/a><\/p>\n<p><a href=\"#ex\">\u041f\u0440\u0438\u043c\u0435\u0440 \u0440\u0430\u0431\u043e\u0442\u044b \u0441 GOMAXPROCS \u0438\u0437 \u043e\u043f\u044b\u0442\u0430 \u0421\u0431\u0435\u0440\u041c\u0430\u0440\u043a\u0435\u0442\u0430<\/a><\/p>\n<p><a href=\"#rec\">\u0420\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0430\u0446\u0438\u0438 \u043f\u043e \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0438 \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0432 Kubernetes \u0434\u043b\u044f Go-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439<\/a><\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w780q1\/getpro\/habr\/upload_files\/828\/578\/284\/82857828457625fb7dfd7efe64171fc5.jpg\" width=\"1920\" height=\"1080\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/828\/578\/284\/82857828457625fb7dfd7efe64171fc5.jpg\" data-blurred=\"true\"\/><\/figure>\n<p><a class=\"anchor\" name=\"issues\" id=\"issues\"><\/a><\/p>\n<h2>\u0427\u0442\u043e \u043c\u044b \u0437\u043d\u0430\u0435\u043c \u043f\u0440\u043e Kubernetes?<\/h2>\n<p>Kubernetes \u2014 \u043e\u0442\u043b\u0438\u0447\u043d\u044b\u0439 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 <strong>\u0441\u043e\u0437\u0434\u0430\u0435\u0442 \u0430\u0431\u0441\u0442\u0440\u0430\u043a\u0446\u0438\u044e \u043d\u0430\u0434 \u0444\u0438\u0437\u0438\u0447\u0435\u0441\u043a\u0438\u043c\u0438 \u0438 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u043c\u0438 \u043c\u0430\u0448\u0438\u043d\u0430\u043c\u0438<\/strong>. \u041e\u043d \u043f\u043e\u043c\u043e\u0433\u0430\u0435\u0442 \u043d\u0430\u043c \u043d\u0435 \u0434\u0443\u043c\u0430\u0442\u044c \u043e \u0442\u043e\u043c, \u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0443 \u043d\u0430\u0441 \u0437\u0430\u043f\u0443\u0449\u0435\u043d\u043e \u043c\u0430\u0448\u0438\u043d \u0438 \u043a\u0430\u043a\u0438\u0435 \u0440\u0435\u0441\u0443\u0440\u0441\u044b \u043a\u0430\u043a\u043e\u0439 \u043c\u0430\u0448\u0438\u043d\u044b \u0437\u0430\u0434\u0435\u0439\u0441\u0442\u0432\u043e\u0432\u0430\u043d\u044b. \u0415\u0441\u0442\u044c \u043f\u0440\u043e\u0441\u0442\u043e \u0441\u043e\u0432\u043e\u043a\u0443\u043f\u043d\u0430\u044f \u043c\u043e\u0449\u043d\u043e\u0441\u0442\u044c, \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043f\u043e\u0434 \u043d\u0430\u0448\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435.\u00a0<\/p>\n<p>\u0412\u044b\u043a\u0430\u0442\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0431\u0443\u043a\u0432\u0430\u043b\u044c\u043d\u043e \u043e\u0434\u043d\u043e\u0439 \u043a\u043e\u043c\u0430\u043d\u0434\u043e\u0439 <code>kubectl apply<\/code>, \u0447\u0442\u043e \u043e\u0447\u0435\u043d\u044c \u0443\u0434\u043e\u0431\u043d\u043e. \u041f\u043b\u044e\u0441, \u043c\u043e\u0436\u043d\u043e \u043c\u0430\u0441\u0448\u0442\u0430\u0431\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043a\u0430\u043a \u0438\u043d\u0434\u0438\u0432\u0438\u0434\u0443\u0430\u043b\u044c\u043d\u043e\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u2014 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e HPA (Horizontal Pod Autoscaling), \u0442\u0430\u043a \u0438 \u0441\u0430\u043c \u043a\u043b\u0430\u0441\u0442\u0435\u0440, \u2014 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e CA (Cluster Autoscaling), \u0443\u0432\u0435\u043b\u0438\u0447\u0438\u0432\u0430\u044f \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043d\u043e\u0434 \u043f\u043e \u043c\u0435\u0440\u0435 \u043f\u043e\u0442\u0440\u0435\u0431\u043d\u043e\u0441\u0442\u0438.<\/p>\n<p>\u0417\u0432\u0443\u0447\u0438\u0442 \u0432\u0441\u0435 \u044d\u0442\u043e \u043e\u0447\u0435\u043d\u044c \u043a\u0440\u0443\u0442\u043e, \u043d\u043e \u0438\u043d\u043e\u0433\u0434\u0430 Kubernetes \u2014 \u044d\u0442\u043e \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b \u0441 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c\u044e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f:<\/p>\n<ul>\n<li>\n<p>CPU Throttling \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439;\u00a0<\/p>\n<\/li>\n<li>\n<p>\u0438\u043d\u043e\u0433\u0434\u0430 \u043f\u043e\u0434\u044b \u0432\u044b\u0441\u0435\u043b\u044f\u044e\u0442\u0441\u044f \u0441 \u043e\u0434\u043d\u043e\u0439 \u043d\u043e\u0434\u044b \u043d\u0430 \u0434\u0440\u0443\u0433\u0443\u044e;<\/p>\n<\/li>\n<li>\n<p>\u043f\u043e\u0440\u043e\u0439 \u043c\u044b \u0432\u0438\u0434\u0438\u043c \u0437\u0430\u0448\u043a\u0430\u043b\u0438\u0432\u0430\u044e\u0449\u0438\u0435 99 \u043f\u0435\u0440\u0441\u0435\u043d\u0442\u0438\u043b\u044c \u043f\u043e \u0434\u043b\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u043e\u0442\u0432\u0435\u0442\u0430 \u0438 \u0432\u0441\u043f\u043b\u0435\u0441\u043a\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u043c \u043d\u0435 \u043d\u0430\u0445\u043e\u0434\u0438\u043c \u043e\u0431\u044a\u044f\u0441\u043d\u0435\u043d\u0438\u044f.\u00a0<\/p>\n<\/li>\n<\/ul>\n<p>\u0410 \u0435\u0449\u0451 \u0441\u043b\u0443\u0447\u0430\u0435\u0442\u0441\u044f \u0440\u044f\u0434 \u043f\u0440\u043e\u0431\u043b\u0435\u043c \u0441 \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u043e\u043c:\u00a0<\/p>\n<ul>\n<li>\n<p>\u043d\u0435\u043f\u0440\u0435\u0434\u0441\u043a\u0430\u0437\u0443\u0435\u043c\u043e\u0435 \u043c\u0430\u0441\u0448\u0442\u0430\u0431\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u0430;<\/p>\n<\/li>\n<li>\n<p>\u0438\u043b\u0438, \u043d\u0430\u043e\u0431\u043e\u0440\u043e\u0442, \u0438\u0437 \u0436\u0438\u0432\u044b\u0445 \u043f\u0440\u0438\u043c\u0435\u0440\u043e\u0432, \u043a\u043e\u0433\u0434\u0430 \u043a\u043b\u0430\u0441\u0442\u0435\u0440 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 20-25% \u0438\u043c\u0435\u044e\u0449\u0438\u0445\u0441\u044f \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0432 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u0430 \u0438 \u043f\u0430\u043c\u044f\u0442\u0438 \u043d\u043e\u0434. \u0410 \u0437\u0430 \u043f\u0443\u0441\u0442\u0443\u044e\u0449\u0438\u0435 75-80% \u043c\u044b \u0432\u0441\u0435 \u0440\u0430\u0432\u043d\u043e \u043f\u043b\u0430\u0442\u0438\u043c.<\/p>\n<\/li>\n<\/ul>\n<p>\u0427\u0442\u043e \u0436\u0435 \u0441\u043e \u0432\u0441\u0435\u043c \u044d\u0442\u0438\u043c \u0434\u0435\u043b\u0430\u0442\u044c?<\/p>\n<p>\u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0440\u0430\u0437\u0431\u0435\u0440\u0435\u043c\u0441\u044f, \u043a\u0430\u043a Kubernetes \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442 \u0440\u0435\u0441\u0443\u0440\u0441\u0430\u043c\u0438 \u0447\u0435\u0440\u0435\u0437 Requests &amp; Limits, \u0438 \u043a\u0430\u043a \u0442\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u044b \u0432\u044b\u0441\u0442\u0430\u0432\u0438\u043c, \u0431\u0443\u0434\u0443\u0442 \u0432\u043b\u0438\u044f\u0442\u044c \u043d\u0430 \u0443\u0442\u0438\u043b\u0438\u0437\u0430\u0446\u0438\u044e \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0432. \u0410 \u0432 \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u0435 \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0443, \u043a\u0430\u043a \u043c\u044b \u0442\u044e\u043d\u0438\u043b\u0438 \u043d\u0430\u0448\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0432 \u0421\u0431\u0435\u0440\u043c\u0430\u0440\u043a\u0435\u0442\u0435 \u0438 \u0432 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u0443\u043b\u0443\u0447\u0448\u0438\u043b\u0438 99 percentile \u0434\u043b\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u043e\u0442\u0432\u0435\u0442\u0430 gRPC-\u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u043d\u0430 20%, CPU Usage \u043d\u0430 33% \u0438 \u0434\u043b\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c Go&#8217;s Garbage Collection \u043d\u0430 50%.<\/p>\n<p><a class=\"anchor\" name=\"kuber\" id=\"kuber\"><\/a><\/p>\n<h2>\u041f\u043e\u0433\u043e\u0432\u043e\u0440\u0438\u043c \u043f\u0440\u043e \u043e\u0441\u043d\u043e\u0432\u044b Kubernetes<\/h2>\n<p>\u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0443 \u043e\u0431 \u043e\u0441\u043d\u043e\u0432\u0430\u0445, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e Kubernetes \u2014 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u0430\u044f \u0441\u0438\u0441\u0442\u0435\u043c\u0430, \u0430 \u0432\u043d\u0443\u0442\u0440\u0438 \u044d\u0442\u043e\u0439 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u0435\u0441\u0442\u044c \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0435 \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u043e\u043c\u043e\u0433\u0430\u044e\u0442 \u043f\u043e\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u043a\u043b\u0430\u0441\u0442\u0435\u0440. \u0417\u043d\u0430\u043d\u0438\u0435 \u044d\u0442\u0438\u0445 \u043e\u0441\u043d\u043e\u0432 \u043f\u043e\u043c\u043e\u0436\u0435\u0442 \u043b\u0443\u0447\u0448\u0435 \u043f\u043e\u043d\u044f\u0442\u044c, \u0447\u0442\u043e \u0442\u0430\u043a\u043e\u0435 Requests \u0438 Limits \u0438 \u043a\u0430\u043a \u043e\u043d\u0438 \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u044e\u0442\u0441\u044f \u043d\u0430 \u0443\u0440\u043e\u0432\u043d\u0435 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u2014\u00a0 \u0432 \u043d\u0430\u0448\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043d\u0430 \u0443\u0440\u043e\u0432\u043d\u0435 Linux. \u041d\u0430\u0447\u043d\u0435\u043c \u0441 CFS.\u00a0<\/p>\n<p>\u0415\u0441\u043b\u0438 \u0432\u044b \u0445\u043e\u0440\u043e\u0448\u043e \u0437\u043d\u0430\u0435\u0442\u0435 \u0442\u0435\u043e\u0440\u0438\u044e \u0438 \u0445\u043e\u0442\u0438\u0442\u0435 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u043d\u0430 \u043d\u0430\u0448 \u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u043e\u043f\u044b\u0442, \u043c\u043e\u0436\u043d\u043e \u0441\u0440\u0430\u0437\u0443 <a href=\"#sbm\">\u043f\u0435\u0440\u0435\u0441\u043a\u043e\u0447\u0438\u0442\u044c \u043d\u0430 \u044d\u0442\u043e\u0442 \u0440\u0430\u0437\u0434\u0435\u043b<\/a>.<\/p>\n<p><a class=\"anchor\" name=\"cfc\" id=\"cfc\"><\/a><\/p>\n<h3>CFS (Completely Fair Scheduler)<\/h3>\n<p>\u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u0438\u043c \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u044e, \u0447\u0442\u043e \u0443 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440 \u0441 \u043e\u0434\u043d\u0438\u043c \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u043e\u043c, \u043a\u0430\u043a \u044d\u0442\u043e \u0431\u044b\u043b\u043e \u043a\u043e\u0433\u0434\u0430-\u0442\u043e \u0432 \u043f\u0440\u043e\u0448\u043b\u043e\u043c. \u0418 \u044d\u0442\u043e\u0442 \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440 \u0438\u0441\u043f\u043e\u043b\u043d\u044f\u0435\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0434\u043d\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0432 \u043e\u0434\u0438\u043d \u043c\u043e\u043c\u0435\u043d\u0442 \u0432\u0440\u0435\u043c\u0435\u043d\u0438. \u0414\u043e\u043f\u0443\u0441\u0442\u0438\u043c, \u0432\u044b \u043e\u0442\u043a\u0440\u044b\u0432\u0430\u0435\u0442\u0435 \u0447\u0430\u0442\u0438\u043a, \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u0442\u0435 \u0447\u0442\u043e-\u0442\u043e \u043f\u0438\u0441\u0430\u0442\u044c \u0438 \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u043e\u0441\u043b\u0435 \u0442\u043e\u0433\u043e, \u043a\u0430\u043a \u0432\u044b \u043d\u0430\u043f\u0438\u0441\u0430\u043b\u0438, \u0443 \u0432\u0430\u0441 \u0437\u0430\u0433\u0440\u0443\u0436\u0430\u0435\u0442\u0441\u044f \u043f\u0435\u0440\u0435\u043f\u0438\u0441\u043a\u0430 \u0441 \u0434\u0440\u0443\u0433\u043e\u043c. \u0418\u043b\u0438, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0447\u0430\u0441\u044b \u0442\u0438\u043a\u0430\u044e\u0442 \u0438 \u0437\u0430\u043d\u0438\u043c\u0430\u044e\u0442 \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u0432\u0441\u0435 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u043d\u043e\u0435 \u0432\u0440\u0435\u043c\u044f. <\/p>\n<p>\u041f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0442\u0430\u043a\u043e\u0435, \u043a\u043e\u043d\u0435\u0447\u043d\u043e, \u043e\u0447\u0435\u043d\u044c \u0441\u043b\u043e\u0436\u043d\u043e. \u0421\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u044b \u2014 \u044d\u0442\u043e \u0432\u0441\u0435\u0433\u0434\u0430 \u043c\u043d\u043e\u0433\u043e\u0437\u0430\u0434\u0430\u0447\u043d\u043e\u0441\u0442\u044c, \u043c\u043d\u043e\u0433\u043e\u043f\u043e\u0442\u043e\u0447\u043d\u043e\u0441\u0442\u044c. \u0418 <strong>CFS (Completely Fair Scheduler)<\/strong> \u2014 \u044d\u0442\u043e \u043a\u0430\u043a \u0440\u0430\u0437 \u0442\u043e\u0442 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u0435\u0442 \u043c\u043d\u043e\u0433\u043e\u0437\u0430\u0434\u0430\u0447\u043d\u043e\u0441\u0442\u044c \u0432 \u0440\u0430\u043c\u043a\u0430\u0445 \u043e\u0434\u043d\u043e\u0433\u043e \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u0430, (\u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u043e\u0434\u0438\u043d \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440 \u0432\u0441\u0435\u0433\u0434\u0430 \u043c\u043e\u0436\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u043d\u044f\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0434\u043d\u0443 \u0437\u0430\u0434\u0430\u0447\u0443 \u0432 \u043e\u0434\u0438\u043d \u043c\u043e\u043c\u0435\u043d\u0442 \u0432\u0440\u0435\u043c\u0435\u043d\u0438).<\/p>\n<p>CFS \u0438\u0434\u0435\u0430\u043b\u044c\u043d\u043e \u0442\u043e\u0447\u043d\u043e \u043c\u043e\u0434\u0435\u043b\u0438\u0440\u0443\u0435\u0442 \u043c\u043d\u043e\u0433\u043e\u0437\u0430\u0434\u0430\u0447\u043d\u043e\u0441\u0442\u044c \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u0430. \u041e\u043d \u043c\u043e\u0436\u0435\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c \u0432\u0441\u0435 \u0437\u0430\u0434\u0430\u0447\u0438 \u0441 \u0440\u0430\u0432\u043d\u043e\u0439 \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u044c\u044e.\u00a0<\/p>\n<p>\u041d\u0438\u0436\u0435 \u043d\u0430 \u0441\u0445\u0435\u043c\u0435 \u2014 \u0448\u043a\u0430\u043b\u0430 \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0438 \u0434\u0432\u0430 \u043f\u0440\u0438\u043c\u0435\u0440\u0430 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u0437\u0430\u0434\u0430\u0447. \u041f\u0435\u0440\u0432\u044b\u0439 \u043f\u0440\u0438\u043c\u0435\u0440 \u2014 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u0434\u0432\u0443\u0445 \u0437\u0430\u0434\u0430\u0447, \u0432\u0442\u043e\u0440\u043e\u0439 \u2014 \u0447\u0435\u0442\u044b\u0440\u0435\u0445. \u041c\u044b \u0432\u0438\u0434\u0438\u043c, \u0447\u0442\u043e \u0432 \u043e\u0431\u043e\u0438\u0445 \u0441\u043b\u0443\u0447\u0430\u044f\u0445 \u0432\u044b\u0434\u0435\u043b\u0435\u043d \u0440\u0430\u0432\u043d\u044b\u0439 \u043e\u0442\u0440\u0435\u0437\u043e\u043a \u043f\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438, \u0438 \u0437\u0430\u0434\u0430\u0447\u0438 \u0440\u0430\u0432\u043d\u043e\u043c\u0435\u0440\u043d\u043e \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u044b \u043f\u043e \u0448\u043a\u0430\u043b\u0435 \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0438 \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0442 \u043e\u0434\u043d\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e. \u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u043e\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043c\u043d\u043e\u0433\u043e\u0437\u0430\u0434\u0430\u0447\u043d\u043e\u0441\u0442\u044c, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0433\u043b\u0430\u0437\u0443 \u043d\u0435 \u0432\u0438\u0434\u043d\u0430, \u043d\u043e \u0435\u0441\u0442\u044c \u043d\u0430 \u0443\u0440\u043e\u0432\u043d\u0435 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u0430 \u0437\u0430 \u0441\u0447\u0435\u0442 \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c\u0430 CFS.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/669\/7ad\/d57\/6697add5787256c2be618599fa9702b1.png\" alt=\"CFS \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u0435\u0442 \u043e\u0434\u043d\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e \u043c\u043d\u043e\u0433\u043e\u0437\u0430\u0434\u0430\u0447\u043d\u043e\u0441\u0442\u044c \u0432 \u0440\u0430\u043c\u043a\u0430\u0445 \u043e\u0434\u043d\u043e\u0433\u043e \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u0430\" title=\"CFS \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u0435\u0442 \u043e\u0434\u043d\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e \u043c\u043d\u043e\u0433\u043e\u0437\u0430\u0434\u0430\u0447\u043d\u043e\u0441\u0442\u044c \u0432 \u0440\u0430\u043c\u043a\u0430\u0445 \u043e\u0434\u043d\u043e\u0433\u043e \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u0430\" width=\"1984\" height=\"524\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/669\/7ad\/d57\/6697add5787256c2be618599fa9702b1.png\"\/><\/p>\n<div><figcaption><em>CFS \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u0435\u0442 \u043e\u0434\u043d\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e \u043c\u043d\u043e\u0433\u043e\u0437\u0430\u0434\u0430\u0447\u043d\u043e\u0441\u0442\u044c \u0432 \u0440\u0430\u043c\u043a\u0430\u0445 \u043e\u0434\u043d\u043e\u0433\u043e \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u0430<\/em><\/figcaption><\/div>\n<\/figure>\n<p>\u0427\u0442\u043e\u0431\u044b \u043e\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043b\u044f\u0442\u044c \u043c\u043d\u043e\u0433\u043e\u0437\u0430\u0434\u0430\u0447\u043d\u043e\u0441\u0442\u044c, CFS \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u0431\u0438\u043d\u0430\u0440\u043d\u043e\u0435 \u0434\u0435\u0440\u0435\u0432\u043e, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0443\u043f\u043e\u0440\u044f\u0434\u043e\u0447\u0435\u043d\u043e \u043f\u043e virtual runtime. <strong>Virtual runtime<\/strong> \u2014 \u044d\u0442\u043e \u0432\u0440\u0435\u043c\u044f, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0443\u0436\u0435 \u0431\u044b\u043b\u043e \u0437\u0430\u0442\u0440\u0430\u0447\u0435\u043d\u043e \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u043e\u043c \u043d\u0430 \u0438\u0441\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u0434\u0430\u043d\u043d\u043e\u0439 \u0437\u0430\u0434\u0430\u0447\u0438. \u041d\u0430 \u0441\u0445\u0435\u043c\u0435 \u043d\u0438\u0436\u0435 \u0432 \u043b\u0435\u0432\u043e\u0439 \u0447\u0430\u0441\u0442\u0438 \u0434\u0435\u0440\u0435\u0432\u0430 \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0430 \u0437\u0430\u0434\u0430\u0447\u0430 \u0441 \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u043c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e\u043c virtual runtime, \u0432 \u043f\u0440\u0430\u0432\u043e\u0439 \u2014 \u0441 \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u043c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e\u043c virtual runtime. <\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/96e\/5d3\/57d\/96e5d357db3c838d1e8603a104292861.png\" alt=\"\u041a\u0430\u043a \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u0430 \u043c\u043d\u043e\u0433\u043e\u0437\u0430\u0434\u0430\u0447\u043d\u043e\u0441\u0442\u044c \u0432 CFS\" title=\"\u041a\u0430\u043a \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u0430 \u043c\u043d\u043e\u0433\u043e\u0437\u0430\u0434\u0430\u0447\u043d\u043e\u0441\u0442\u044c \u0432 CFS\" width=\"1940\" height=\"1128\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/96e\/5d3\/57d\/96e5d357db3c838d1e8603a104292861.png\"\/><\/p>\n<div><figcaption><em>\u041a\u0430\u043a \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u0430 \u043c\u043d\u043e\u0433\u043e\u0437\u0430\u0434\u0430\u0447\u043d\u043e\u0441\u0442\u044c \u0432 CFS<\/em><\/figcaption><\/div>\n<\/figure>\n<p>CFS \u0431\u0435\u0440\u0435\u0442 \u0437\u0430\u0434\u0430\u0447\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0431\u044b\u043b\u0438 \u0438\u0441\u043f\u043e\u043b\u043d\u0435\u043d\u044b \u043d\u0430 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u0435\u00a0 \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438, \u0432\u044b\u0442\u0430\u0441\u043a\u0438\u0432\u0430\u0435\u0442 \u0438\u0445 \u0438\u0437 \u043b\u0435\u0432\u043e\u0439 \u0447\u0430\u0441\u0442\u0438 \u0434\u0435\u0440\u0435\u0432\u0430, \u0438\u0441\u043f\u043e\u043b\u043d\u044f\u0435\u0442 \u043d\u0430 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u0435 \u0438 \u043f\u043e\u0442\u043e\u043c \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0432 \u043f\u0440\u0430\u0432\u0443\u044e \u0447\u0430\u0441\u0442\u044c \u0434\u0435\u0440\u0435\u0432\u0430. \u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0434\u0432\u0438\u0436\u0435\u043d\u0438\u0435 \u0437\u0430\u0434\u0430\u0447 \u043f\u043e \u0434\u0435\u0440\u0435\u0432\u0443 \u0438 \u0440\u0430\u0432\u043d\u043e\u043c\u0435\u0440\u043d\u043e\u0435 \u043f\u043e \u0434\u043b\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u0438\u0441\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u043a\u0430\u0436\u0434\u043e\u0439 \u0437\u0430\u0434\u0430\u0447\u0438.<\/p>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043f\u043e\u043f\u0440\u043e\u0431\u0443\u0435\u043c \u043d\u0430\u0440\u0438\u0441\u043e\u0432\u0430\u0442\u044c \u043e\u0431\u0449\u0443\u044e \u043a\u0430\u0440\u0442\u0438\u043d\u0443, \u043a\u0430\u043a CFS \u0438\u0441\u043f\u043e\u043b\u043d\u044f\u0435\u0442 \u043d\u0430\u0448\u0438 \u0437\u0430\u0434\u0430\u0447\u0438 \u0432 \u0440\u0430\u043c\u043a\u0430\u0445 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043d\u0430 Go. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043d\u0430\u043f\u043e\u043c\u043d\u044e, \u043a\u0430\u043a \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0442 Goroutines.<\/p>\n<p><a class=\"anchor\" name=\"go\" id=\"go\"><\/a><\/p>\n<h2>Goroutines<\/h2>\n<p>\u041a\u0430\u0436\u0434\u044b\u0439 \u0440\u0430\u0437, \u043a\u043e\u0433\u0434\u0430 \u0432\u044b \u043f\u0438\u0448\u0435\u0442\u0435 <code>go fun\u0441()<\/code> \u0441 \u0432\u0430\u0448\u0438\u043c \u043a\u043e\u0434\u043e\u043c \u0432\u043d\u0443\u0442\u0440\u0438, \u0432\u0430\u0448\u0430 Goroutine \u043f\u043e\u043f\u0430\u0434\u0430\u0435\u0442 \u0432 \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u0443\u044e \u043e\u0447\u0435\u0440\u0435\u0434\u044c. \u041a\u0430\u043a \u043c\u044b \u0437\u043d\u0430\u0435\u043c, \u0432 Go \u0435\u0441\u0442\u044c \u043f\u043b\u0430\u043d\u0438\u0440\u043e\u0432\u0449\u0438\u043a (Go scheduler), \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0437\u0430\u043d\u0438\u043c\u0430\u0435\u0442\u0441\u044f \u0442\u0435\u043c, \u0447\u0442\u043e \u0440\u0430\u0441\u0442\u0430\u0441\u043a\u0438\u0432\u0430\u0435\u0442 \u0432\u0430\u0448\u0438 Goroutines \u0438\u0437 \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u043e\u0439 \u043e\u0447\u0435\u0440\u0435\u0434\u0438 \u0432 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u044b\u0435 \u043e\u0447\u0435\u0440\u0435\u0434\u0438 \u043f\u043e \u043a\u0430\u0436\u0434\u043e\u043c\u0443 \u0442\u0440\u0435\u0434\u0443 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u044b.\u00a0<\/p>\n<p>\u041d\u0430 \u0441\u0445\u0435\u043c\u0435 \u043d\u0438\u0436\u0435 \u2014 \u043f\u0440\u0438\u043c\u0435\u0440 \u0441 \u0434\u0432\u0443\u043c\u044f \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u0430\u043c\u0438, \u043d\u0430 \u043a\u0430\u0436\u0434\u043e\u043c \u0438\u0437 \u043d\u0438\u0445 \u0435\u0441\u0442\u044c \u0434\u0432\u0430 \u0430\u043a\u0442\u0438\u0432\u043d\u044b\u0445 \u0442\u0440\u0435\u0434\u0430. \u0422\u0430\u043a\u0436\u0435 \u0432\u0438\u0434\u0438\u043c, \u0447\u0442\u043e \u0435\u0441\u0442\u044c \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u044b\u0435 \u043e\u0447\u0435\u0440\u0435\u0434\u0438. \u0417\u0430\u0434\u0430\u0447\u0430 \u043f\u043b\u0430\u043d\u0438\u0440\u043e\u0432\u0449\u0438\u043a\u0430 \u2014 \u0440\u0430\u0432\u043d\u043e\u043c\u0435\u0440\u043d\u043e \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0442\u044c Goroutines \u043c\u0435\u0436\u0434\u0443 \u044d\u0442\u0438\u043c\u0438 \u0430\u043a\u0442\u0438\u0432\u043d\u044b\u043c\u0438 \u0442\u0440\u0435\u0434\u0430\u043c\u0438. \u0421\u0435\u0440\u044b\u0435 \u00ab\u041c\u00bb \u2014 \u044d\u0442\u043e \u0437\u0430\u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u0442\u0440\u0435\u0434\u044b \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0430 \u0434\u0430\u043d\u043d\u044b\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 \u0430\u043a\u0442\u0438\u0432\u043d\u043e \u043d\u0435 \u0443\u0447\u0430\u0441\u0442\u0432\u0443\u044e\u0442 \u0432 \u0440\u0430\u0431\u043e\u0442\u0435 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u0430.\u00a0<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w780q1\/getpro\/habr\/upload_files\/295\/770\/f18\/295770f1817171b285189ff34ea44959.jpg\" alt=\"\u041f\u043b\u0430\u043d\u0438\u0440\u043e\u0432\u0449\u0438\u043a Go scheduler\" title=\"\u041f\u043b\u0430\u043d\u0438\u0440\u043e\u0432\u0449\u0438\u043a Go scheduler\" width=\"990\" height=\"542\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/295\/770\/f18\/295770f1817171b285189ff34ea44959.jpg\" data-blurred=\"true\"\/><\/p>\n<div><figcaption><em>\u041f\u043b\u0430\u043d\u0438\u0440\u043e\u0432\u0449\u0438\u043a Go scheduler<\/em><\/figcaption><\/div>\n<\/figure>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c, \u043a\u0430\u043a \u0432\u0441\u0435 \u044d\u0442\u043e \u0441\u0432\u044f\u0437\u0430\u043d\u043e. \u041d\u0430 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439 \u0441\u0445\u0435\u043c\u0435<em> <\/em>\u043f\u043e\u043a\u0430\u0437\u0430\u043d \u0443\u0440\u043e\u0432\u0435\u043d\u044c \u0430\u0431\u0441\u0442\u0440\u0430\u043a\u0446\u0438\u0438 \u0441\u0432\u0435\u0440\u0445\u0443 \u0432\u043d\u0438\u0437. \u0423 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c Goroutines, \u0435\u0441\u0442\u044c \u043f\u043b\u0430\u043d\u0438\u0440\u043e\u0432\u0449\u0438\u043a. \u041f\u043b\u0430\u043d\u0438\u0440\u043e\u0432\u0449\u0438\u043a \u043f\u0440\u0438\u0437\u0435\u043c\u043b\u044f\u0435\u0442 \u043d\u0430\u0448\u0438 Goroutines \u043d\u0430 \u043f\u043e\u0442\u043e\u043a\u0438. CFS, \u0432 \u0441\u0432\u043e\u044e \u043e\u0447\u0435\u0440\u0435\u0434\u044c, \u043f\u0440\u0438\u0437\u0435\u043c\u043b\u044f\u0435\u0442 \u0442\u0440\u0435\u0434\u044b \u043d\u0430 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u044b. \u0412\u043e\u0442, \u043a\u0430\u043a \u0432 \u043a\u043e\u043d\u0435\u0447\u043d\u043e\u043c \u0438\u0442\u043e\u0433\u0435 Goroutines \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u043e\u043c. <\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/f0c\/9ea\/cd4\/f0c9eacd47f514a89490ded8a3203698.png\" alt=\"\u0418\u0441\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 Goroutines\" title=\"\u0418\u0441\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 Goroutines\" width=\"1426\" height=\"1160\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/f0c\/9ea\/cd4\/f0c9eacd47f514a89490ded8a3203698.png\"\/><\/p>\n<div><figcaption><em>\u0418\u0441\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 Goroutines<\/em><\/figcaption><\/div>\n<\/figure>\n<p>\u0410 \u0447\u0442\u043e \u0435\u0441\u043b\u0438 \u043c\u044b \u043d\u0435 \u0445\u043e\u0442\u0438\u043c, \u0447\u0442\u043e\u0431\u044b \u0432\u0441\u0435 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u044b \u0432 \u043d\u0430\u0448\u0435\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u0435 \u0438\u043c\u0435\u043b\u0438 \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u044b\u0439 \u043f\u0440\u0438\u043e\u0440\u0438\u0442\u0435\u0442? \u0414\u043b\u044f \u0442\u0430\u043a\u0438\u0445 \u0441\u043b\u0443\u0447\u0430\u0435\u0432 \u0431\u044b\u043b \u043f\u0440\u0438\u0434\u0443\u043c\u0430\u043d \u043f\u0440\u0435\u043a\u0440\u0430\u0441\u043d\u044b\u0439 \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c \u043f\u043e\u0434 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435\u043c Cgroups.<\/p>\n<p><a class=\"anchor\" name=\"cgroups\" id=\"cgroups\"><\/a><\/p>\n<h2>Cgroups<\/h2>\n<p>Cgroups \u2014 \u044d\u0442\u043e \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c \u0434\u043b\u044f \u043e\u0440\u0433\u0430\u043d\u0438\u0437\u0430\u0446\u0438\u0438 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0432 \u0432 \u0438\u0435\u0440\u0430\u0440\u0445\u0438\u044e \u0438 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u0438\u0440\u0443\u0435\u043c\u043e\u0433\u043e \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0432 \u043f\u043e \u044d\u0442\u043e\u0439 \u0438\u0435\u0440\u0430\u0440\u0445\u0438\u0438 \u0432 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u0438 \u0441 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0435\u0439. \u042d\u0442\u0430 \u0438\u0435\u0440\u0430\u0440\u0445\u0438\u044f \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0438\u0437 \u0441\u0435\u0431\u044f \u0434\u0435\u0440\u0435\u0432\u043e. \u0412 \u043d\u0451\u043c \u0432 \u043a\u0430\u0436\u0434\u043e\u0439 \u0433\u0440\u0443\u043f\u043f\u0435 \u0432\u044b\u0434\u0435\u043b\u044f\u0435\u0442\u0441\u044f \u043a\u0430\u043a\u043e\u0435-\u0442\u043e \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u043c\u0438 \u044d\u0442\u0430 \u0433\u0440\u0443\u043f\u043f\u0430 \u043c\u043e\u0436\u0435\u0442 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f. <\/p>\n<p>\u041c\u0435\u0445\u0430\u043d\u0438\u0437\u043c \u0421groups \u2014 \u044d\u0442\u043e \u043e\u0441\u043d\u043e\u0432\u0430 \u0434\u043b\u044f \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0438\u0437\u0430\u0446\u0438\u0438 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439 (docker, containerd \u0438 \u0442.\u0434.). \u0427\u0430\u0449\u0435 \u0432\u0441\u0435\u0433\u043e \u0432\u0441\u0435 \u043d\u0430\u0448\u0438 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u044b \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u044b \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 Cgroups. \u041f\u0430\u043c\u044f\u0442\u044c, \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440, \u0441\u0435\u0442\u044c \u0438 \u0434\u0438\u0441\u043a \u2014 \u044d\u0442\u043e \u043a\u0430\u043a \u0440\u0430\u0437 \u0442\u0435 \u0440\u0435\u0441\u0443\u0440\u0441\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0442\u044c \u043c\u0435\u0436\u0434\u0443 \u0433\u0440\u0443\u043f\u043f\u0430\u043c\u0438 \u0438 \u0447\u0435\u0442\u043a\u043e \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0432 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u043c\u0438 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430\u043c\u0438.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/bda\/a3c\/e98\/bdaa3ce98049d4aae454c4fe056fae0a.png\" alt=\"Control Groups (\u0421groups)\" title=\"Control Groups (\u0421groups)\" width=\"1764\" height=\"754\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/bda\/a3c\/e98\/bdaa3ce98049d4aae454c4fe056fae0a.png\"\/><\/p>\n<div><figcaption><em>Control Groups (\u0421groups)<\/em><\/figcaption><\/div>\n<\/figure>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c, \u043e\u0437\u043d\u0430\u043a\u043e\u043c\u0438\u0432\u0448\u0438\u0441\u044c \u0441 \u043e\u0441\u043d\u043e\u0432\u043e\u0439, \u043f\u0435\u0440\u0435\u0439\u0434\u0435\u043c \u043a \u0431\u043e\u043b\u0435\u0435 \u0434\u0435\u0442\u0430\u043b\u044c\u043d\u043e\u043c\u0443 \u0440\u0430\u0437\u0431\u043e\u0440\u0443 Kubernetes, \u0432 \u0447\u0430\u0441\u0442\u043d\u043e\u0441\u0442\u0438, Requests &amp; Limits.<\/p>\n<p><a class=\"anchor\" name=\"requests\" id=\"requests\"><\/a><\/p>\n<h2>Requests &amp; Limits \u0432 Kubernetes<\/h2>\n<p>\u0418\u0442\u0430\u043a, \u0442\u0435\u043f\u0435\u0440\u044c \u0431\u043e\u043b\u0435\u0435 \u0434\u0435\u0442\u0430\u043b\u044c\u043d\u043e \u0440\u0430\u0437\u0431\u0435\u0440\u0435\u043c \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u043c\u0438 \u043c\u044b \u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u0441\u044f \u043a\u0430\u0436\u0434\u044b\u0439 \u0434\u0435\u043d\u044c.\u00a0<\/p>\n<h3>\u041a\u0430\u043a \u043f\u043e\u0434 \u0441\u043e\u0437\u0434\u0430\u0435\u0442\u0441\u044f \u0432 \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u0435<\/h3>\n<p>\u0423 \u043a\u0430\u0436\u0434\u043e\u0439 \u043d\u043e\u0434\u044b \u0432 \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u0435 \u0435\u0441\u0442\u044c Capacity \u043f\u043e \u043a\u0430\u0436\u0434\u043e\u043c\u0443 \u0442\u0438\u043f\u0443 \u0440\u0435\u0441\u0443\u0440\u0441\u0430 \u2014 CPU, \u043f\u0430\u043c\u044f\u0442\u044c. \u041f\u043b\u0430\u043d\u0438\u0440\u043e\u0432\u0449\u0438\u043a \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442 \u043f\u043e\u0434 \u043d\u0430 \u043d\u043e\u0434\u0435 \u0438 \u0432\u044b\u0447\u0438\u0442\u0430\u0435\u0442 Requests \u044d\u0442\u043e\u0433\u043e \u043f\u043e\u0434\u0430 \u0438\u0437 \u043e\u0431\u0449\u0435\u0439 Capacity \u043d\u043e\u0434\u044b. \u0423 \u043d\u043e\u0434\u044b \u0432\u0441\u0435\u0433\u0434\u0430 \u0435\u0441\u0442\u044c \u043a\u0430\u043a\u0430\u044f-\u0442\u043e \u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u0430\u044f Capacity.\u00a0<\/p>\n<p>\u0412\u0430\u0436\u043d\u043e \u043f\u043e\u043d\u0438\u043c\u0430\u0442\u044c, \u0447\u0442\u043e \u043f\u043b\u0430\u043d\u0438\u0440\u043e\u0432\u0449\u0438\u043a \u043d\u0435 \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0437\u043c\u0435\u0449\u0430\u0442\u044c \u043f\u043e\u0434 \u0441 Requests, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u0440\u0435\u0432\u044b\u0448\u0430\u044e\u0442 \u044d\u0442\u043e\u0442 \u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u044b\u0439 Capacity \u043d\u0430 \u043d\u043e\u0434\u0435. \u0421\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e, \u0435\u0441\u043b\u0438 Capacity \u043d\u0430 \u043e\u0434\u043d\u043e\u0439 \u043d\u043e\u0434\u0435 \u043d\u0435 \u0445\u0432\u0430\u0442\u0430\u0435\u0442, \u0437\u043d\u0430\u0447\u0438\u0442 \u043f\u043b\u0430\u043d\u0438\u0440\u043e\u0432\u0449\u0438\u043a \u043f\u043e\u0439\u0434\u0435\u0442 \u043d\u0430 \u0434\u0440\u0443\u0433\u0443\u044e \u043d\u043e\u0434\u0443. \u0415\u0441\u043b\u0438 \u0441\u0432\u043e\u0431\u043e\u0434\u043d\u044b\u0445 \u043d\u043e\u0434 \u043d\u0435 \u043d\u0430\u0439\u0434\u0435\u043d\u043e, \u0442\u043e\u0433\u0434\u0430 \u043f\u043b\u0430\u043d\u0438\u0440\u043e\u0432\u0449\u0438\u043a \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c\u0430 Cluster autoscaling \u0441\u043e\u0437\u0434\u0430\u0441\u0442 \u043d\u043e\u0432\u0443\u044e \u043d\u043e\u0434\u0443 \u0438 \u0442\u0430\u043c \u0440\u0430\u0437\u043c\u0435\u0441\u0442\u0438\u0442 \u043f\u043e\u0434.<\/p>\n<h3>CPU Requests<\/h3>\n<p>Requests &amp; Limits \u0438\u0437\u043c\u0435\u0440\u044f\u044e\u0442\u0441\u044f \u0432 CPU units \u0438\u043b\u0438 \u0432 millocores. 1 CPU = 1000 millocores. \u0422\u0430\u043a\u0430\u044f \u0430\u0431\u0441\u0442\u0440\u0430\u043a\u0446\u0438\u044f \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f \u0432 \u043b\u044e\u0431\u043e\u043c \u043e\u0431\u043b\u0430\u043a\u0435:<\/p>\n<ul>\n<li>\n<p>1 AWS vCPU;<\/p>\n<\/li>\n<li>\n<p>1 GCP Core;<\/p>\n<\/li>\n<li>\n<p>1 Azure vCore;<\/p>\n<\/li>\n<li>\n<p>1 Hyperthread on a bare-metal Intel processor with Hyperthreading.<\/p>\n<\/li>\n<\/ul>\n<p>CPU Requests \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u044e\u0442\u0441\u044f \u0434\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u043f\u0440\u0438\u043e\u0440\u0438\u0442\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u043d\u043e\u0435 \u0432\u0440\u0435\u043c\u044f \u043f\u0440\u0438 \u0441\u0442\u043e\u043f\u0440\u043e\u0446\u0435\u043d\u0442\u043d\u043e\u0439 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0435 \u043d\u043e\u0440\u043c\u044b. \u041f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u0438\u043c \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u044e, \u0447\u0442\u043e \u043d\u043e\u0434\u0430 \u0437\u0430\u0433\u0440\u0443\u0436\u0435\u043d\u0430 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u043e\u043c \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e, \u043d\u0430 \u0441\u0442\u043e \u043f\u0440\u043e\u0446\u0435\u043d\u0442\u043e\u0432, \u0438 \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u043f\u043e\u043d\u0438\u043c\u0430\u0442\u044c, \u043a\u0430\u043a\u043e\u043c\u0443 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0443 \u0432\u044b\u0434\u0435\u043b\u0438\u0442\u044c \u0431\u043e\u043b\u044c\u0448\u0435\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0432, \u0430 \u043a\u0430\u043a\u043e\u043c\u0443 \u2014 \u043c\u0435\u043d\u044c\u0448\u0435\u0435. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0435\u0441\u0442\u044c \u0442\u0435\u0445\u043d\u043e\u043b\u043e\u0433\u0438\u044f, \u0442\u043e\u0436\u0435 \u0438\u0437 Cgroups, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f CPU Shares.<\/p>\n<h3>CPU Shares<\/h3>\n<p>CPU Shares \u2014 \u044d\u0442\u043e \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c \u043f\u0440\u0438\u043e\u0440\u0438\u0442\u0435\u0437\u0430\u0446\u0438\u0438 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u043d\u043e\u0433\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0432 Cgroups. \u041a\u043e\u0433\u0434\u0430 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440 \u0437\u0430\u0433\u0440\u0443\u0436\u0435\u043d \u043d\u0430 100%, Cgroups \u043f\u043e\u043d\u0438\u043c\u0430\u0435\u0442, \u043a\u0430\u043a \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0445 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430\u043c \u0432\u0435\u0441\u043e\u0432 \u043e\u043d \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0442\u044c \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u043d\u043e\u0435 \u0432\u0440\u0435\u043c\u044f. \u042d\u0442\u043e \u0437\u043d\u0430\u0447\u0438\u0442, \u0447\u0442\u043e \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e CPU Requests \u043c\u043e\u0436\u043d\u043e \u0432\u044b\u0434\u0430\u0432\u0430\u0442\u044c \u043a\u0430\u043a\u0438\u043c-\u0442\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f\u043c \u0431\u043e\u043b\u044c\u0448\u0438\u0439 \u043f\u0440\u0438\u043e\u0440\u0438\u0442\u0435\u0442, \u0430 \u043a\u0430\u043a\u0438\u043c-\u0442\u043e \u2014 \u043c\u0435\u043d\u044c\u0448\u0438\u0439. \u041f\u0440\u0438 \u0441\u0442\u043e\u043f\u0440\u043e\u0446\u0435\u043d\u0442\u043d\u043e\u0439 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0435 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u0430 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u043d\u044f\u0442\u044c, \u043a\u043e\u043c\u0443 \u0432\u044b\u0434\u0435\u043b\u044f\u044e\u0442\u0441\u044f \u043a\u0430\u043a\u0438\u0435 \u043f\u0440\u043e\u043f\u043e\u0440\u0446\u0438\u0438 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u043d\u043e\u0433\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438. <\/p>\n<h3>Requests \u0438 \u0440\u0435\u0441\u0443\u0440\u0441\u044b \u043d\u043e\u0434\u044b<\/h3>\n<p>\u041a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0443 \u0433\u0430\u0440\u0430\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u044b \u0440\u0435\u0441\u0443\u0440\u0441\u044b, \u0437\u0430\u043f\u0440\u043e\u0448\u0435\u043d\u043d\u044b\u0435 \u0432 Requests. \u041d\u043e\u0434\u0430 \u043e\u0431\u0435\u0449\u0430\u0435\u0442 \u0432\u0430\u043c, \u0447\u0442\u043e \u0443 \u043d\u0435\u0435 \u0432\u0441\u0435\u0433\u0434\u0430 \u0431\u0443\u0434\u0443\u0442 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b \u0442\u0435 \u0440\u0435\u0441\u0443\u0440\u0441\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0432\u044b \u0437\u0430\u043f\u0440\u043e\u0441\u0438\u043b\u0438 \u0438\u0437\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e. \u0412 \u0442\u043e \u0436\u0435 \u0432\u0440\u0435\u043c\u044f, \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440 \u043c\u043e\u0436\u0435\u0442 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0438\u043b\u0438 \u043d\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0440\u0435\u0441\u0443\u0440\u0441\u044b \u0441\u0432\u0435\u0440\u0445 \u0437\u0430\u043f\u0440\u043e\u0448\u0435\u043d\u043d\u043e\u0433\u043e. \u0418 \u043f\u0440\u0438 \u0441\u0442\u043e\u043f\u0440\u043e\u0446\u0435\u043d\u0442\u043d\u043e\u0439 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0435 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u043d\u043e\u0435 \u0432\u0440\u0435\u043c\u044f \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0442\u044c\u0441\u044f \u043f\u0440\u043e\u043f\u043e\u0440\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u043e Requests.<\/p>\n<p><strong>\u0427\u0442\u043e, \u0435\u0441\u043b\u0438 \u043c\u044b \u0443\u043a\u0430\u0437\u0430\u043b\u0438 Requests, \u0430 \u0440\u0435\u0430\u043b\u044c\u043d\u043e\u0435 \u043f\u043e\u0442\u0440\u0435\u0431\u043b\u0435\u043d\u0438\u0435 \u043d\u0438\u0436\u0435 \u0432\u044b\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u043d\u044b\u0445 Requests?<\/strong> <\/p>\n<p>\u042d\u0442\u043e \u0437\u043d\u0430\u0447\u0438\u0442, \u0447\u0442\u043e CPU \u0438 \u043f\u0430\u043c\u044f\u0442\u044c \u043d\u0430 \u043d\u043e\u0434\u0435 \u043d\u0435 \u0431\u0443\u0434\u0443\u0442 \u0437\u0430\u043d\u044f\u0442\u044b \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u043e. \u0420\u0435\u0430\u043b\u044c\u043d\u043e\u0435 \u043f\u043e\u0442\u0440\u0435\u0431\u043b\u0435\u043d\u0438\u0435 \u043c\u0435\u043d\u044c\u0448\u0435, \u0430 \u043f\u043b\u0430\u0442\u0438\u043c \u043c\u044b \u0437\u0430 \u0432\u0435\u0441\u044c \u0440\u0435\u0441\u0443\u0440\u0441 \u043d\u043e\u0434\u044b \u0446\u0435\u043b\u0438\u043a\u043e\u043c. \u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c,\u00a0 \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0432 \u043d\u0430 \u043d\u043e\u0434\u0435 \u0438 \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u043f\u043b\u0430\u0442\u0438\u0442\u044c \u043b\u0438\u0448\u043d\u0438\u0435 \u0434\u0435\u043d\u044c\u0433\u0438 \u0437\u0430 \u043a\u043b\u0430\u0441\u0442\u0435\u0440. \u0421\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e, \u0434\u0435\u043d\u044c\u0433\u0438 \u0443\u0445\u043e\u0434\u044f\u0442 \u0432\u043f\u0443\u0441\u0442\u0443\u044e. <\/p>\n<p><strong>\u0427\u0442\u043e, \u0435\u0441\u043b\u0438 \u0440\u0435\u0430\u043b\u044c\u043d\u043e\u0435 \u043f\u043e\u0442\u0440\u0435\u0431\u043b\u0435\u043d\u0438\u0435 \u0432\u044b\u0448\u0435 \u0432\u044b\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u043d\u044b\u0445 Requests?<\/strong> <\/p>\n<p>\u0422\u0430\u043a\u0430\u044f \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u044f \u043c\u043e\u0436\u0435\u0442 \u043f\u0440\u0438\u0432\u0435\u0441\u0442\u0438 \u043a \u0437\u0430\u043c\u0435\u0434\u043b\u0435\u043d\u0438\u044e \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f. \u041d\u043e\u0434\u0430 \u043d\u0435 \u0431\u0443\u0434\u0435\u0442 \u0441\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c\u0441\u044f \u0441 \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u043e\u0439, \u0431\u0443\u0434\u0443\u0442 \u043f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u043e \u043f\u0435\u0440\u0435\u0441\u0435\u043b\u044f\u0442\u044c\u0441\u044f \u043f\u043e\u0434\u044b. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0434\u043e\u0441\u0442\u0438\u0433\u0430\u044e\u0442\u0441\u044f \u043f\u043e\u0440\u043e\u0433\u0438 \u043f\u0430\u043c\u044f\u0442\u0438 (MemoryPressure) \u0438 \u043d\u043e\u0434\u0430 \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u0442 \u0440\u0430\u0441\u0441\u0435\u043b\u044f\u0442\u044c \u043f\u043e\u0434\u044b \u043f\u043e \u0434\u0440\u0443\u0433\u0438\u043c \u043d\u043e\u0434\u0430\u043c. \u0412 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u043c\u043e\u0436\u0435\u0442 \u043f\u0440\u043e\u0438\u0437\u043e\u0439\u0442\u0438 \u043d\u0435\u043f\u0440\u0435\u0434\u0441\u043a\u0430\u0437\u0443\u0435\u043c\u043e\u0435 \u043c\u0430\u0441\u0448\u0442\u0430\u0431\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u0430 (Cluster Autoscaler). \u0412 \u0442\u0430\u043a\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043c\u044b \u043d\u0435 \u0437\u043d\u0430\u0435\u043c \u0442\u043e\u0447\u043d\u043e, \u043a\u043e\u0433\u0434\u0430 \u043a\u043b\u0430\u0441\u0442\u0435\u0440 \u043d\u0430\u0447\u043d\u0435\u0442 \u043c\u0430\u0441\u0448\u0442\u0430\u0431\u0438\u0440\u043e\u0432\u0430\u0442\u044c\u0441\u044f, \u043d\u0435 \u043c\u043e\u0436\u0435\u043c \u043f\u043b\u0430\u043d\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043d\u0430\u0448\u0438 \u0440\u0435\u0441\u0443\u0440\u0441\u044b \u0438 \u0437\u0430\u0442\u0440\u0430\u0442\u044b.\u00a0<\/p>\n<p><strong>\u0427\u0442\u043e, \u0435\u0441\u043b\u0438 \u0440\u0435\u0430\u043b\u044c\u043d\u043e\u0435 \u043f\u043e\u0442\u0440\u0435\u0431\u043b\u0435\u043d\u0438\u0435 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u0435\u0442 Requests?<\/strong><\/p>\n<p>\u042d\u0442\u043e \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442 \u0447\u0442\u043e CPU, \u043f\u0430\u043c\u044f\u0442\u044c \u0437\u0430\u043d\u044f\u0442\u044b \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u043e, \u0447\u0442\u043e \u043c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u0442\u0435 \u0440\u0435\u0441\u0443\u0440\u0441\u044b, \u0437\u0430 \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u043b\u0430\u0442\u0438\u043c, \u043d\u043e\u0434\u044b \u0437\u0430\u043d\u044f\u0442\u044b \u043f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u043e \u0438 \u043d\u0435\u0442 \u043f\u0440\u043e\u0441\u0442\u043e\u044f. \u0421\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e, \u0432 \u0442\u0430\u043a\u043e\u0439 \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u0438 \u043c\u043e\u0436\u043d\u043e \u0443\u0432\u0438\u0434\u0435\u0442\u044c \u0431\u043e\u043b\u044c\u0448\u0435 \u0432\u0437\u0430\u0438\u043c\u043e\u0441\u0432\u044f\u0437\u0438 \u043c\u0435\u0436\u0434\u0443 \u0442\u0435\u043c, \u043a\u0430\u043a \u0440\u0430\u0441\u0442\u0435\u0442 \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u0430 \u043d\u0430 \u043a\u043b\u0430\u0441\u0442\u0435\u0440, \u0438 \u0442\u0435\u043c, \u043a\u0430\u043a \u043c\u0430\u0441\u0448\u0442\u0430\u0431\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u043a\u043b\u0430\u0441\u0442\u0435\u0440. \u0421\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0441\u044f \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0442\u044c \u0431\u044e\u0434\u0436\u0435\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0438 \u043f\u043b\u0430\u043d\u0438\u0440\u043e\u0432\u0430\u0442\u044c, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043d\u0430 \u0431\u043b\u0438\u0436\u0430\u0439\u0448\u0438\u0435 \u043f\u043e\u043b\u0433\u043e\u0434\u0430, \u043a\u0430\u043a\u043e\u0432\u044b \u0431\u0443\u0434\u0443\u0442 \u0437\u0430\u0442\u0440\u0430\u0442\u044b \u043d\u0430 \u043a\u043b\u0430\u0441\u0442\u0435\u0440. \u0412\u0441\u0435 \u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0441\u044f \u0431\u043e\u043b\u0435\u0435 \u043f\u0440\u0435\u0434\u0441\u043a\u0430\u0437\u0443\u0435\u043c\u044b\u043c.\u00a0<\/p>\n<p>\u041f\u043e\u0434\u0432\u043e\u0434\u044f \u0438\u0442\u043e\u0433, Request \u043d\u0443\u0436\u043d\u044b \u0434\u043b\u044f \u0443\u0447\u0435\u0442\u0430 \u0438 \u043f\u043b\u0430\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0432 \u043d\u043e\u0434\u044b. \u041f\u0440\u0438 \u0441\u0442\u043e\u043f\u0440\u043e\u0446\u0435\u043d\u0442\u043d\u043e\u0439 \u0443\u0442\u0438\u043b\u0438\u0437\u0430\u0446\u0438\u0438 CPU: Requests \u043d\u0443\u0436\u043d\u044b \u0434\u043b\u044f \u043f\u0440\u0438\u043e\u0440\u0438\u0442\u0438\u0437\u0430\u0446\u0438\u0438 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u043d\u043e\u0433\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438; \u043f\u0440\u0438 \u0441\u0442\u043e\u043f\u0440\u043e\u0446\u0435\u043d\u0442\u043d\u043e\u0439 \u0443\u0442\u0438\u043b\u0438\u0437\u0430\u0446\u0438\u0438 Memory \u2014 \u0434\u043b\u044f \u0440\u0430\u0441\u0447\u0435\u0442\u0430, \u0432 \u043a\u0430\u043a\u043e\u043c \u043f\u043e\u0440\u044f\u0434\u043a\u0435 \u043f\u043b\u0430\u043d\u0438\u0440\u043e\u0432\u0449\u0438\u043a \u0431\u0443\u0434\u0435\u0442 \u043e\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0442\u044c \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u044b.<\/p>\n<h3>Limits<\/h3>\n<p>\u041f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e, \u043a\u043e\u0433\u0434\u0430 \u043c\u044b \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u044b \u0432 Kubernetes, \u0442\u043e \u0443 \u043f\u043e\u0434\u0430 \u043d\u0435\u0442 \u043a\u0430\u043a\u0438\u0445-\u043b\u0438\u0431\u043e \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u0439. \u041e\u043d \u043c\u043e\u0436\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0432\u0441\u0435 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u0435 \u0440\u0435\u0441\u0443\u0440\u0441\u044b \u043d\u0430 \u043d\u043e\u0434\u0435 \u2014 CPU, \u043f\u0430\u043c\u044f\u0442\u044c. \u041d\u043e \u0435\u0441\u043b\u0438 \u0432\u044b\u0441\u0442\u0430\u0432\u0438\u0442\u044c Limits, \u0442\u043e \u043f\u0440\u0438 \u0434\u043e\u0441\u0442\u0438\u0436\u0435\u043d\u0438\u0438 \u043f\u043e\u0442\u043e\u043b\u043a\u0430 \u043f\u043e CPU, \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440 \u0431\u0443\u0434\u0435\u0442 \u0442\u0440\u043e\u0442\u043b\u0438\u0442\u044c\u0441\u044f. \u042d\u0442\u043e \u0437\u043d\u0430\u0447\u0438\u0442, \u0447\u0442\u043e \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u043d\u043e\u0435 \u0432\u0440\u0435\u043c\u044f \u043d\u0435 \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0434\u0435\u043b\u044f\u0442\u044c\u0441\u044f \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0443 \u0438 \u043e\u043d \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u043e\u0441\u0442\u0430\u0438\u0432\u0430\u0442\u044c. \u0410 \u043f\u0440\u0438 \u0434\u043e\u0441\u0442\u0438\u0436\u0435\u043d\u0438\u0438 \u043b\u0438\u043c\u0438\u0442\u043e\u0432 \u043f\u043e \u043f\u0430\u043c\u044f\u0442\u0438, Kubernetes \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u043e\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0442\u044c \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440 (OOMKilled).\u00a0<\/p>\n<p>\u0423\u0433\u043b\u0443\u0431\u043b\u044f\u044f\u0441\u044c \u0432 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e CPU Limits, \u0443\u0432\u0438\u0434\u0438\u043c, \u0447\u0442\u043e Kubernetes \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c CFS Bandwidth Control.<\/p>\n<p><a class=\"anchor\" name=\"CFS_Bandwidth_Control\" id=\"CFS_Bandwidth_Control\"><\/a><\/p>\n<h3>CFS Bandwidth Control<\/h3>\n<p><strong>CFS Bandwidth Control<\/strong> \u2014 \u044d\u0442\u043e \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0442\u044c \u043f\u043e\u0442\u043e\u043b\u043e\u043a CPU, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u043e\u0433\u043e \u0433\u0440\u0443\u043f\u043f\u043e\u0439 (Cgroup). \u041c\u0435\u0445\u0430\u043d\u0438\u0437\u043c \u0437\u0430\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e Cgroup \u0432\u044b\u0434\u0430\u0435\u0442\u0441\u044f \u043a\u0432\u043e\u0442\u0430 (Quota) \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u043d\u043e\u0433\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0437\u0430 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0439 \u043e\u0442\u0440\u0435\u0437\u043e\u043a \u0432\u0440\u0435\u043c\u0435\u043d\u0438 (Period). \u041a\u043e\u0433\u0434\u0430 \u0432\u0441\u044f \u043a\u0432\u043e\u0442\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0430, \u043f\u043e\u0442\u043e\u043a\u0438 \u0432 \u0433\u0440\u0443\u043f\u043f\u0435 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0438\u0432\u0430\u044e\u0442\u0441\u044f, \u0438\u043b\u0438 \u0442\u0440\u043e\u0442\u043b\u044f\u0442\u0441\u044f (Throttle), \u0447\u0442\u043e \u0437\u043d\u0430\u0447\u0438\u0442, \u0447\u0442\u043e \u043e\u043d\u0438 \u043d\u0435 \u0431\u0443\u0434\u0443\u0442 \u0438\u0441\u043f\u043e\u043b\u043d\u044f\u0442\u044c\u0441\u044f \u043d\u0430 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u0435 \u043e\u0441\u0442\u0430\u0442\u043e\u043a \u044d\u0442\u043e\u0433\u043e \u043f\u0435\u0440\u0438\u043e\u0434\u0430 (Period). \u041a\u0430\u043a \u0442\u043e\u043b\u044c\u043a\u043e \u0438\u0441\u0447\u0435\u0440\u043f\u0430\u043d\u0430 \u043a\u0432\u043e\u0442\u0430 \u0437\u0430 \u043e\u0434\u0438\u043d \u043f\u0435\u0440\u0438\u043e\u0434, \u043d\u0443\u0436\u043d\u043e \u0436\u0434\u0430\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0433\u043e \u043f\u0435\u0440\u0438\u043e\u0434\u0430, \u043a\u043e\u0433\u0434\u0430 \u043c\u043e\u0436\u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u043d\u043e\u0432\u043e\u0439 \u043a\u0432\u043e\u0442\u043e\u0439.\u00a0<\/p>\n<p>\u041e\u0431\u044a\u044f\u0441\u043d\u044e \u043d\u0430 \u043f\u0440\u043e\u0441\u0442\u043e\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 CFS. \u0415\u0441\u043b\u0438 \u043d\u0443\u0436\u043d\u043e \u0432\u044b\u0434\u0435\u043b\u0438\u0442\u044c \u043e\u0434\u0438\u043d \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440, \u0442\u043e \u043c\u044b \u0432\u044b\u0434\u0435\u043b\u044f\u0435\u043c \u043a\u0432\u043e\u0442\u0443, \u0440\u0430\u0432\u043d\u0443\u044e \u043f\u0435\u0440\u0438\u043e\u0434\u0443: 250ms, 250ms. \u0415\u0441\u043b\u0438 \u043c\u044b \u0445\u043e\u0442\u0438\u043c \u0432\u0437\u044f\u0442\u044c 2 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u0430, \u0442\u043e \u043c\u044b \u0432\u044b\u0434\u0435\u043b\u044f\u0435\u043c \u043a\u0432\u043e\u0442\u0443 \u0432 \u0434\u0432\u0430 \u0440\u0430\u0437\u0430 \u0431\u043e\u043b\u044c\u0448\u0435 \u2014 1000ms \u043a\u0432\u043e\u0442\u0430 \u0438 500ms \u043f\u0435\u0440\u0438\u043e\u0434. 1000 \u0434\u0435\u043b\u0438\u043c \u043d\u0430 500, \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0441\u044f 2 CPU. \u0415\u0441\u043b\u0438 \u0436\u0435 \u043c\u044b \u0445\u043e\u0442\u0438\u043c \u0432\u0437\u044f\u0442\u044c 20% \u043e\u0442 \u043e\u0434\u043d\u043e\u0433\u043e CPU, \u0431\u0435\u0440\u0451\u043c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043a\u0432\u043e\u0442\u044b \u0432 \u043f\u044f\u0442\u044c \u0440\u0430\u0437 \u043c\u0435\u043d\u044c\u0448\u0435 \u043f\u0435\u0440\u0438\u043e\u0434\u0430, \u2014 \u043a\u0432\u043e\u0442\u0430 10ms \u0438 \u043f\u0435\u0440\u0438\u043e\u0434 50ms.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/480\/efc\/3ae\/480efc3aecb7d9211765f7886cd0b195.png\" alt=\"\u041f\u0440\u0438\u043c\u0435\u0440 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 CFS\" title=\"\u041f\u0440\u0438\u043c\u0435\u0440 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 CFS\" width=\"2160\" height=\"1214\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/480\/efc\/3ae\/480efc3aecb7d9211765f7886cd0b195.png\"\/><\/p>\n<div><figcaption><em>\u041f\u0440\u0438\u043c\u0435\u0440 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 CFS<\/em><\/figcaption><\/div>\n<\/figure>\n<p>\u0412\u0430\u0436\u043d\u043e \u043f\u043e\u043d\u0438\u043c\u0430\u0442\u044c, \u0447\u0442\u043e \u0440\u0435\u0441\u0443\u0440\u0441 CPU, \u0435\u0441\u043b\u0438 \u043c\u044b \u0433\u043e\u0432\u043e\u0440\u0438\u043c \u043f\u0440\u043e \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440 \u0432 \u0446\u0435\u043b\u043e\u043c, \u043c\u043e\u0436\u0435\u0442 \u0432\u044b\u0434\u0435\u043b\u044f\u0442\u044c\u0441\u044f \u0441\u0432\u0435\u0440\u0445 Requests, \u0430 \u043c\u043e\u0436\u0435\u0442 \u0438 \u043e\u0442\u043d\u0438\u043c\u0430\u0442\u044c\u0441\u044f. \u041f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u043d\u043e\u0435 \u0432\u0440\u0435\u043c\u044f \u0441\u0436\u0438\u043c\u0430\u0435\u043c\u043e\u0435 (\u0430\u043d\u0433. compressible), \u0447\u0442\u043e \u0437\u043d\u0430\u0447\u0438\u0442 \u043e\u043d\u043e \u043c\u043e\u0436\u0435\u0442 \u043a\u0430\u043a \u0432\u044b\u0434\u0430\u0432\u0430\u0442\u044c\u0441\u044f \u0447\u0443\u0442\u044c \u0431\u043e\u043b\u044c\u0448\u0435, \u0442\u0430\u043a \u0438 \u0432 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u043f\u0435\u0440\u0438\u043e\u0434\u044b \u0437\u0430\u0431\u0438\u0440\u0430\u0442\u044c\u0441\u044f \u0443 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430.\u00a0<\/p>\n<p>\u0427\u0442\u043e \u0436\u0435 \u043a\u0430\u0441\u0430\u0435\u0442\u0441\u044f \u043f\u0430\u043c\u044f\u0442\u0438, \u0442\u043e \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u043d\u0430\u044f \u043f\u0430\u043c\u044f\u0442\u044c, \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u0443\u0436\u0435 \u0434\u0430\u043b\u0438 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0443, \u043d\u0435\u043b\u044c\u0437\u044f \u0447\u0430\u0441\u0442\u0438\u0447\u043d\u043e \u0437\u0430\u0431\u0440\u0430\u0442\u044c. \u0422\u0430\u043a, \u043f\u0440\u0438 \u0434\u043e\u0441\u0442\u0438\u0436\u0435\u043d\u0438\u0438 \u043b\u0438\u043c\u0438\u0442\u043e\u0432, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440 \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u043e\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0441 OOMKilled, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u0443 Kubernetes \u043d\u0435\u0442 \u0434\u0440\u0443\u0433\u043e\u0433\u043e \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u0430 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0438\u0432\u0430\u0442\u044c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043f\u043e \u043f\u0430\u043c\u044f\u0442\u0438. \u041d\u0430 \u043f\u043e\u0442\u0440\u0435\u0431\u043b\u0435\u043d\u0438\u0435 \u043f\u0430\u043c\u044f\u0442\u0438 \u043d\u0435\u043b\u044c\u0437\u044f \u043f\u043e\u0432\u043b\u0438\u044f\u0442\u044c \u0438\u043d\u0430\u0447\u0435, \u2014 \u043e\u043d\u0430 \u0438\u043b\u0438 \u0432\u044b\u0434\u0430\u0435\u0442\u0441\u044f \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044e \u0438\u043b\u0438 \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u0437\u0430\u0431\u0438\u0440\u0430\u0435\u0442\u0441\u044f.\u00a0<\/p>\n<p>\u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, Limits \u043d\u0443\u0436\u043d\u044b \u0434\u043b\u044f \u0432\u044b\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0436\u0435\u0441\u0442\u043a\u0438\u0445 \u043f\u043e\u0440\u043e\u0433\u043e\u0432 \u0443\u0442\u0438\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0432 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430\u043c\u0438. \u041f\u0440\u0438 \u0434\u043e\u0441\u0442\u0438\u0436\u0435\u043d\u0438\u0438 \u044d\u0442\u0438\u0445 \u043f\u043e\u0440\u043e\u0433\u043e\u0432 \u043f\u043e \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u0443 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440 \u0431\u0443\u0434\u0435\u0442 \u0442\u0440\u043e\u0442\u043b\u0438\u0442\u044c\u0441\u044f, \u0430 \u043f\u043e \u0434\u043e\u0441\u0442\u0438\u0436\u0435\u043d\u0438\u044e \u043b\u0438\u043c\u0438\u0442\u043e\u0432 \u043f\u043e \u043f\u0430\u043c\u044f\u0442\u0438 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440 \u0431\u0443\u0434\u0435\u0442 \u043e\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0442\u044c\u0441\u044f.\u00a0<\/p>\n<p><a class=\"anchor\" name=\"sbm\" id=\"sbm\"><\/a><\/p>\n<h2>GOMAXPROCS<\/h2>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u044f \u043c\u043e\u0433\u0443 \u0431\u043e\u043b\u0435\u0435 \u043f\u0440\u0435\u0434\u043c\u0435\u0442\u043d\u043e \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u0430\u0442\u044c \u043e \u043d\u0430\u0448\u0438\u0445 Go-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f\u0445 \u0438 \u043e \u0442\u043e\u043c, \u043a\u0430\u043a \u043e\u043d\u0438 \u0441\u0435\u0431\u044f \u0432\u0435\u0434\u0443\u0442 \u0432 \u0431\u043e\u043b\u044c\u0448\u0438\u0445 Kubernetes-\u043a\u043b\u0430\u0441\u0442\u0435\u0440\u0430\u0445.\u00a0<\/p>\n<p>\u0415\u0441\u0442\u044c \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f GOMAXPROCS \u2014 \u044d\u0442\u043e \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0430\u043a\u0442\u0438\u0432\u043d\u044b\u0445 \u0442\u0440\u0435\u0434\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u043e\u0436\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c Go-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435. \u041e\u0431\u044b\u0447\u043d\u043e, \u043a\u043e\u0433\u0434\u0430 \u043c\u044b \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c \u043d\u0430\u0448\u0435 Go-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0432 \u043e\u0431\u043b\u0430\u043a\u0435, \u0442\u043e \u043d\u0430\u0448\u0438 \u043e\u0431\u043b\u0430\u0447\u043d\u044b\u0435 \u0441\u0435\u0440\u0432\u0435\u0440\u044b \u0438\u043c\u0435\u044e\u0442 \u0434\u0435\u0441\u044f\u0442\u043a\u0438 \u0438\u043b\u0438 \u0441\u043e\u0442\u043d\u0438 CPU. \u041f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e, \u0435\u0441\u043b\u0438 \u043c\u044b \u043d\u0438\u043a\u0430\u043a \u043d\u0435 \u043d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u043c \u043d\u0430\u0448\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435, \u043e\u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0432\u0441\u0435 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u0435 \u0438, \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e, \u043d\u0430 \u043a\u0430\u0436\u0434\u043e\u043c CPU \u0431\u0443\u0434\u0435\u0442 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u0442\u0440\u0435\u0434 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u044b.\u00a0<\/p>\n<p>\u041d\u043e \u0432\u043e\u0437\u043d\u0438\u043a\u0430\u0435\u0442 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430: \u043a\u043e\u0433\u0434\u0430 \u043d\u0430\u0448\u0435 Go-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u0432\u0441\u0435 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u0435 CPU, \u044d\u0442\u043e \u043c\u043e\u0436\u0435\u0442 \u0432\u044b\u0437\u044b\u0432\u0430\u0442\u044c \u0432\u044b\u0441\u043e\u043a\u0438\u0435 \u043d\u0430\u043a\u043b\u0430\u0434\u043d\u044b\u0435 \u0440\u0430\u0441\u0445\u043e\u0434\u044b \u043d\u0430 \u043f\u0435\u0440\u0435\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0430 CPU.\u00a0<\/p>\n<p>\u041a\u043e\u0433\u0434\u0430 \u0441\u043e\u0437\u0434\u0430\u0435\u0442\u0441\u044f \u0441\u043b\u0438\u0448\u043a\u043e\u043c \u043c\u043d\u043e\u0433\u043e \u0442\u0440\u0435\u0434\u043e\u0432, \u0438 Go-\u043f\u043b\u0430\u043d\u0438\u0440\u043e\u0432\u0449\u0438\u043a \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u0442 \u043f\u043e \u0432\u0441\u0435\u043c \u044d\u0442\u0438\u043c \u0442\u0440\u0435\u0434\u0430\u043c \u0440\u0430\u0441\u043a\u043b\u0430\u0434\u044b\u0432\u0430\u0442\u044c Goroutines, \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0441\u044f, \u0442\u0430\u043a \u0447\u0442\u043e \u0434\u043b\u044f \u0438\u0441\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0432\u0441\u0435\u0445 \u0437\u0430\u0434\u0430\u0447 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u0430 \u043f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u043e \u043f\u0435\u0440\u0435\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f. \u0422\u0440\u0435\u0434\u044b \u0436\u0438\u0432\u0443\u0442 \u043d\u0430 \u0440\u0430\u0437\u043d\u044b\u0445 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u0430\u0445, \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u044b \u0444\u0438\u0437\u0438\u0447\u0435\u0441\u043a\u0438 \u043d\u0430\u0445\u043e\u0434\u044f\u0442\u0441\u044f \u043d\u0430 \u043c\u0430\u0442\u0435\u0440\u0438\u043d\u0441\u043a\u043e\u0439 \u043f\u043b\u0430\u0442\u0435 \u0432 \u0440\u0430\u0437\u043d\u044b\u0445 \u043c\u0435\u0441\u0442\u0430\u0445. \u0421\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e, \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u044d\u0442\u0438\u0445 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u043e\u0432 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0433\u0434\u0435-\u0442\u043e \u043c\u0435\u0434\u043b\u0435\u043d\u043d\u0435\u0435, \u0433\u0434\u0435-\u0442\u043e \u0431\u044b\u0441\u0442\u0440\u0435\u0435. \u0412\u043e\u0437\u043d\u0438\u043a\u0430\u0435\u0442 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u0432\u044b\u0441\u043e\u043a\u0438\u0445 \u043d\u0430\u043a\u043b\u0430\u0434\u043d\u044b\u0445 \u0440\u0430\u0441\u0445\u043e\u0434\u043e\u0432 \u043f\u0440\u0438 \u043f\u0435\u0440\u0435\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0438 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0430 \u043d\u0430 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u0430\u0445 (Context Switching).\u00a0<\/p>\n<p>\u0412 \u0442\u043e \u0436\u0435 \u0432\u0440\u0435\u043c\u044f \u0435\u0441\u043b\u0438 \u043c\u044b \u0432\u0434\u0440\u0443\u0433 \u0437\u0430\u0445\u043e\u0442\u0438\u043c \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0438\u0432\u0430\u0442\u044c \u043d\u0430\u0448\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0441 \u043d\u0438\u0437\u043a\u0438\u043c\u0438 CPU Limits, \u044d\u0442\u043e \u0437\u043d\u0430\u0447\u0438\u0442, \u0447\u0442\u043e \u044d\u0442\u0438 CPU Limits \u0431\u0443\u0434\u0443\u0442 \u0440\u0430\u0437\u043c\u0430\u0437\u044b\u0432\u0430\u0442\u044c\u0441\u044f \u043f\u043e \u0432\u0441\u0435\u043c \u044f\u0434\u0440\u0430\u043c. CPU Quota \u0431\u0443\u0434\u0435\u0442 \u0434\u0435\u043b\u0438\u0442\u044c\u0441\u044f \u043d\u0430 \u0432\u0441\u0435 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u044b, \u043d\u0430 \u043a\u0430\u0436\u0434\u043e\u043c \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u0435 \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u0430 \u0441\u043b\u0438\u0448\u043a\u043e\u043c \u043c\u0430\u043b\u0435\u043d\u044c\u043a\u0430\u044f \u0433\u0440\u0430\u043d\u0443\u043b\u044f\u0440\u043d\u0430\u044f \u043a\u0432\u043e\u0442\u0430, \u0438 \u044d\u0442\u043e \u043c\u043e\u0436\u0435\u0442 \u043f\u0440\u0438\u0432\u0435\u0441\u0442\u0438 \u043a \u0442\u0440\u043e\u0442\u043b\u0438\u043d\u0433\u0443 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f.\u00a0<\/p>\n<p>\u0415\u0441\u043b\u0438 GOMAXPROCS \u0441\u0438\u043b\u044c\u043d\u043e \u043f\u0440\u0435\u0432\u044b\u0448\u0430\u0435\u0442 CPU Limits \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430, \u0442\u043e \u043c\u043e\u0436\u0435\u0442 \u043d\u0430\u0431\u043b\u044e\u0434\u0430\u0442\u044c\u0441\u044f \u0442\u0440\u043e\u0442\u043b\u0438\u043d\u0433. \u041c\u044b \u0442\u043e\u0436\u0435 \u0441 \u044d\u0442\u0438\u043c \u0441\u0442\u043e\u043b\u043a\u043d\u0443\u043b\u0438\u0441\u044c. \u0415\u0441\u0442\u044c \u043d\u0430\u0431\u043b\u044e\u0434\u0435\u043d\u0438\u0435, \u0447\u0442\u043e \u0435\u0441\u043b\u0438 \u0432\u044b\u0441\u0442\u0430\u0432\u0438\u0442\u044c GOMAXPROCS \u0441 \u0440\u0430\u0432\u043d\u044b\u043c CPU Limits, \u0442\u043e \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u044c CPU \u0442\u0440\u043e\u0442\u043b\u0438\u043d\u0433\u0430 \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u0430\u044f. \u041f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0441\u044f, \u0447\u0442\u043e \u0435\u0441\u043b\u0438, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0432\u0430\u0448\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 4 \u0442\u0440\u0435\u0434\u0430 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u0438 \u0432 \u0442\u043e \u0436\u0435 \u0432\u0440\u0435\u043c\u044f \u0432\u044b \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0438\u0432\u0430\u0435\u0442\u0435 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440 CPU-\u043b\u0438\u043c\u0438\u0442\u0430\u043c\u0438 \u0434\u043e 4 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e CFS, \u2014 \u044d\u0442\u043e \u0438\u0434\u0435\u0430\u043b\u044c\u043d\u0430\u044f \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u044f. \u0422\u0430\u043a \u043c\u043e\u0436\u043d\u043e \u0434\u043e\u0441\u0442\u0438\u0447\u044c \u043f\u0438\u043a\u0430 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438.\u00a0<\/p>\n<p>\u0414\u043b\u044f \u0442\u043e\u0433\u043e \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u043c\u043e\u0447\u044c \u0432\u0441\u0435 \u044d\u0442\u043e \u043d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0442\u044c, \u0435\u0441\u0442\u044c \u043f\u0440\u043e\u0441\u0442\u0435\u0439\u0448\u0430\u044f \u0432 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 <a href=\"https:\/\/github.com\/uber-go\/automaxprocs\"><u>Automaxprocs<\/u><\/a> \u043e\u0442 \u0441\u043e\u0442\u0440\u0443\u0434\u043d\u0438\u043a\u043e\u0432 \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u0438 Uber. \u0411\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043f\u0440\u0438\u0432\u044f\u0437\u044b\u0432\u0430\u0442\u044c GOMAXPROCS \u043a Container CPU Limit. \u0420\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u0435\u0442\u0441\u044f \u0432\u044b\u0441\u0442\u0430\u0432\u043b\u044f\u0442\u044c \u0446\u0435\u043b\u044b\u0435 \u0447\u0438\u0441\u043b\u0430 \u0432 CPU Limit, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u044d\u0442\u0438 \u0446\u0435\u043b\u044b\u0435 \u0447\u0438\u0441\u043b\u0430 \u0442\u0443\u0442 \u0436\u0435 \u0442\u0440\u0430\u043d\u0441\u043b\u0438\u0440\u0443\u044e\u0442\u0441\u044f \u0432 \u0447\u0438\u0441\u043b\u043e \u0432 GOMAXPROCS.\u00a0<\/p>\n<p><a class=\"anchor\" name=\"ex\" id=\"ex\"><\/a><\/p>\n<h3>\u041f\u0440\u0438\u043c\u0435\u0440 \u0440\u0430\u0431\u043e\u0442\u044b \u0441 GOMAXPROCS \u0438\u0437 \u043e\u043f\u044b\u0442\u0430 \u0421\u0431\u0435\u0440\u041c\u0430\u0440\u043a\u0435\u0442\u0430<\/h3>\n<p>\u0412 \u043c\u043e\u0435\u0439 \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0435 \u0431\u044b\u043b\u0430 \u043f\u043e\u0445\u043e\u0436\u0430\u044f \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u044f. \u0423 \u043d\u0430\u0441 \u0431\u044b\u043b\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043a\u0440\u0443\u0442\u0438\u043b\u043e\u0441\u044c \u0431\u0435\u0437 \u0432\u044b\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u043d\u044b\u0445 \u043b\u0438\u043c\u0438\u0442\u043e\u0432 \u0432 \u043e\u0431\u043b\u0430\u043a\u0435 \u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u043e \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u0432\u0441\u0435 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u044b \u043e\u0431\u043b\u0430\u043a\u0430.\u00a0<\/p>\n<p>\u041c\u044b \u0441\u0435\u0439\u0447\u0430\u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u0441\u0435\u0440\u0432\u0435\u0440\u044b \u043f\u043e 80 \u044f\u0434\u0435\u0440. \u041c\u044b \u043f\u0440\u043e\u0432\u0435\u043b\u0438 \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e \u0442\u0435\u0441\u0442\u043e\u0432 \u0441 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u043c\u0438 \u0447\u0438\u0441\u043b\u0430\u043c\u0438 GOMAXPROCS, CPU Limit. \u0412 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u043c\u044b \u0432\u044b\u044f\u0432\u0438\u043b\u0438 \u043e\u0447\u0435\u0432\u0438\u0434\u043d\u043e\u0435 \u043f\u0440\u0435\u0438\u043c\u0443\u0449\u0435\u0441\u0442\u0432\u043e \u0440\u0430\u0431\u043e\u0442\u044b \u0441 GOMAXPROCS=4, CPU Limit=4 \u043f\u043e \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u044e \u0441 \u0438\u0437\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e\u0439 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u043e\u0439, \u043a\u043e\u0433\u0434\u0430 \u0443 \u043d\u0430\u0441 \u043d\u0435 \u0431\u044b\u043b\u043e \u0432\u044b\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u043e \u043b\u0438\u043c\u0438\u0442\u043e\u0432 \u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0438\u0441\u044c \u0432\u0441\u0435 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u044b.<\/p>\n<p>\u041d\u0430 \u0433\u0440\u0430\u0444\u0438\u043a\u0435 \u043d\u0438\u0436\u0435 \u0432\u0438\u0434\u043d\u043e, \u0447\u0435\u0433\u043e \u043d\u0430\u043c \u0443\u0434\u0430\u043b\u043e\u0441\u044c \u0434\u043e\u0431\u0438\u0442\u044c\u0441\u044f. \u0412 \u043b\u0435\u0432\u043e\u0439 \u0447\u0430\u0441\u0442\u0438 \u2014 GOMAXPROCS=80, \u0432 \u043f\u0440\u0430\u0432\u043e\u0439 \u0447\u0430\u0441\u0442\u0438 \u2014 GOMAXPROCS=4. \u0414\u0435\u043f\u043b\u043e\u0439 \u043e\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043a\u0430\u043d\u0430\u0440\u0435\u0439\u043a\u0438, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043e\u043d \u0437\u0430\u043d\u0438\u043c\u0430\u0435\u0442 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0434\u043b\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0435 \u0432\u0440\u0435\u043c\u044f. \u041d\u043e \u0443\u0436\u0435 \u0432\u0438\u0434\u043d\u0430 \u0440\u0430\u0437\u043d\u0438\u0446\u0430 \u043d\u0430 50-\u043c \u043f\u0435\u0440\u0441\u0435\u043d\u0442\u0438\u043b\u0435, \u0447\u0442\u043e Duration \u043f\u0430\u0434\u0430\u0435\u0442 \u0441 1,83\u043c\u0441 \u0434\u043e 1,73\u043c\u0441. \u042d\u0442\u043e \u0440\u043e\u0441\u0442 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u043d\u0430 20%.\u00a0<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/191\/788\/c8f\/191788c8f2c13f433aa7b3b5f54ef2d6.png\" alt=\"\u0414\u043b\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u043e\u0442\u0432\u0435\u0442\u0430 GRPC 50-\u0439 \u043f\u0435\u0440\u0441\u0435\u043d\u0442\u0438\u043b\u044c\" title=\"\u0414\u043b\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u043e\u0442\u0432\u0435\u0442\u0430 GRPC 50-\u0439 \u043f\u0435\u0440\u0441\u0435\u043d\u0442\u0438\u043b\u044c\" width=\"2366\" height=\"1082\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/191\/788\/c8f\/191788c8f2c13f433aa7b3b5f54ef2d6.png\"\/><\/p>\n<div><figcaption><em>\u0414\u043b\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u043e\u0442\u0432\u0435\u0442\u0430 GRPC 50-\u0439 \u043f\u0435\u0440\u0441\u0435\u043d\u0442\u0438\u043b\u044c<\/em><\/figcaption><\/div>\n<\/figure>\n<p>\u0415\u0449\u0435 \u043b\u0443\u0447\u0448\u0443\u044e \u043a\u0430\u0440\u0442\u0438\u043d\u0443 \u043c\u044b \u043d\u0430\u0431\u043b\u044e\u0434\u0430\u0435\u043c \u043d\u0430 90-\u043c \u043f\u0435\u0440\u0441\u0438\u043d\u0442\u0438\u043b\u0435 (\u0433\u0440\u0430\u0444\u0438\u043a \u043d\u0438\u0436\u0435). \u0412 \u043b\u0435\u0432\u043e\u0439 \u0447\u0430\u0441\u0442\u0438 \u0433\u0440\u0430\u0444\u0438\u043a\u0430 \u0432\u0438\u0434\u043d\u044b \u043f\u0438\u043a\u0438, \u0430 \u043f\u043e\u0441\u043b\u0435 \u0434\u0435\u043f\u043b\u043e\u044f \u0433\u0440\u0430\u0444\u0438\u043a \u0432\u044b\u0440\u0430\u0432\u043d\u0438\u0432\u0430\u0435\u0442\u0441\u044f. \u042d\u0442\u043e \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442, \u0447\u0442\u043e Go-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u043c\u0435\u043d\u044c\u0448\u0435\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u044f\u0434\u0435\u0440 \u0438 \u043c\u0435\u043d\u044c\u0448\u0435\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0442\u0440\u0435\u0434\u043e\u0432 \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0435, \u043c\u043e\u0436\u0435\u0442 \u0431\u043e\u043b\u0435\u0435 \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u043e \u043f\u0435\u0440\u0435\u043a\u043b\u044e\u0447\u0430\u0442\u044c Goroutines \u043c\u0435\u0436\u0434\u0443 \u044d\u0442\u0438\u043c\u0438 \u0442\u0440\u0435\u0434\u0430\u043c\u0438.\u00a0<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/19a\/74b\/a43\/19a74ba4349ec4a558d6cc2444f13589.png\" alt=\"\u0414\u043b\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u043e\u0442\u0432\u0435\u0442\u0430 GRPC 90-\u0439 \u043f\u0435\u0440\u0441\u0435\u043d\u0442\u0438\u043b\u044c\" title=\"\u0414\u043b\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u043e\u0442\u0432\u0435\u0442\u0430 GRPC 90-\u0439 \u043f\u0435\u0440\u0441\u0435\u043d\u0442\u0438\u043b\u044c\" width=\"2534\" height=\"1158\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/19a\/74b\/a43\/19a74ba4349ec4a558d6cc2444f13589.png\"\/><\/p>\n<div><figcaption><em>\u0414\u043b\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u043e\u0442\u0432\u0435\u0442\u0430 GRPC 90-\u0439 \u043f\u0435\u0440\u0441\u0435\u043d\u0442\u0438\u043b\u044c<\/em><\/figcaption><\/div>\n<\/figure>\n<p>\u0415\u0441\u043b\u0438 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u043d\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u043d\u043e\u0433\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438, \u0442\u043e \u0437\u0434\u0435\u0441\u044c \u0435\u0449\u0435 \u0431\u043e\u043b\u0435\u0435 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u044b\u0435 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b: \u043f\u043e \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u044e \u0441\u043e 120% \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f CPU \u043a\u0430\u0436\u0434\u044b\u043c \u043f\u043e\u0434\u043e\u043c \u043c\u044b \u0443\u0432\u0438\u0434\u0435\u043b\u0438 \u043f\u0430\u0434\u0435\u043d\u0438\u0435 \u0434\u043e 80%. \u0418 \u043e\u043f\u044f\u0442\u044c \u0436\u0435 \u0432\u0438\u0434\u043d\u043e \u0432\u044b\u0440\u0430\u0432\u043d\u0438\u0432\u0430\u043d\u0438\u0435 \u0433\u0440\u0430\u0444\u0438\u043a\u0430. \u0422\u043e \u0435\u0441\u0442\u044c Go-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0431\u043e\u043b\u0435\u0435 \u043f\u0440\u0435\u0434\u0441\u043a\u0430\u0437\u0443\u0435\u043c\u043e, \u043d\u0435\u0442 \u043a\u0430\u043a\u0438\u0445-\u0442\u043e \u043f\u0438\u043a\u043e\u0432, \u043c\u044b \u043f\u043e\u043d\u0438\u043c\u0430\u0435\u043c, \u043a\u0430\u043a \u043e\u043d\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0441 \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u043e\u0439, \u043c\u043e\u0436\u0435\u043c \u043b\u0443\u0447\u0448\u0435 \u043f\u0440\u043e\u0433\u043d\u043e\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043a\u0430\u043a \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0441\u0442\u0438 CPU Usage \u043f\u0440\u0438 \u0440\u043e\u0441\u0442\u0435 \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u0438.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/066\/b7a\/369\/066b7a3692a09d231423ac1986d89c25.png\" alt=\"CPU Usage\" title=\"CPU Usage\" width=\"2564\" height=\"1172\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/066\/b7a\/369\/066b7a3692a09d231423ac1986d89c25.png\"\/><\/p>\n<div><figcaption><em>CPU Usage<\/em><\/figcaption><\/div>\n<\/figure>\n<p>\u0418 \u0435\u0449\u0435 \u043e\u0434\u0438\u043d \u0433\u0440\u0430\u0444\u0438\u043a (\u043d\u0430 \u0440\u0438\u0441\u0443\u043d\u043a\u0435 \u043d\u0438\u0436\u0435) \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 \u0434\u043b\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c GC (Garbage Collection). \u0417\u0434\u0435\u0441\u044c \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c Duration \u0442\u043e\u0436\u0435 \u043f\u0430\u0434\u0430\u0435\u0442 \u0440\u0430\u0437\u0438\u0442\u0435\u043b\u044c\u043d\u043e, \u0432 \u0434\u0432\u0430 \u0440\u0430\u0437\u0430, \u2014 \u0441\u043e 170 \u043c\u0438\u043a\u0440\u043e\u0441\u0435\u043a\u0443\u043d\u0434 \u0434\u043e 80 \u043c\u0438\u043a\u0440\u043e\u0441\u0435\u043a\u0443\u043d\u0434. \u041f\u043e\u043b\u043e\u0436\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0435 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u0432\u0438\u0434\u043d\u043e \u043d\u0430 \u0433\u0440\u0430\u0444\u0438\u043a\u0430\u0445 \u043f\u043e \u0432\u0441\u0435\u043c \u043f\u0435\u0440\u0441\u0435\u043d\u0442\u0438\u043b\u044f\u043c: 50, 90, 99.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/560\/0a5\/cfb\/5600a5cfbe0406d139efce35b9f1c943.png\" alt=\"\u0414\u043b\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c Garbage Collection, 50-\u0439 \u043f\u0435\u0440\u0441\u0435\u043d\u0442\u0438\u043b\u044c\" title=\"\u0414\u043b\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c Garbage Collection, 50-\u0439 \u043f\u0435\u0440\u0441\u0435\u043d\u0442\u0438\u043b\u044c\" width=\"2374\" height=\"1078\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/560\/0a5\/cfb\/5600a5cfbe0406d139efce35b9f1c943.png\"\/><\/p>\n<div><figcaption><em>\u0414\u043b\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c Garbage Collection, 50-\u0439 \u043f\u0435\u0440\u0441\u0435\u043d\u0442\u0438\u043b\u044c<\/em><\/figcaption><\/div>\n<\/figure>\n<p>\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u0432\u0441\u0435\u0445 \u043d\u0430\u0448\u0438\u0445 \u0442\u0435\u0441\u0442\u043e\u0432 \u0441 GOMAXPROCS \u0438 Limits \u043f\u043e\u043a\u0430\u0437\u0430\u043b\u0438, \u0447\u0442\u043e \u0432\u044b\u0441\u0442\u0430\u0432\u043b\u044f\u044f \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u044b\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f (\u0434\u043b\u044f \u043d\u0430\u0441 \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u044b\u0435 \u2014 GOMAXPROCS=4 \u0438 CPU Limit=4), \u043c\u044b \u0443\u043b\u0443\u0447\u0448\u0438\u043b\u0438 90-\u0439 \u043f\u0435\u0440\u0441\u0435\u043d\u0442\u0438\u043b\u044c \u0434\u043b\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u043d\u0430\u0448\u0435\u0433\u043e GRPC-\u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u043d\u0430 20%, \u043f\u043e\u0442\u0440\u0435\u0431\u043b\u0435\u043d\u0438\u0435 CPU \u2014 \u043d\u0430 33% \u0438 GC \u2014 \u043d\u0430 50%.<\/p>\n<p>\u0412 \u0446\u0435\u043b\u043e\u043c \u043d\u0430\u0448\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0441\u0442\u0430\u043b\u043e \u0431\u043e\u043b\u0435\u0435 \u043f\u0440\u0435\u0434\u0441\u043a\u0430\u0437\u0443\u0435\u043c\u044b\u043c, \u0433\u0440\u0430\u0444\u0438\u043a\u0438 \u0432\u044b\u0440\u043e\u0432\u043d\u044f\u043b\u0438\u0441\u044c \u0438 \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u0435\u0435 \u0432\u044b\u044f\u0432\u043b\u044f\u0442\u044c \u043f\u043e\u0442\u0440\u0435\u0431\u043b\u0435\u043d\u0438\u0435 \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0432 \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0442\u043e\u0439 \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u0438, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0434\u0430\u0435\u0442\u0441\u044f \u043d\u0430 \u043d\u0430\u0448 \u0441\u0435\u0440\u0432\u0438\u0441.\u00a0<\/p>\n<p>\u041f\u043e\u0434\u0432\u043e\u0434\u044f \u0438\u0442\u043e\u0433\u0438, GOMAXPROCS \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442, \u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043f\u043e\u0442\u043e\u043a\u043e\u0432 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c, \u0438, \u0432\u044b\u0441\u0442\u0430\u0432\u043b\u044f\u044f \u043e\u043f\u0442\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u044d\u0442\u043e\u0439 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439, \u043e\u043d \u043f\u043e\u043c\u043e\u0433\u0430\u0435\u0442 \u0441\u043d\u0438\u0437\u0438\u0442\u044c \u043d\u0430\u043a\u043b\u0430\u0434\u043d\u044b\u0435 \u0440\u0430\u0441\u0445\u043e\u0434\u044b \u043d\u0430 \u043f\u0435\u0440\u0435\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0430 \u0438 \u0443\u043b\u0443\u0447\u0448\u0438\u0442\u044c \u0433\u0440\u0430\u0444\u0438\u043a\u0438. \u0411\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 Automaxprocs \u043f\u0440\u0438\u0432\u044f\u0437\u044b\u0432\u0430\u0435\u0442 GOMAXPROCS \u043a CPU Limits \u0438 \u043f\u043e\u043c\u043e\u0433\u0430\u0435\u0442 \u0441\u043d\u0438\u0437\u0438\u0442\u044c \u043f\u0435\u0440\u0435\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u043e\u0432, \u0438, \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e, \u0441\u043e\u043a\u0440\u0430\u0442\u0438\u0442\u044c \u0442\u0440\u043e\u0442\u043b\u0438\u043d\u0433 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439.<\/p>\n<p><a class=\"anchor\" name=\"rec\" id=\"rec\"><\/a><\/p>\n<h2>\u0420\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0430\u0446\u0438\u0438<\/h2>\n<p>\u041d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u043d\u0430\u0448\u0435\u0433\u043e \u043e\u043f\u044b\u0442\u0430 \u0441 Kubernetes \u0438 GOMAXPROCS \u0441\u043e\u0431\u0440\u0430\u043b\u0438 \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u0447\u0435\u043a-\u043b\u0438\u0441\u0442, \u043a\u043e\u0442\u043e\u0440\u043e\u043c\u0443 \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u0435\u043c \u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u044c.<\/p>\n<p><strong>\u041e\u043f\u0442\u0438\u043c\u0438\u0437\u0438\u0440\u0443\u0435\u043c \u0440\u0435\u0441\u0443\u0440\u0441\u044b Kubernetes:<\/strong><\/p>\n<div>\n<div class=\"table\">\n<table>\n<tbody>\n<tr>\n<td>\n<p>\u2705 \u0412\u0441\u0435\u0433\u0434\u0430 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0439\u0442\u0435 CPU, Memory Requests. \u042d\u0442\u043e \u043d\u0443\u0436\u043d\u043e \u0434\u043b\u044f \u0431\u043e\u043b\u0435\u0435 \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u043e\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0432.<\/p>\n<p>\u2705 CPU Limits \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0439\u0442\u0435 \u0432 \u0441\u0432\u044f\u0437\u043a\u0435 \u0441 GOMAXPROCS. \u0412\u0441\u0435\u0433\u0434\u0430 \u043d\u0443\u0436\u043d\u043e \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c, \u0441\u043a\u043e\u043b\u044c\u043a\u043e CPU Limits, \u0441\u043a\u043e\u043b\u044c\u043a\u043e GOMAXPROCS \u0441\u0435\u0439\u0447\u0430\u0441 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442.<\/p>\n<p>\u2705 Memory Limits \u0432\u044b\u0441\u0442\u0430\u0432\u043b\u044f\u0439\u0442\u0435 \u0440\u0430\u0432\u043d\u044b\u043c\u0438 Requests. \u042d\u0442\u043e \u043f\u043e\u043c\u043e\u0436\u0435\u0442 \u0438\u0437\u0431\u0435\u0436\u0430\u0442\u044c \u0432\u044b\u0441\u0435\u043b\u0435\u043d\u0438\u0439 \u043f\u043e\u0434\u043e\u0432 \u0441 \u043e\u0434\u043d\u043e\u0439 \u043d\u043e\u0434\u044b \u043d\u0430 \u0434\u0440\u0443\u0433\u0443\u044e.<\/p>\n<p>\u2705 \u041c\u043e\u043d\u0438\u0442\u043e\u0440\u044c\u0442\u0435 CPU Throttling \u0432\u0430\u0448\u0438\u0445 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u043e\u0432. \u042d\u0442\u043e \u043f\u043e\u043c\u043e\u0436\u0435\u0442 \u0432\u044b\u044f\u0432\u043b\u044f\u0442\u044c \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b \u0441 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c\u044e \u043d\u0430 \u0440\u0430\u043d\u043d\u0438\u0445 \u0441\u0442\u0430\u0434\u0438\u044f\u0445.<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<p><strong>\u0414\u043b\u044f Go-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439:<\/strong><\/p>\n<div>\n<div class=\"table\">\n<table>\n<tbody>\n<tr>\n<td>\n<p>\u2705 \u0412\u0441\u0435\u0433\u0434\u0430 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u0438\u0440\u0443\u0439\u0442\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 GOMAXPROCS<\/p>\n<p>\u2705 \u041e\u043f\u0442\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u0439 GOMAXPROCS \u0432\u0441\u0435\u0433\u0434\u0430 \u0437\u0430\u0432\u0438\u0441\u0438\u0442 \u043e\u0442 \u0432\u0430\u0448\u0435\u0433\u043e \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0430, \u0443 \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0441\u0432\u043e\u0439 \u043f\u0440\u043e\u0444\u0438\u043b\u044c \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u0438<\/p>\n<p>\u2705 \u041f\u0440\u043e\u0431\u0443\u0439\u0442\u0435 \u0440\u0430\u0437\u043d\u044b\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f, \u0434\u0435\u043f\u043b\u043e\u0439\u0442\u0435 \u0438\u0445 \u043d\u0430 \u043f\u0440\u043e\u0434\u0435, \u043f\u043e\u043a\u0430 \u043d\u0435 \u043d\u0430\u0439\u0434\u0435\u0442\u0435 \u043e\u043f\u0442\u0438\u043c\u0430\u043b\u044c\u043d\u0443\u044e \u043a\u043e\u043c\u0431\u0438\u043d\u0430\u0446\u0438\u044e. \u0412\u043e \u0432\u0440\u0435\u043c\u044f \u044d\u0441\u043a\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u043e\u0432, \u0441\u043c\u043e\u0442\u0440\u0438\u0442\u0435 \u0438 \u0430\u043d\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u0439\u0442\u0435 \u0433\u0440\u0430\u0444\u0438\u043a\u0438 \u043f\u043e:<\/p>\n<p>\u2014 Server Latency (50, 90, 99, 99.9 \u043f\u0435\u0440\u0441\u0435\u043d\u0442\u0438\u043b\u0438)<\/p>\n<p>\u2014 CPU Usage<\/p>\n<p>\u2014 GC Duration<\/p>\n<p>\u0412\u044b\u0441\u0442\u0430\u0432\u043b\u044f\u044f \u043e\u043f\u0442\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f, \u043c\u044b \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0438\u0440\u0443\u0435\u043c \u0431\u044e\u0434\u0436\u0435\u0442 \u043d\u0430 Kubernetes \u0438 \u0434\u0435\u043b\u0430\u0435\u043c \u0435\u0433\u043e \u0431\u043e\u043b\u0435\u0435 \u043f\u0440\u0435\u0434\u0441\u043a\u0430\u0437\u0443\u0435\u043c\u044b\u043c, \u0430 \u0442\u0430\u043a\u0436\u0435 \u043f\u043e\u0432\u044b\u0448\u0430\u0435\u043c \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c Go \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439 \u0432 \u0446\u0435\u043b\u043e\u043c.<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<p>\u0411\u0443\u0434\u0443 \u0440\u0430\u0434, \u0435\u0441\u043b\u0438 \u043c\u0430\u0442\u0435\u0440\u0438\u0430\u043b \u043e\u043a\u0430\u0436\u0435\u0442\u0441\u044f \u043f\u043e\u043b\u0435\u0437\u043d\u044b\u043c \u0438 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u0441\u044f \u043f\u0440\u0438\u043c\u0435\u043d\u0438\u0442\u044c \u043d\u0430 \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0435. \u0415\u0441\u043b\u0438 \u0432\u043e\u0437\u043d\u0438\u043a\u043d\u043d\u0443\u0442 \u0432\u043e\u043f\u0440\u043e\u0441\u044b, \u0441\u0442\u0443\u0447\u0438\u0442\u0435\u0441\u044c \u0432 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u044f\u0445.<\/p>\n<blockquote>\n<p><em>Tech-\u043a\u043e\u043c\u0430\u043d\u0434\u0430 \u0421\u0431\u0435\u0440\u041c\u0430\u0440\u043a\u0435\u0442\u0430 \u0432\u0435\u0434\u0435\u0442 \u0441\u043e\u0446\u0441\u0435\u0442\u0438 \u0441 \u043d\u043e\u0432\u043e\u0441\u0442\u044f\u043c\u0438 \u0438 \u0430\u043d\u043e\u043d\u0441\u0430\u043c\u0438. \u0415\u0441\u043b\u0438 \u0445\u043e\u0447\u0435\u0448\u044c \u0443\u0437\u043d\u0430\u0442\u044c, \u0447\u0442\u043e \u043f\u043e\u0434 \u043a\u0430\u043f\u043e\u0442\u043e\u043c \u0432\u044b\u0441\u043e\u043a\u043e\u043d\u0430\u0433\u0440\u0443\u0436\u0435\u043d\u043d\u043e\u0433\u043e e-commerce, \u0441\u043b\u0435\u0434\u0438 \u0437\u0430 \u043d\u0430\u043c\u0438 \u0432 <\/em><a href=\"https:\/\/t.me\/sbermarket_tech\"><em>Telegram<\/em><\/a><em> \u0438 \u043d\u0430\u00a0 <\/em><a href=\"https:\/\/www.youtube.com\/channel\/UC8WjHJcS5ZhN2uV4de4o6Jg\"><em><u>YouTube<\/u><\/em><\/a><em>. \u0410 \u0442\u0430\u043a\u0436\u0435 \u0441\u043b\u0443\u0448\u0430\u0439 <\/em><a href=\"https:\/\/bit.ly\/dlya-tech-i-etich-podcast\"><em><u>\u043f\u043e\u0434\u043a\u0430\u0441\u0442 \u00ab\u0414\u043b\u044f tech \u0438 \u044d\u0442\u0438\u0445\u00bb<\/u><\/em><\/a><em> \u043e\u0442 \u043d\u0430\u0448\u0438\u0445 it-\u043c\u0435\u043d\u0435\u0434\u0436\u0435\u0440\u043e\u0432.<\/em><\/p>\n<\/blockquote>\n<\/div>\n<\/div>\n<\/div>\n<p><!----><!----><\/div>\n<p><!----><!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/articles\/773648\/\"> https:\/\/habr.com\/ru\/articles\/773648\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u041f\u0440\u0438\u0432\u0435\u0442! \u041c\u0435\u043d\u044f \u0437\u043e\u0432\u0443\u0442 \u0410\u043d\u0442\u043e\u043d \u0416\u0443\u043a\u043e\u0432, \u044f \u0440\u0443\u043a\u043e\u0432\u043e\u0436\u0443 \u0433\u0440\u0443\u043f\u043f\u043e\u0439 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0432 \u0421\u0431\u0435\u0440\u043c\u0430\u0440\u043a\u0435\u0442\u0435. \u0412 \u043f\u0440\u043e\u0444\u0435\u0441\u0441\u0438\u0438 \u044f \u0443\u0436\u0435 \u0431\u043e\u043b\u0435\u0435 12 \u043b\u0435\u0442, \u0441 Golang \u0440\u0430\u0431\u043e\u0442\u0430\u044e \u0441 2016 \u0433\u043e\u0434\u0430, \u0430 \u0441 Kubernetes \u2014 \u0441 2018 \u0433\u043e\u0434\u0430. <\/p>\n<p>\u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0443 \u043e\u0431 \u043e\u0441\u043d\u043e\u0432\u0430\u0445 Kubernetes, \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u0445 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430\u0445 \u0438 \u0440\u0435\u0448\u0435\u043d\u0438\u044f\u0445, \u0430 \u0442\u0430\u043a\u0436\u0435 \u043e\u00a0\u0442\u043e\u043c, \u043a\u0430\u043a <strong>\u0433\u0440\u0430\u043c\u043e\u0442\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0440\u0435\u0441\u0443\u0440\u0441\u044b \u044d\u0442\u043e\u0439 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u044b<\/strong>, \u0447\u0442\u043e\u0431\u044b \u0432\u044b\u0436\u0430\u0442\u044c \u043c\u0430\u043a\u0441\u0438\u043c\u0443\u043c \u0438\u0437 Go-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439. \u041a\u0440\u043e\u043c\u0435 \u0442\u043e\u0433\u043e, \u0432 \u043a\u043e\u043d\u0446\u0435 \u0441\u0442\u0430\u0442\u044c\u0438 \u044f \u043e\u043f\u0438\u0448\u0443 \u043a\u0435\u0439\u0441 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 GOMAXPROCS \u043d\u0430 \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u043d\u0430\u0448\u0435\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0438 \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0443, \u043a\u0430\u043a \u043d\u0430\u043c \u0443\u0434\u0430\u043b\u043e\u0441\u044c \u043f\u043e\u0432\u044b\u0441\u0438\u0442\u044c \u0435\u0433\u043e \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u043d\u0430 20-50%.<\/p>\n<p><a href=\"#issues\">\u041f\u0440\u043e\u0431\u043b\u0435\u043c\u044b \u0438 \u0432\u044b\u0437\u043e\u0432\u044b Kubernetes<\/a><\/p>\n<p><a href=\"#kuber\">\u041f\u043e\u0434 \u043a\u0430\u043f\u043e\u0442\u043e\u043c Kubernetes:<\/a><\/p>\n<ul>\n<li>\n<p><a href=\"#cfc\">CFS (Completely Fair Scheduler)<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"#go\">Goroutines<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"#cgroups\">Cgroups<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"#requests\">Requests &amp; Limits \u0432 Kubernetes<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"#CFS_Bandwidth_Control\">CFS Bandwidth Control<\/a><\/p>\n<\/li>\n<\/ul>\n<p><a href=\"#sbm\">\u041d\u0430\u0448 \u043e\u043f\u044b\u0442 Go-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439 \u0432 \u0431\u043e\u043b\u044c\u0448\u0438\u0445 Kubernetes-\u043a\u043b\u0430\u0441\u0442\u0435\u0440\u0430\u0445<\/a><\/p>\n<p><a href=\"#ex\">\u041f\u0440\u0438\u043c\u0435\u0440 \u0440\u0430\u0431\u043e\u0442\u044b \u0441 GOMAXPROCS \u0438\u0437 \u043e\u043f\u044b\u0442\u0430 \u0421\u0431\u0435\u0440\u041c\u0430\u0440\u043a\u0435\u0442\u0430<\/a><\/p>\n<p><a href=\"#rec\">\u0420\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0430\u0446\u0438\u0438 \u043f\u043e \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0438 \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0432 Kubernetes \u0434\u043b\u044f Go-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439<\/a><\/p>\n<figure class=\"full-width\"><\/figure>\n<p><a class=\"anchor\" name=\"issues\" id=\"issues\"><\/a><\/p>\n<h2>\u0427\u0442\u043e \u043c\u044b \u0437\u043d\u0430\u0435\u043c \u043f\u0440\u043e Kubernetes?<\/h2>\n<p>Kubernetes \u2014 \u043e\u0442\u043b\u0438\u0447\u043d\u044b\u0439 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 <strong>\u0441\u043e\u0437\u0434\u0430\u0435\u0442 \u0430\u0431\u0441\u0442\u0440\u0430\u043a\u0446\u0438\u044e \u043d\u0430\u0434 \u0444\u0438\u0437\u0438\u0447\u0435\u0441\u043a\u0438\u043c\u0438 \u0438 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u043c\u0438 \u043c\u0430\u0448\u0438\u043d\u0430\u043c\u0438<\/strong>. \u041e\u043d \u043f\u043e\u043c\u043e\u0433\u0430\u0435\u0442 \u043d\u0430\u043c \u043d\u0435 \u0434\u0443\u043c\u0430\u0442\u044c \u043e \u0442\u043e\u043c, \u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0443 \u043d\u0430\u0441 \u0437\u0430\u043f\u0443\u0449\u0435\u043d\u043e \u043c\u0430\u0448\u0438\u043d \u0438 \u043a\u0430\u043a\u0438\u0435 \u0440\u0435\u0441\u0443\u0440\u0441\u044b \u043a\u0430\u043a\u043e\u0439 \u043c\u0430\u0448\u0438\u043d\u044b \u0437\u0430\u0434\u0435\u0439\u0441\u0442\u0432\u043e\u0432\u0430\u043d\u044b. \u0415\u0441\u0442\u044c \u043f\u0440\u043e\u0441\u0442\u043e \u0441\u043e\u0432\u043e\u043a\u0443\u043f\u043d\u0430\u044f \u043c\u043e\u0449\u043d\u043e\u0441\u0442\u044c, \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043f\u043e\u0434 \u043d\u0430\u0448\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435.\u00a0<\/p>\n<p>\u0412\u044b\u043a\u0430\u0442\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0431\u0443\u043a\u0432\u0430\u043b\u044c\u043d\u043e \u043e\u0434\u043d\u043e\u0439 \u043a\u043e\u043c\u0430\u043d\u0434\u043e\u0439 <code>kubectl apply<\/code>, \u0447\u0442\u043e \u043e\u0447\u0435\u043d\u044c \u0443\u0434\u043e\u0431\u043d\u043e. \u041f\u043b\u044e\u0441, \u043c\u043e\u0436\u043d\u043e \u043c\u0430\u0441\u0448\u0442\u0430\u0431\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043a\u0430\u043a \u0438\u043d\u0434\u0438\u0432\u0438\u0434\u0443\u0430\u043b\u044c\u043d\u043e\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u2014 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e HPA (Horizontal Pod Autoscaling), \u0442\u0430\u043a \u0438 \u0441\u0430\u043c \u043a\u043b\u0430\u0441\u0442\u0435\u0440, \u2014 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e CA (Cluster Autoscaling), \u0443\u0432\u0435\u043b\u0438\u0447\u0438\u0432\u0430\u044f \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043d\u043e\u0434 \u043f\u043e \u043c\u0435\u0440\u0435 \u043f\u043e\u0442\u0440\u0435\u0431\u043d\u043e\u0441\u0442\u0438.<\/p>\n<p>\u0417\u0432\u0443\u0447\u0438\u0442 \u0432\u0441\u0435 \u044d\u0442\u043e \u043e\u0447\u0435\u043d\u044c \u043a\u0440\u0443\u0442\u043e, \u043d\u043e \u0438\u043d\u043e\u0433\u0434\u0430 Kubernetes \u2014 \u044d\u0442\u043e \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b \u0441 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c\u044e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f:<\/p>\n<ul>\n<li>\n<p>CPU Throttling \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439;\u00a0<\/p>\n<\/li>\n<li>\n<p>\u0438\u043d\u043e\u0433\u0434\u0430 \u043f\u043e\u0434\u044b \u0432\u044b\u0441\u0435\u043b\u044f\u044e\u0442\u0441\u044f \u0441 \u043e\u0434\u043d\u043e\u0439 \u043d\u043e\u0434\u044b \u043d\u0430 \u0434\u0440\u0443\u0433\u0443\u044e;<\/p>\n<\/li>\n<li>\n<p>\u043f\u043e\u0440\u043e\u0439 \u043c\u044b \u0432\u0438\u0434\u0438\u043c \u0437\u0430\u0448\u043a\u0430\u043b\u0438\u0432\u0430\u044e\u0449\u0438\u0435 99 \u043f\u0435\u0440\u0441\u0435\u043d\u0442\u0438\u043b\u044c \u043f\u043e \u0434\u043b\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u043e\u0442\u0432\u0435\u0442\u0430 \u0438 \u0432\u0441\u043f\u043b\u0435\u0441\u043a\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u043c \u043d\u0435 \u043d\u0430\u0445\u043e\u0434\u0438\u043c \u043e\u0431\u044a\u044f\u0441\u043d\u0435\u043d\u0438\u044f.\u00a0<\/p>\n<\/li>\n<\/ul>\n<p>\u0410 \u0435\u0449\u0451 \u0441\u043b\u0443\u0447\u0430\u0435\u0442\u0441\u044f \u0440\u044f\u0434 \u043f\u0440\u043e\u0431\u043b\u0435\u043c \u0441 \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u043e\u043c:\u00a0<\/p>\n<ul>\n<li>\n<p>\u043d\u0435\u043f\u0440\u0435\u0434\u0441\u043a\u0430\u0437\u0443\u0435\u043c\u043e\u0435 \u043c\u0430\u0441\u0448\u0442\u0430\u0431\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u0430;<\/p>\n<\/li>\n<li>\n<p>\u0438\u043b\u0438, \u043d\u0430\u043e\u0431\u043e\u0440\u043e\u0442, \u0438\u0437 \u0436\u0438\u0432\u044b\u0445 \u043f\u0440\u0438\u043c\u0435\u0440\u043e\u0432, \u043a\u043e\u0433\u0434\u0430 \u043a\u043b\u0430\u0441\u0442\u0435\u0440 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 20-25% \u0438\u043c\u0435\u044e\u0449\u0438\u0445\u0441\u044f \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0432 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u0430 \u0438 \u043f\u0430\u043c\u044f\u0442\u0438 \u043d\u043e\u0434. \u0410 \u0437\u0430 \u043f\u0443\u0441\u0442\u0443\u044e\u0449\u0438\u0435 75-80% \u043c\u044b \u0432\u0441\u0435 \u0440\u0430\u0432\u043d\u043e \u043f\u043b\u0430\u0442\u0438\u043c.<\/p>\n<\/li>\n<\/ul>\n<p>\u0427\u0442\u043e \u0436\u0435 \u0441\u043e \u0432\u0441\u0435\u043c \u044d\u0442\u0438\u043c \u0434\u0435\u043b\u0430\u0442\u044c?<\/p>\n<p>\u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0440\u0430\u0437\u0431\u0435\u0440\u0435\u043c\u0441\u044f, \u043a\u0430\u043a Kubernetes \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442 \u0440\u0435\u0441\u0443\u0440\u0441\u0430\u043c\u0438 \u0447\u0435\u0440\u0435\u0437 Requests &amp; Limits, \u0438 \u043a\u0430\u043a \u0442\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u044b \u0432\u044b\u0441\u0442\u0430\u0432\u0438\u043c, \u0431\u0443\u0434\u0443\u0442 \u0432\u043b\u0438\u044f\u0442\u044c \u043d\u0430 \u0443\u0442\u0438\u043b\u0438\u0437\u0430\u0446\u0438\u044e \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0432. \u0410 \u0432 \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u0435 \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0443, \u043a\u0430\u043a \u043c\u044b \u0442\u044e\u043d\u0438\u043b\u0438 \u043d\u0430\u0448\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0432 \u0421\u0431\u0435\u0440\u043c\u0430\u0440\u043a\u0435\u0442\u0435 \u0438 \u0432 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u0443\u043b\u0443\u0447\u0448\u0438\u043b\u0438 99 percentile \u0434\u043b\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u043e\u0442\u0432\u0435\u0442\u0430 gRPC-\u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u043d\u0430 20%, CPU Usage \u043d\u0430 33% \u0438 \u0434\u043b\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c Go&#8217;s Garbage Collection \u043d\u0430 50%.<\/p>\n<p><a class=\"anchor\" name=\"kuber\" id=\"kuber\"><\/a><\/p>\n<h2>\u041f\u043e\u0433\u043e\u0432\u043e\u0440\u0438\u043c \u043f\u0440\u043e \u043e\u0441\u043d\u043e\u0432\u044b Kubernetes<\/h2>\n<p>\u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0443 \u043e\u0431 \u043e\u0441\u043d\u043e\u0432\u0430\u0445, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e Kubernetes \u2014 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u0430\u044f \u0441\u0438\u0441\u0442\u0435\u043c\u0430, \u0430 \u0432\u043d\u0443\u0442\u0440\u0438 \u044d\u0442\u043e\u0439 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u0435\u0441\u0442\u044c \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0435 \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u043e\u043c\u043e\u0433\u0430\u044e\u0442 \u043f\u043e\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u043a\u043b\u0430\u0441\u0442\u0435\u0440. \u0417\u043d\u0430\u043d\u0438\u0435 \u044d\u0442\u0438\u0445 \u043e\u0441\u043d\u043e\u0432 \u043f\u043e\u043c\u043e\u0436\u0435\u0442 \u043b\u0443\u0447\u0448\u0435 \u043f\u043e\u043d\u044f\u0442\u044c, \u0447\u0442\u043e \u0442\u0430\u043a\u043e\u0435 Requests \u0438 Limits \u0438 \u043a\u0430\u043a \u043e\u043d\u0438 \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u044e\u0442\u0441\u044f \u043d\u0430 \u0443\u0440\u043e\u0432\u043d\u0435 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u2014\u00a0 \u0432 \u043d\u0430\u0448\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043d\u0430 \u0443\u0440\u043e\u0432\u043d\u0435 Linux. \u041d\u0430\u0447\u043d\u0435\u043c \u0441 CFS.\u00a0<\/p>\n<p>\u0415\u0441\u043b\u0438 \u0432\u044b \u0445\u043e\u0440\u043e\u0448\u043e \u0437\u043d\u0430\u0435\u0442\u0435 \u0442\u0435\u043e\u0440\u0438\u044e \u0438 \u0445\u043e\u0442\u0438\u0442\u0435 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u043d\u0430 \u043d\u0430\u0448 \u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u043e\u043f\u044b\u0442, \u043c\u043e\u0436\u043d\u043e \u0441\u0440\u0430\u0437\u0443 <a href=\"#sbm\">\u043f\u0435\u0440\u0435\u0441\u043a\u043e\u0447\u0438\u0442\u044c \u043d\u0430 \u044d\u0442\u043e\u0442 \u0440\u0430\u0437\u0434\u0435\u043b<\/a>.<\/p>\n<p><a class=\"anchor\" name=\"cfc\" id=\"cfc\"><\/a><\/p>\n<h3>CFS (Completely Fair Scheduler)<\/h3>\n<p>\u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u0438\u043c \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u044e, \u0447\u0442\u043e \u0443 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440 \u0441 \u043e\u0434\u043d\u0438\u043c \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u043e\u043c, \u043a\u0430\u043a \u044d\u0442\u043e \u0431\u044b\u043b\u043e \u043a\u043e\u0433\u0434\u0430-\u0442\u043e \u0432 \u043f\u0440\u043e\u0448\u043b\u043e\u043c. \u0418 \u044d\u0442\u043e\u0442 \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440 \u0438\u0441\u043f\u043e\u043b\u043d\u044f\u0435\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0434\u043d\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0432 \u043e\u0434\u0438\u043d \u043c\u043e\u043c\u0435\u043d\u0442 \u0432\u0440\u0435\u043c\u0435\u043d\u0438. \u0414\u043e\u043f\u0443\u0441\u0442\u0438\u043c, \u0432\u044b \u043e\u0442\u043a\u0440\u044b\u0432\u0430\u0435\u0442\u0435 \u0447\u0430\u0442\u0438\u043a, \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u0442\u0435 \u0447\u0442\u043e-\u0442\u043e \u043f\u0438\u0441\u0430\u0442\u044c \u0438 \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u043e\u0441\u043b\u0435 \u0442\u043e\u0433\u043e, \u043a\u0430\u043a \u0432\u044b \u043d\u0430\u043f\u0438\u0441\u0430\u043b\u0438, \u0443 \u0432\u0430\u0441 \u0437\u0430\u0433\u0440\u0443\u0436\u0430\u0435\u0442\u0441\u044f \u043f\u0435\u0440\u0435\u043f\u0438\u0441\u043a\u0430 \u0441 \u0434\u0440\u0443\u0433\u043e\u043c. \u0418\u043b\u0438, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0447\u0430\u0441\u044b \u0442\u0438\u043a\u0430\u044e\u0442 \u0438 \u0437\u0430\u043d\u0438\u043c\u0430\u044e\u0442 \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u0432\u0441\u0435 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u043d\u043e\u0435 \u0432\u0440\u0435\u043c\u044f. <\/p>\n<p>\u041f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0442\u0430\u043a\u043e\u0435, \u043a\u043e\u043d\u0435\u0447\u043d\u043e, \u043e\u0447\u0435\u043d\u044c \u0441\u043b\u043e\u0436\u043d\u043e. \u0421\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u044b \u2014 \u044d\u0442\u043e \u0432\u0441\u0435\u0433\u0434\u0430 \u043c\u043d\u043e\u0433\u043e\u0437\u0430\u0434\u0430\u0447\u043d\u043e\u0441\u0442\u044c, \u043c\u043d\u043e\u0433\u043e\u043f\u043e\u0442\u043e\u0447\u043d\u043e\u0441\u0442\u044c. \u0418 <strong>CFS (Completely Fair Scheduler)<\/strong> \u2014 \u044d\u0442\u043e \u043a\u0430\u043a \u0440\u0430\u0437 \u0442\u043e\u0442 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u0435\u0442 \u043c\u043d\u043e\u0433\u043e\u0437\u0430\u0434\u0430\u0447\u043d\u043e\u0441\u0442\u044c \u0432 \u0440\u0430\u043c\u043a\u0430\u0445 \u043e\u0434\u043d\u043e\u0433\u043e \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u0430, (\u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u043e\u0434\u0438\u043d \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440 \u0432\u0441\u0435\u0433\u0434\u0430 \u043c\u043e\u0436\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u043d\u044f\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0434\u043d\u0443 \u0437\u0430\u0434\u0430\u0447\u0443 \u0432 \u043e\u0434\u0438\u043d \u043c\u043e\u043c\u0435\u043d\u0442 \u0432\u0440\u0435\u043c\u0435\u043d\u0438).<\/p>\n<p>CFS \u0438\u0434\u0435\u0430\u043b\u044c\u043d\u043e \u0442\u043e\u0447\u043d\u043e \u043c\u043e\u0434\u0435\u043b\u0438\u0440\u0443\u0435\u0442 \u043c\u043d\u043e\u0433\u043e\u0437\u0430\u0434\u0430\u0447\u043d\u043e\u0441\u0442\u044c \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u0430. \u041e\u043d \u043c\u043e\u0436\u0435\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c \u0432\u0441\u0435 \u0437\u0430\u0434\u0430\u0447\u0438 \u0441 \u0440\u0430\u0432\u043d\u043e\u0439 \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u044c\u044e.\u00a0<\/p>\n<p>\u041d\u0438\u0436\u0435 \u043d\u0430 \u0441\u0445\u0435\u043c\u0435 \u2014 \u0448\u043a\u0430\u043b\u0430 \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0438 \u0434\u0432\u0430 \u043f\u0440\u0438\u043c\u0435\u0440\u0430 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u0437\u0430\u0434\u0430\u0447. \u041f\u0435\u0440\u0432\u044b\u0439 \u043f\u0440\u0438\u043c\u0435\u0440 \u2014 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u0434\u0432\u0443\u0445 \u0437\u0430\u0434\u0430\u0447, \u0432\u0442\u043e\u0440\u043e\u0439 \u2014 \u0447\u0435\u0442\u044b\u0440\u0435\u0445. \u041c\u044b \u0432\u0438\u0434\u0438\u043c, \u0447\u0442\u043e \u0432 \u043e\u0431\u043e\u0438\u0445 \u0441\u043b\u0443\u0447\u0430\u044f\u0445 \u0432\u044b\u0434\u0435\u043b\u0435\u043d \u0440\u0430\u0432\u043d\u044b\u0439 \u043e\u0442\u0440\u0435\u0437\u043e\u043a \u043f\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438, \u0438 \u0437\u0430\u0434\u0430\u0447\u0438 \u0440\u0430\u0432\u043d\u043e\u043c\u0435\u0440\u043d\u043e \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u044b \u043f\u043e \u0448\u043a\u0430\u043b\u0435 \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0438 \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0442 \u043e\u0434\u043d\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e. \u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u043e\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043c\u043d\u043e\u0433\u043e\u0437\u0430\u0434\u0430\u0447\u043d\u043e\u0441\u0442\u044c, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0433\u043b\u0430\u0437\u0443 \u043d\u0435 \u0432\u0438\u0434\u043d\u0430, \u043d\u043e \u0435\u0441\u0442\u044c \u043d\u0430 \u0443\u0440\u043e\u0432\u043d\u0435 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u0430 \u0437\u0430 \u0441\u0447\u0435\u0442 \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c\u0430 CFS.<\/p>\n<figure class=\"full-width\">\n<div><figcaption><em>CFS \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u0435\u0442 \u043e\u0434\u043d\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e \u043c\u043d\u043e\u0433\u043e\u0437\u0430\u0434\u0430\u0447\u043d\u043e\u0441\u0442\u044c \u0432 \u0440\u0430\u043c\u043a\u0430\u0445 \u043e\u0434\u043d\u043e\u0433\u043e \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u0430<\/em><\/figcaption><\/div>\n<\/figure>\n<p>\u0427\u0442\u043e\u0431\u044b \u043e\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043b\u044f\u0442\u044c \u043c\u043d\u043e\u0433\u043e\u0437\u0430\u0434\u0430\u0447\u043d\u043e\u0441\u0442\u044c, CFS \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u0431\u0438\u043d\u0430\u0440\u043d\u043e\u0435 \u0434\u0435\u0440\u0435\u0432\u043e, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0443\u043f\u043e\u0440\u044f\u0434\u043e\u0447\u0435\u043d\u043e \u043f\u043e virtual runtime. <strong>Virtual runtime<\/strong> \u2014 \u044d\u0442\u043e \u0432\u0440\u0435\u043c\u044f, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0443\u0436\u0435 \u0431\u044b\u043b\u043e \u0437\u0430\u0442\u0440\u0430\u0447\u0435\u043d\u043e \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u043e\u043c \u043d\u0430 \u0438\u0441\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u0434\u0430\u043d\u043d\u043e\u0439 \u0437\u0430\u0434\u0430\u0447\u0438. \u041d\u0430 \u0441\u0445\u0435\u043c\u0435 \u043d\u0438\u0436\u0435 \u0432 \u043b\u0435\u0432\u043e\u0439 \u0447\u0430\u0441\u0442\u0438 \u0434\u0435\u0440\u0435\u0432\u0430 \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0430 \u0437\u0430\u0434\u0430\u0447\u0430 \u0441 \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u043c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e\u043c virtual runtime, \u0432 \u043f\u0440\u0430\u0432\u043e\u0439 \u2014 \u0441 \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u043c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e\u043c virtual runtime. <\/p>\n<figure class=\"full-width\">\n<div><figcaption><em>\u041a\u0430\u043a \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u0430 \u043c\u043d\u043e\u0433\u043e\u0437\u0430\u0434\u0430\u0447\u043d\u043e\u0441\u0442\u044c \u0432 CFS<\/em><\/figcaption><\/div>\n<\/figure>\n<p>CFS \u0431\u0435\u0440\u0435\u0442 \u0437\u0430\u0434\u0430\u0447\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0431\u044b\u043b\u0438 \u0438\u0441\u043f\u043e\u043b\u043d\u0435\u043d\u044b \u043d\u0430 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u0435\u00a0 \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438, \u0432\u044b\u0442\u0430\u0441\u043a\u0438\u0432\u0430\u0435\u0442 \u0438\u0445 \u0438\u0437 \u043b\u0435\u0432\u043e\u0439 \u0447\u0430\u0441\u0442\u0438 \u0434\u0435\u0440\u0435\u0432\u0430, \u0438\u0441\u043f\u043e\u043b\u043d\u044f\u0435\u0442 \u043d\u0430 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u0435 \u0438 \u043f\u043e\u0442\u043e\u043c \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0432 \u043f\u0440\u0430\u0432\u0443\u044e \u0447\u0430\u0441\u0442\u044c \u0434\u0435\u0440\u0435\u0432\u0430. \u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0434\u0432\u0438\u0436\u0435\u043d\u0438\u0435 \u0437\u0430\u0434\u0430\u0447 \u043f\u043e \u0434\u0435\u0440\u0435\u0432\u0443 \u0438 \u0440\u0430\u0432\u043d\u043e\u043c\u0435\u0440\u043d\u043e\u0435 \u043f\u043e \u0434\u043b\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u0438\u0441\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u043a\u0430\u0436\u0434\u043e\u0439 \u0437\u0430\u0434\u0430\u0447\u0438.<\/p>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043f\u043e\u043f\u0440\u043e\u0431\u0443\u0435\u043c \u043d\u0430\u0440\u0438\u0441\u043e\u0432\u0430\u0442\u044c \u043e\u0431\u0449\u0443\u044e \u043a\u0430\u0440\u0442\u0438\u043d\u0443, \u043a\u0430\u043a CFS \u0438\u0441\u043f\u043e\u043b\u043d\u044f\u0435\u0442 \u043d\u0430\u0448\u0438 \u0437\u0430\u0434\u0430\u0447\u0438 \u0432 \u0440\u0430\u043c\u043a\u0430\u0445 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043d\u0430 Go. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043d\u0430\u043f\u043e\u043c\u043d\u044e, \u043a\u0430\u043a \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0442 Goroutines.<\/p>\n<p><a class=\"anchor\" name=\"go\" id=\"go\"><\/a><\/p>\n<h2>Goroutines<\/h2>\n<p>\u041a\u0430\u0436\u0434\u044b\u0439 \u0440\u0430\u0437, \u043a\u043e\u0433\u0434\u0430 \u0432\u044b \u043f\u0438\u0448\u0435\u0442\u0435 <code>go fun\u0441()<\/code> \u0441 \u0432\u0430\u0448\u0438\u043c \u043a\u043e\u0434\u043e\u043c \u0432\u043d\u0443\u0442\u0440\u0438, \u0432\u0430\u0448\u0430 Goroutine \u043f\u043e\u043f\u0430\u0434\u0430\u0435\u0442 \u0432 \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u0443\u044e \u043e\u0447\u0435\u0440\u0435\u0434\u044c. \u041a\u0430\u043a \u043c\u044b \u0437\u043d\u0430\u0435\u043c, \u0432 Go \u0435\u0441\u0442\u044c \u043f\u043b\u0430\u043d\u0438\u0440\u043e\u0432\u0449\u0438\u043a (Go scheduler), \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0437\u0430\u043d\u0438\u043c\u0430\u0435\u0442\u0441\u044f \u0442\u0435\u043c, \u0447\u0442\u043e \u0440\u0430\u0441\u0442\u0430\u0441\u043a\u0438\u0432\u0430\u0435\u0442 \u0432\u0430\u0448\u0438 Goroutines \u0438\u0437 \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u043e\u0439 \u043e\u0447\u0435\u0440\u0435\u0434\u0438 \u0432 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u044b\u0435 \u043e\u0447\u0435\u0440\u0435\u0434\u0438 \u043f\u043e \u043a\u0430\u0436\u0434\u043e\u043c\u0443 \u0442\u0440\u0435\u0434\u0443 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u044b.\u00a0<\/p>\n<p>\u041d\u0430 \u0441\u0445\u0435\u043c\u0435 \u043d\u0438\u0436\u0435 \u2014 \u043f\u0440\u0438\u043c\u0435\u0440 \u0441 \u0434\u0432\u0443\u043c\u044f \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u0430\u043c\u0438, \u043d\u0430 \u043a\u0430\u0436\u0434\u043e\u043c \u0438\u0437 \u043d\u0438\u0445 \u0435\u0441\u0442\u044c \u0434\u0432\u0430 \u0430\u043a\u0442\u0438\u0432\u043d\u044b\u0445 \u0442\u0440\u0435\u0434\u0430. \u0422\u0430\u043a\u0436\u0435 \u0432\u0438\u0434\u0438\u043c, \u0447\u0442\u043e \u0435\u0441\u0442\u044c \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u044b\u0435 \u043e\u0447\u0435\u0440\u0435\u0434\u0438. \u0417\u0430\u0434\u0430\u0447\u0430 \u043f\u043b\u0430\u043d\u0438\u0440\u043e\u0432\u0449\u0438\u043a\u0430 \u2014 \u0440\u0430\u0432\u043d\u043e\u043c\u0435\u0440\u043d\u043e \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0442\u044c Goroutines \u043c\u0435\u0436\u0434\u0443 \u044d\u0442\u0438\u043c\u0438 \u0430\u043a\u0442\u0438\u0432\u043d\u044b\u043c\u0438 \u0442\u0440\u0435\u0434\u0430\u043c\u0438. \u0421\u0435\u0440\u044b\u0435 \u00ab\u041c\u00bb \u2014 \u044d\u0442\u043e \u0437\u0430\u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u0442\u0440\u0435\u0434\u044b \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0430 \u0434\u0430\u043d\u043d\u044b\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 \u0430\u043a\u0442\u0438\u0432\u043d\u043e \u043d\u0435 \u0443\u0447\u0430\u0441\u0442\u0432\u0443\u044e\u0442 \u0432 \u0440\u0430\u0431\u043e\u0442\u0435 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u0430.\u00a0<\/p>\n<figure class=\"full-width\">\n<div><figcaption><em>\u041f\u043b\u0430\u043d\u0438\u0440\u043e\u0432\u0449\u0438\u043a Go scheduler<\/em><\/figcaption><\/div>\n<\/figure>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c, \u043a\u0430\u043a \u0432\u0441\u0435 \u044d\u0442\u043e \u0441\u0432\u044f\u0437\u0430\u043d\u043e. \u041d\u0430 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439 \u0441\u0445\u0435\u043c\u0435<em> <\/em>\u043f\u043e\u043a\u0430\u0437\u0430\u043d \u0443\u0440\u043e\u0432\u0435\u043d\u044c \u0430\u0431\u0441\u0442\u0440\u0430\u043a\u0446\u0438\u0438 \u0441\u0432\u0435\u0440\u0445\u0443 \u0432\u043d\u0438\u0437. \u0423 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c Goroutines, \u0435\u0441\u0442\u044c \u043f\u043b\u0430\u043d\u0438\u0440\u043e\u0432\u0449\u0438\u043a. \u041f\u043b\u0430\u043d\u0438\u0440\u043e\u0432\u0449\u0438\u043a \u043f\u0440\u0438\u0437\u0435\u043c\u043b\u044f\u0435\u0442 \u043d\u0430\u0448\u0438 Goroutines \u043d\u0430 \u043f\u043e\u0442\u043e\u043a\u0438. CFS, \u0432 \u0441\u0432\u043e\u044e \u043e\u0447\u0435\u0440\u0435\u0434\u044c, \u043f\u0440\u0438\u0437\u0435\u043c\u043b\u044f\u0435\u0442 \u0442\u0440\u0435\u0434\u044b \u043d\u0430 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u044b. \u0412\u043e\u0442, \u043a\u0430\u043a \u0432 \u043a\u043e\u043d\u0435\u0447\u043d\u043e\u043c \u0438\u0442\u043e\u0433\u0435 Goroutines \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u043e\u043c. <\/p>\n<figure class=\"full-width\">\n<div><figcaption><em>\u0418\u0441\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 Goroutines<\/em><\/figcaption><\/div>\n<\/figure>\n<p>\u0410 \u0447\u0442\u043e \u0435\u0441\u043b\u0438 \u043c\u044b \u043d\u0435 \u0445\u043e\u0442\u0438\u043c, \u0447\u0442\u043e\u0431\u044b \u0432\u0441\u0435 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u044b \u0432 \u043d\u0430\u0448\u0435\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u0435 \u0438\u043c\u0435\u043b\u0438 \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u044b\u0439 \u043f\u0440\u0438\u043e\u0440\u0438\u0442\u0435\u0442? \u0414\u043b\u044f \u0442\u0430\u043a\u0438\u0445 \u0441\u043b\u0443\u0447\u0430\u0435\u0432 \u0431\u044b\u043b \u043f\u0440\u0438\u0434\u0443\u043c\u0430\u043d \u043f\u0440\u0435\u043a\u0440\u0430\u0441\u043d\u044b\u0439 \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c \u043f\u043e\u0434 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435\u043c Cgroups.<\/p>\n<p><a class=\"anchor\" name=\"cgroups\" id=\"cgroups\"><\/a><\/p>\n<h2>Cgroups<\/h2>\n<p>Cgroups \u2014 \u044d\u0442\u043e \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c \u0434\u043b\u044f \u043e\u0440\u0433\u0430\u043d\u0438\u0437\u0430\u0446\u0438\u0438 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0432 \u0432 \u0438\u0435\u0440\u0430\u0440\u0445\u0438\u044e \u0438 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u0438\u0440\u0443\u0435\u043c\u043e\u0433\u043e \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0432 \u043f\u043e \u044d\u0442\u043e\u0439 \u0438\u0435\u0440\u0430\u0440\u0445\u0438\u0438 \u0432 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u0438 \u0441 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0435\u0439. \u042d\u0442\u0430 \u0438\u0435\u0440\u0430\u0440\u0445\u0438\u044f \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0438\u0437 \u0441\u0435\u0431\u044f \u0434\u0435\u0440\u0435\u0432\u043e. \u0412 \u043d\u0451\u043c \u0432 \u043a\u0430\u0436\u0434\u043e\u0439 \u0433\u0440\u0443\u043f\u043f\u0435 \u0432\u044b\u0434\u0435\u043b\u044f\u0435\u0442\u0441\u044f \u043a\u0430\u043a\u043e\u0435-\u0442\u043e \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u043c\u0438 \u044d\u0442\u0430 \u0433\u0440\u0443\u043f\u043f\u0430 \u043c\u043e\u0436\u0435\u0442 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f. <\/p>\n<p>\u041c\u0435\u0445\u0430\u043d\u0438\u0437\u043c \u0421groups \u2014 \u044d\u0442\u043e \u043e\u0441\u043d\u043e\u0432\u0430 \u0434\u043b\u044f \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0438\u0437\u0430\u0446\u0438\u0438 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439 (docker, containerd \u0438 \u0442.\u0434.). \u0427\u0430\u0449\u0435 \u0432\u0441\u0435\u0433\u043e \u0432\u0441\u0435 \u043d\u0430\u0448\u0438 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u044b \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u044b \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 Cgroups. \u041f\u0430\u043c\u044f\u0442\u044c, \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440, \u0441\u0435\u0442\u044c \u0438 \u0434\u0438\u0441\u043a \u2014 \u044d\u0442\u043e \u043a\u0430\u043a \u0440\u0430\u0437 \u0442\u0435 \u0440\u0435\u0441\u0443\u0440\u0441\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0442\u044c \u043c\u0435\u0436\u0434\u0443 \u0433\u0440\u0443\u043f\u043f\u0430\u043c\u0438 \u0438 \u0447\u0435\u0442\u043a\u043e \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0432 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u043c\u0438 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430\u043c\u0438.<\/p>\n<figure class=\"full-width\">\n<div><figcaption><em>Control Groups (\u0421groups)<\/em><\/figcaption><\/div>\n<\/figure>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c, \u043e\u0437\u043d\u0430\u043a\u043e\u043c\u0438\u0432\u0448\u0438\u0441\u044c \u0441 \u043e\u0441\u043d\u043e\u0432\u043e\u0439, \u043f\u0435\u0440\u0435\u0439\u0434\u0435\u043c \u043a \u0431\u043e\u043b\u0435\u0435 \u0434\u0435\u0442\u0430\u043b\u044c\u043d\u043e\u043c\u0443 \u0440\u0430\u0437\u0431\u043e\u0440\u0443 Kubernetes, \u0432 \u0447\u0430\u0441\u0442\u043d\u043e\u0441\u0442\u0438, Requests &amp; Limits.<\/p>\n<p><a class=\"anchor\" name=\"requests\" id=\"requests\"><\/a><\/p>\n<h2>Requests &amp; Limits \u0432 Kubernetes<\/h2>\n<p>\u0418\u0442\u0430\u043a, \u0442\u0435\u043f\u0435\u0440\u044c \u0431\u043e\u043b\u0435\u0435 \u0434\u0435\u0442\u0430\u043b\u044c\u043d\u043e \u0440\u0430\u0437\u0431\u0435\u0440\u0435\u043c \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u043c\u0438 \u043c\u044b \u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u0441\u044f \u043a\u0430\u0436\u0434\u044b\u0439 \u0434\u0435\u043d\u044c.\u00a0<\/p>\n<h3>\u041a\u0430\u043a \u043f\u043e\u0434 \u0441\u043e\u0437\u0434\u0430\u0435\u0442\u0441\u044f \u0432 \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u0435<\/h3>\n<p>\u0423 \u043a\u0430\u0436\u0434\u043e\u0439 \u043d\u043e\u0434\u044b \u0432 \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u0435 \u0435\u0441\u0442\u044c Capacity \u043f\u043e \u043a\u0430\u0436\u0434\u043e\u043c\u0443 \u0442\u0438\u043f\u0443 \u0440\u0435\u0441\u0443\u0440\u0441\u0430 \u2014 CPU, \u043f\u0430\u043c\u044f\u0442\u044c. \u041f\u043b\u0430\u043d\u0438\u0440\u043e\u0432\u0449\u0438\u043a \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442 \u043f\u043e\u0434 \u043d\u0430 \u043d\u043e\u0434\u0435 \u0438 \u0432\u044b\u0447\u0438\u0442\u0430\u0435\u0442 Requests \u044d\u0442\u043e\u0433\u043e \u043f\u043e\u0434\u0430 \u0438\u0437 \u043e\u0431\u0449\u0435\u0439 Capacity \u043d\u043e\u0434\u044b. \u0423 \u043d\u043e\u0434\u044b \u0432\u0441\u0435\u0433\u0434\u0430 \u0435\u0441\u0442\u044c \u043a\u0430\u043a\u0430\u044f-\u0442\u043e \u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u0430\u044f Capacity.\u00a0<\/p>\n<p>\u0412\u0430\u0436\u043d\u043e \u043f\u043e\u043d\u0438\u043c\u0430\u0442\u044c, \u0447\u0442\u043e \u043f\u043b\u0430\u043d\u0438\u0440\u043e\u0432\u0449\u0438\u043a \u043d\u0435 \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0437\u043c\u0435\u0449\u0430\u0442\u044c \u043f\u043e\u0434 \u0441 Requests, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u0440\u0435\u0432\u044b\u0448\u0430\u044e\u0442 \u044d\u0442\u043e\u0442 \u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u044b\u0439 Capacity \u043d\u0430 \u043d\u043e\u0434\u0435. \u0421\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e, \u0435\u0441\u043b\u0438 Capacity \u043d\u0430 \u043e\u0434\u043d\u043e\u0439 \u043d\u043e\u0434\u0435 \u043d\u0435 \u0445\u0432\u0430\u0442\u0430\u0435\u0442, \u0437\u043d\u0430\u0447\u0438\u0442 \u043f\u043b\u0430\u043d\u0438\u0440\u043e\u0432\u0449\u0438\u043a \u043f\u043e\u0439\u0434\u0435\u0442 \u043d\u0430 \u0434\u0440\u0443\u0433\u0443\u044e \u043d\u043e\u0434\u0443. \u0415\u0441\u043b\u0438 \u0441\u0432\u043e\u0431\u043e\u0434\u043d\u044b\u0445 \u043d\u043e\u0434 \u043d\u0435 \u043d\u0430\u0439\u0434\u0435\u043d\u043e, \u0442\u043e\u0433\u0434\u0430 \u043f\u043b\u0430\u043d\u0438\u0440\u043e\u0432\u0449\u0438\u043a \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c\u0430 Cluster autoscaling \u0441\u043e\u0437\u0434\u0430\u0441\u0442 \u043d\u043e\u0432\u0443\u044e \u043d\u043e\u0434\u0443 \u0438 \u0442\u0430\u043c \u0440\u0430\u0437\u043c\u0435\u0441\u0442\u0438\u0442 \u043f\u043e\u0434.<\/p>\n<h3>CPU Requests<\/h3>\n<p>Requests &amp; Limits \u0438\u0437\u043c\u0435\u0440\u044f\u044e\u0442\u0441\u044f \u0432 CPU units \u0438\u043b\u0438 \u0432 millocores. 1 CPU = 1000 millocores. \u0422\u0430\u043a\u0430\u044f \u0430\u0431\u0441\u0442\u0440\u0430\u043a\u0446\u0438\u044f \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f \u0432 \u043b\u044e\u0431\u043e\u043c \u043e\u0431\u043b\u0430\u043a\u0435:<\/p>\n<ul>\n<li>\n<p>1 AWS vCPU;<\/p>\n<\/li>\n<li>\n<p>1 GCP Core;<\/p>\n<\/li>\n<li>\n<p>1 Azure vCore;<\/p>\n<\/li>\n<li>\n<p>1 Hyperthread on a bare-metal Intel processor with Hyperthreading.<\/p>\n<\/li>\n<\/ul>\n<p>CPU Requests \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u044e\u0442\u0441\u044f \u0434\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u043f\u0440\u0438\u043e\u0440\u0438\u0442\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u043d\u043e\u0435 \u0432\u0440\u0435\u043c\u044f \u043f\u0440\u0438 \u0441\u0442\u043e\u043f\u0440\u043e\u0446\u0435\u043d\u0442\u043d\u043e\u0439 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0435 \u043d\u043e\u0440\u043c\u044b. \u041f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u0438\u043c \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u044e, \u0447\u0442\u043e \u043d\u043e\u0434\u0430 \u0437\u0430\u0433\u0440\u0443\u0436\u0435\u043d\u0430 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u043e\u043c \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e, \u043d\u0430 \u0441\u0442\u043e \u043f\u0440\u043e\u0446\u0435\u043d\u0442\u043e\u0432, \u0438 \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u043f\u043e\u043d\u0438\u043c\u0430\u0442\u044c, \u043a\u0430\u043a\u043e\u043c\u0443 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0443 \u0432\u044b\u0434\u0435\u043b\u0438\u0442\u044c \u0431\u043e\u043b\u044c\u0448\u0435\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0432, \u0430 \u043a\u0430\u043a\u043e\u043c\u0443 \u2014 \u043c\u0435\u043d\u044c\u0448\u0435\u0435. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0435\u0441\u0442\u044c \u0442\u0435\u0445\u043d\u043e\u043b\u043e\u0433\u0438\u044f, \u0442\u043e\u0436\u0435 \u0438\u0437 Cgroups, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f CPU Shares.<\/p>\n<h3>CPU Shares<\/h3>\n<p>CPU Shares \u2014 \u044d\u0442\u043e \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c \u043f\u0440\u0438\u043e\u0440\u0438\u0442\u0435\u0437\u0430\u0446\u0438\u0438 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u043d\u043e\u0433\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0432 Cgroups. \u041a\u043e\u0433\u0434\u0430 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440 \u0437\u0430\u0433\u0440\u0443\u0436\u0435\u043d \u043d\u0430 100%, Cgroups \u043f\u043e\u043d\u0438\u043c\u0430\u0435\u0442, \u043a\u0430\u043a \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0445 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430\u043c \u0432\u0435\u0441\u043e\u0432 \u043e\u043d \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0442\u044c \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u043d\u043e\u0435 \u0432\u0440\u0435\u043c\u044f. \u042d\u0442\u043e \u0437\u043d\u0430\u0447\u0438\u0442, \u0447\u0442\u043e \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e CPU Requests \u043c\u043e\u0436\u043d\u043e \u0432\u044b\u0434\u0430\u0432\u0430\u0442\u044c \u043a\u0430\u043a\u0438\u043c-\u0442\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f\u043c \u0431\u043e\u043b\u044c\u0448\u0438\u0439 \u043f\u0440\u0438\u043e\u0440\u0438\u0442\u0435\u0442, \u0430 \u043a\u0430\u043a\u0438\u043c-\u0442\u043e \u2014 \u043c\u0435\u043d\u044c\u0448\u0438\u0439. \u041f\u0440\u0438 \u0441\u0442\u043e\u043f\u0440\u043e\u0446\u0435\u043d\u0442\u043d\u043e\u0439 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0435 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u0430 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u043d\u044f\u0442\u044c, \u043a\u043e\u043c\u0443 \u0432\u044b\u0434\u0435\u043b\u044f\u044e\u0442\u0441\u044f \u043a\u0430\u043a\u0438\u0435 \u043f\u0440\u043e\u043f\u043e\u0440\u0446\u0438\u0438 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u043d\u043e\u0433\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438. <\/p>\n<h3>Requests \u0438 \u0440\u0435\u0441\u0443\u0440\u0441\u044b \u043d\u043e\u0434\u044b<\/h3>\n<p>\u041a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0443 \u0433\u0430\u0440\u0430\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u044b \u0440\u0435\u0441\u0443\u0440\u0441\u044b, \u0437\u0430\u043f\u0440\u043e\u0448\u0435\u043d\u043d\u044b\u0435 \u0432 Requests. \u041d\u043e\u0434\u0430 \u043e\u0431\u0435\u0449\u0430\u0435\u0442 \u0432\u0430\u043c, \u0447\u0442\u043e \u0443 \u043d\u0435\u0435 \u0432\u0441\u0435\u0433\u0434\u0430 \u0431\u0443\u0434\u0443\u0442 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b \u0442\u0435 \u0440\u0435\u0441\u0443\u0440\u0441\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0432\u044b \u0437\u0430\u043f\u0440\u043e\u0441\u0438\u043b\u0438 \u0438\u0437\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e. \u0412 \u0442\u043e \u0436\u0435 \u0432\u0440\u0435\u043c\u044f, \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440 \u043c\u043e\u0436\u0435\u0442 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0438\u043b\u0438 \u043d\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0440\u0435\u0441\u0443\u0440\u0441\u044b \u0441\u0432\u0435\u0440\u0445 \u0437\u0430\u043f\u0440\u043e\u0448\u0435\u043d\u043d\u043e\u0433\u043e. \u0418 \u043f\u0440\u0438 \u0441\u0442\u043e\u043f\u0440\u043e\u0446\u0435\u043d\u0442\u043d\u043e\u0439 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0435 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u043d\u043e\u0435 \u0432\u0440\u0435\u043c\u044f \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0442\u044c\u0441\u044f \u043f\u0440\u043e\u043f\u043e\u0440\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u043e Requests.<\/p>\n<p><strong>\u0427\u0442\u043e, \u0435\u0441\u043b\u0438 \u043c\u044b \u0443\u043a\u0430\u0437\u0430\u043b\u0438 Requests, \u0430 \u0440\u0435\u0430\u043b\u044c\u043d\u043e\u0435 \u043f\u043e\u0442\u0440\u0435\u0431\u043b\u0435\u043d\u0438\u0435 \u043d\u0438\u0436\u0435 \u0432\u044b\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u043d\u044b\u0445 Requests?<\/strong> <\/p>\n<p>\u042d\u0442\u043e \u0437\u043d\u0430\u0447\u0438\u0442, \u0447\u0442\u043e CPU \u0438 \u043f\u0430\u043c\u044f\u0442\u044c \u043d\u0430 \u043d\u043e\u0434\u0435 \u043d\u0435 \u0431\u0443\u0434\u0443\u0442 \u0437\u0430\u043d\u044f\u0442\u044b \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u043e. \u0420\u0435\u0430\u043b\u044c\u043d\u043e\u0435 \u043f\u043e\u0442\u0440\u0435\u0431\u043b\u0435\u043d\u0438\u0435 \u043c\u0435\u043d\u044c\u0448\u0435, \u0430 \u043f\u043b\u0430\u0442\u0438\u043c \u043c\u044b \u0437\u0430 \u0432\u0435\u0441\u044c \u0440\u0435\u0441\u0443\u0440\u0441 \u043d\u043e\u0434\u044b \u0446\u0435\u043b\u0438\u043a\u043e\u043c. \u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c,\u00a0 \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0432 \u043d\u0430 \u043d\u043e\u0434\u0435 \u0438 \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u043f\u043b\u0430\u0442\u0438\u0442\u044c \u043b\u0438\u0448\u043d\u0438\u0435 \u0434\u0435\u043d\u044c\u0433\u0438 \u0437\u0430 \u043a\u043b\u0430\u0441\u0442\u0435\u0440. \u0421\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e, \u0434\u0435\u043d\u044c\u0433\u0438 \u0443\u0445\u043e\u0434\u044f\u0442 \u0432\u043f\u0443\u0441\u0442\u0443\u044e. <\/p>\n<p><strong>\u0427\u0442\u043e, \u0435\u0441\u043b\u0438 \u0440\u0435\u0430\u043b\u044c\u043d\u043e\u0435 \u043f\u043e\u0442\u0440\u0435\u0431\u043b\u0435\u043d\u0438\u0435 \u0432\u044b\u0448\u0435 \u0432\u044b\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u043d\u044b\u0445 Requests?<\/strong> <\/p>\n<p>\u0422\u0430\u043a\u0430\u044f \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u044f \u043c\u043e\u0436\u0435\u0442 \u043f\u0440\u0438\u0432\u0435\u0441\u0442\u0438 \u043a \u0437\u0430\u043c\u0435\u0434\u043b\u0435\u043d\u0438\u044e \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f. \u041d\u043e\u0434\u0430 \u043d\u0435 \u0431\u0443\u0434\u0435\u0442 \u0441\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c\u0441\u044f \u0441 \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u043e\u0439, \u0431\u0443\u0434\u0443\u0442 \u043f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u043e \u043f\u0435\u0440\u0435\u0441\u0435\u043b\u044f\u0442\u044c\u0441\u044f \u043f\u043e\u0434\u044b. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0434\u043e\u0441\u0442\u0438\u0433\u0430\u044e\u0442\u0441\u044f \u043f\u043e\u0440\u043e\u0433\u0438 \u043f\u0430\u043c\u044f\u0442\u0438 (MemoryPressure) \u0438 \u043d\u043e\u0434\u0430 \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u0442 \u0440\u0430\u0441\u0441\u0435\u043b\u044f\u0442\u044c \u043f\u043e\u0434\u044b \u043f\u043e \u0434\u0440\u0443\u0433\u0438\u043c \u043d\u043e\u0434\u0430\u043c. \u0412 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u043c\u043e\u0436\u0435\u0442 \u043f\u0440\u043e\u0438\u0437\u043e\u0439\u0442\u0438 \u043d\u0435\u043f\u0440\u0435\u0434\u0441\u043a\u0430\u0437\u0443\u0435\u043c\u043e\u0435 \u043c\u0430\u0441\u0448\u0442\u0430\u0431\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u0430 (Cluster Autoscaler). \u0412 \u0442\u0430\u043a\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043c\u044b \u043d\u0435 \u0437\u043d\u0430\u0435\u043c \u0442\u043e\u0447\u043d\u043e, \u043a\u043e\u0433\u0434\u0430 \u043a\u043b\u0430\u0441\u0442\u0435\u0440 \u043d\u0430\u0447\u043d\u0435\u0442 \u043c\u0430\u0441\u0448\u0442\u0430\u0431\u0438\u0440\u043e\u0432\u0430\u0442\u044c\u0441\u044f, \u043d\u0435 \u043c\u043e\u0436\u0435\u043c \u043f\u043b\u0430\u043d\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043d\u0430\u0448\u0438 \u0440\u0435\u0441\u0443\u0440\u0441\u044b \u0438 \u0437\u0430\u0442\u0440\u0430\u0442\u044b.\u00a0<\/p>\n<p><strong>\u0427\u0442\u043e, \u0435\u0441\u043b\u0438 \u0440\u0435\u0430\u043b\u044c\u043d\u043e\u0435 \u043f\u043e\u0442\u0440\u0435\u0431\u043b\u0435\u043d\u0438\u0435 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u0435\u0442 Requests?<\/strong><\/p>\n<p>\u042d\u0442\u043e \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442 \u0447\u0442\u043e CPU, \u043f\u0430\u043c\u044f\u0442\u044c<\/p>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-360044","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/360044","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=360044"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/360044\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=360044"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=360044"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=360044"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}