{"id":309311,"date":"2020-09-01T21:00:28","date_gmt":"2020-09-01T21:00:28","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=309311"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=309311","title":{"rendered":"\u0414\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u0430\u044f \u0431\u0430\u043b\u0430\u043d\u0441\u0438\u0440\u043e\u0432\u043a\u0430 \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u0432 pull-\u0441\u0445\u0435\u043c\u0435"},"content":{"rendered":"\n<div class=\"post__text post__text-html post__text_v1\" id=\"post-content-body\" data-io-article-url=\"https:\/\/habr.com\/ru\/company\/tensor\/blog\/517358\/\">\u0412 \u043f\u0440\u043e\u0448\u043b\u043e\u0439 \u043d\u043e\u0432\u043e\u0441\u0442\u0438 \u043f\u0440\u043e <a href=\"https:\/\/habr.com\/ru\/post\/516384\/\">\u043f\u0440\u0438\u043d\u0446\u0438\u043f\u044b \u0440\u0430\u0431\u043e\u0442\u044b \u043a\u043e\u043b\u043b\u0435\u043a\u0442\u043e\u0440\u043e\u0432 \u043b\u043e\u0433\u043e\u0432 PostgreSQL<\/a> \u044f \u0443\u043f\u043e\u043c\u044f\u043d\u0443\u043b, \u0447\u0442\u043e \u043e\u0434\u043d\u0438\u043c \u0438\u0437 \u043d\u0435\u0434\u043e\u0441\u0442\u0430\u0442\u043a\u043e\u0432 pull-\u043c\u043e\u0434\u0435\u043b\u0438 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f <b>\u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u044c \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u0431\u0430\u043b\u0430\u043d\u0441\u0438\u0440\u043e\u0432\u043a\u0438<\/b> \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u0438. \u041d\u043e \u0435\u0441\u043b\u0438 \u0434\u0435\u043b\u0430\u0442\u044c \u0435\u0435 \u0430\u043a\u043a\u0443\u0440\u0430\u0442\u043d\u043e, \u0442\u043e \u043d\u0435\u0434\u043e\u0441\u0442\u0430\u0442\u043e\u043a \u043f\u0440\u0435\u0432\u0440\u0430\u0449\u0430\u0435\u0442\u0441\u044f \u0432 \u0434\u043e\u0441\u0442\u043e\u0438\u043d\u0441\u0442\u0432\u043e, \u0430 \u0441\u0438\u0441\u0442\u0435\u043c\u0430 \u0432 \u0446\u0435\u043b\u043e\u043c \u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0441\u044f \u0433\u043e\u0440\u0430\u0437\u0434\u043e \u0431\u043e\u043b\u0435\u0435 \u0443\u0441\u0442\u043e\u0439\u0447\u0438\u0432\u043e\u0439 \u043a \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f\u043c \u043f\u043e\u0442\u043e\u043a\u0430 \u0434\u0430\u043d\u043d\u044b\u0445.<\/p>\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/vb\/hd\/ss\/vbhdsswisljqtm6dz_ssvg82ubs.png\"><\/div>\n<p>  \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c, \u043a\u0430\u043a\u0438\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u0435\u0441\u0442\u044c \u0443 \u044d\u0442\u043e\u0439 \u0437\u0430\u0434\u0430\u0447\u0438.<br \/>  <a name=\"habracut\"><\/a>  <\/p>\n<h2>\u0420\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432 \u00ab\u043f\u043e \u043c\u043e\u0449\u043d\u043e\u0441\u0442\u0438\u00bb<\/h2>\n<p>  \u0427\u0442\u043e\u0431\u044b \u043d\u0435 \u0443\u0433\u043b\u0443\u0431\u043b\u044f\u0442\u044c\u0441\u044f \u0432 \u043d\u0435\u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u044b\u0435 \u0430\u0431\u0441\u0442\u0440\u0430\u043a\u0446\u0438\u0438, \u0431\u0443\u0434\u0435\u043c \u0440\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u0442\u044c \u043d\u0430 \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u0439 \u0437\u0430\u0434\u0430\u0447\u0438 \u2014 <b>\u043c\u043e\u043d\u0438\u0442\u043e\u0440\u0438\u043d\u0433\u0430<\/b>. \u0421\u043e\u043e\u0442\u043d\u0435\u0441\u0442\u0438 \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u0435\u043c\u044b\u0435 \u043c\u0435\u0442\u043e\u0434\u0438\u043a\u0438 \u043d\u0430 \u0441\u0432\u043e\u0438 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u044b\u0435 \u0437\u0430\u0434\u0430\u0447\u0438, \u0443\u0432\u0435\u0440\u0435\u043d, \u0432\u044b \u0441\u043c\u043e\u0436\u0435\u0442\u0435 \u0441\u0430\u043c\u043e\u0441\u0442\u043e\u044f\u0442\u0435\u043b\u044c\u043d\u043e.<\/p>\n<h4>\u00ab\u0420\u0430\u0432\u043d\u043e\u043c\u043e\u0449\u043d\u044b\u0435\u00bb \u043e\u0431\u044a\u0435\u043a\u0442\u044b \u043c\u043e\u043d\u0438\u0442\u043e\u0440\u0438\u043d\u0433\u0430<\/h4>\n<p>  \u0412 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043f\u0440\u0438\u043c\u0435\u0440\u0430 \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u0438\u0432\u0435\u0441\u0442\u0438 <a href=\"https:\/\/habr.com\/ru\/company\/tensor\/blog\/328920\/\">\u043d\u0430\u0448\u0438 \u043a\u043e\u043b\u043b\u0435\u043a\u0442\u043e\u0440\u044b \u043c\u0435\u0442\u0440\u0438\u043a \u0434\u043b\u044f Zabbix<\/a>, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0438\u0441\u0442\u043e\u0440\u0438\u0447\u0435\u0441\u043a\u0438 \u0438\u043c\u0435\u044e\u0442 \u0441 \u043a\u043e\u043b\u043b\u0435\u043a\u0442\u043e\u0440\u0430\u043c\u0438 \u043b\u043e\u0433\u043e\u0432 PostgreSQL \u043e\u0431\u0449\u0443\u044e \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0443.<\/p>\n<p>  \u0418 \u043f\u0440\u0430\u0432\u0434\u0430, <b>\u043a\u0430\u0436\u0434\u044b\u0439 \u043e\u0431\u044a\u0435\u043a\u0442<\/b> \u043c\u043e\u043d\u0438\u0442\u043e\u0440\u0438\u043d\u0433\u0430 (\u0445\u043e\u0441\u0442) \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u0442 \u0434\u043b\u044f zabbix \u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0441\u0442\u0430\u0431\u0438\u043b\u044c\u043d\u043e <b>\u043e\u0434\u0438\u043d \u0438 \u0442\u043e\u0442 \u043d\u0430\u0431\u043e\u0440 \u043c\u0435\u0442\u0440\u0438\u043a \u0441 \u043e\u0434\u043d\u043e\u0439 \u0438 \u0442\u043e\u0439 \u0436\u0435 \u0447\u0430\u0441\u0442\u043e\u0442\u043e\u0439<\/b> \u0432\u0441\u0435 \u0432\u0440\u0435\u043c\u044f:<\/p>\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/eg\/wf\/sn\/egwfsnki9xsemqml77l69vtuj6e.png\"><\/div>\n<p>  \u041a\u0430\u043a \u0432\u0438\u0434\u043d\u043e \u043d\u0430 \u0433\u0440\u0430\u0444\u0438\u043a\u0435, \u0440\u0430\u0437\u043d\u0438\u0446\u0430 \u043c\u0435\u0436\u0434\u0443 min-max \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f\u043c\u0438 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0430 \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u043c\u044b\u0445 \u043c\u0435\u0442\u0440\u0438\u043a <b>\u043d\u0435 \u043f\u0440\u0435\u0432\u044b\u0448\u0430\u0435\u0442 15%<\/b>. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0441\u0447\u0438\u0442\u0430\u0442\u044c \u0432\u0441\u0435 \u043e\u0431\u044a\u0435\u043a\u0442\u044b <b>\u0440\u0430\u0432\u043d\u044b\u043c\u0438 \u0432 \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u044b\u0445 \u00ab\u043f\u043e\u043f\u0443\u0433\u0430\u044f\u0445\u00bb<\/b>.<\/p>\n<h4>\u0421\u0438\u043b\u044c\u043d\u044b\u0439 \u00ab\u0434\u0438\u0441\u0431\u0430\u043b\u0430\u043d\u0441\u00bb \u043c\u0435\u0436\u0434\u0443 \u043e\u0431\u044a\u0435\u043a\u0442\u0430\u043c\u0438<\/h4>\n<p>  \u0412 \u043e\u0442\u043b\u0438\u0447\u0438\u0435 \u043e\u0442 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u0439 \u043c\u043e\u0434\u0435\u043b\u0438, \u0434\u043b\u044f \u043a\u043e\u043b\u043b\u0435\u043a\u0442\u043e\u0440\u043e\u0432 \u043b\u043e\u0433\u043e\u0432 \u043d\u0430\u0431\u043b\u044e\u0434\u0430\u0435\u043c\u044b\u0435 \u0445\u043e\u0441\u0442\u044b \u0441\u043e\u0432\u0441\u0435\u043c <b>\u043d\u0435 \u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u043e\u0434\u043d\u043e\u0440\u043e\u0434\u043d\u044b\u043c\u0438<\/b>.<\/p>\n<p>  \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043e\u0434\u0438\u043d \u0445\u043e\u0441\u0442 \u043c\u043e\u0436\u0435\u0442 \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0432 \u043b\u043e\u0433 \u043c\u0438\u043b\u043b\u0438\u043e\u043d \u043f\u043b\u0430\u043d\u043e\u0432 \u0437\u0430 \u0441\u0443\u0442\u043a\u0438, \u0434\u0440\u0443\u0433\u043e\u0439 \u0434\u0435\u0441\u044f\u0442\u043a\u0438 \u0442\u044b\u0441\u044f\u0447, \u0430 \u043a\u0430\u043a\u043e\u0439-\u0442\u043e \u2014 \u0438 \u0432\u043e\u0432\u0441\u0435 \u0435\u0434\u0438\u043d\u0438\u0446\u044b. \u0414\u0430 \u0438 \u0441\u0430\u043c\u0438 \u044d\u0442\u0438 \u043f\u043b\u0430\u043d\u044b \u043f\u043e \u043e\u0431\u044a\u0435\u043c\u0443 \u0438 \u0441\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u0438 \u043f\u043e \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044e \u0432\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0441\u0443\u0442\u043e\u043a \u0441\u0438\u043b\u044c\u043d\u043e \u043e\u0442\u043b\u0438\u0447\u0430\u044e\u0442\u0441\u044f. \u0422\u0430\u043a \u0438 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0441\u044f, \u0447\u0442\u043e <b>\u043d\u0430\u0433\u0440\u0443\u0437\u043a\u0443 \u0441\u0438\u043b\u044c\u043d\u043e \u00ab\u043a\u0430\u0447\u0430\u0435\u0442\u00bb<\/b>, \u0432 \u0440\u0430\u0437\u044b:<\/p>\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/yg\/sp\/vo\/ygspvos5amvcntisi4scjlxpj4s.png\"><\/div>\n<p>  \u041d\u0443, \u0430 \u0440\u0430\u0437 \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u0430 \u043c\u043e\u0436\u0435\u0442 \u043c\u0435\u043d\u044f\u0442\u044c\u0441\u044f \u043d\u0430\u0441\u0442\u043e\u043b\u044c\u043a\u043e \u0441\u0438\u043b\u044c\u043d\u043e, \u0442\u043e <b>\u043d\u0430\u0434\u043e \u0443\u0447\u0438\u0442\u044c\u0441\u044f \u0435\u0439 \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c<\/b>\u2026<\/p>\n<h2>\u041a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u043e\u0440<\/h2>\n<p>  \u0421\u0440\u0430\u0437\u0443 \u043f\u043e\u043d\u0438\u043c\u0430\u0435\u043c, \u0447\u0442\u043e \u043d\u0430\u043c \u044f\u0432\u043d\u043e <b>\u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u0442\u0441\u044f \u043c\u0430\u0441\u0448\u0442\u0430\u0431\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435<\/b> \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u043a\u043e\u043b\u043b\u0435\u043a\u0442\u043e\u0440\u043e\u0432, \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u043e\u0434\u0438\u043d \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439 \u0443\u0437\u0435\u043b \u0441\u043e \u0432\u0441\u0435\u0439 \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u043e\u0439 \u043a\u043e\u0433\u0434\u0430-\u0442\u043e \u0442\u043e\u0447\u043d\u043e \u043f\u0435\u0440\u0435\u0441\u0442\u0430\u043d\u0435\u0442 \u0441\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c\u0441\u044f. \u0410 \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043d\u0430\u043c \u043f\u043e\u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f <b>\u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u043e\u0440<\/b> \u2014 \u0442\u043e\u0442, \u043a\u0442\u043e \u0431\u0443\u0434\u0435\u0442 \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u0432\u0441\u0435\u043c \u0437\u043e\u043e\u043f\u0430\u0440\u043a\u043e\u043c.<\/p>\n<p>  \u041f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0441\u044f \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u0442\u0430\u043a\u0430\u044f \u0441\u0445\u0435\u043c\u0430:<\/p>\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/dz\/p6\/8s\/dzp68sypbrwadggud5sgbr-apt8.png\"><\/div>\n<p>  \u041a\u0430\u0436\u0434\u044b\u0439 worker \u0441\u0432\u043e\u044e \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u0443 \u00ab\u0432 \u043f\u043e\u043f\u0443\u0433\u0430\u044f\u0445\u00bb \u0438 \u0432 \u043f\u0440\u043e\u0446\u0435\u043d\u0442\u0430\u0445 CPU \u043f\u0435\u0440\u0438\u043e\u0434\u0438\u0447\u0435\u0441\u043a\u0438 \u0441\u0431\u0440\u0430\u0441\u044b\u0432\u0430\u0435\u0442 master&#8217;\u0443, \u0442\u0435 \u2014 \u043a\u043e\u043b\u043b\u0435\u043a\u0442\u043e\u0440\u0443. \u0410 \u043e\u043d, \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0430\u043d\u0438\u0438 \u044d\u0442\u0438\u0445 \u0434\u0430\u043d\u043d\u044b\u0445, \u043c\u043e\u0436\u0435\u0442 \u0432\u044b\u0434\u0430\u0442\u044c \u043a\u043e\u043c\u0430\u043d\u0434\u0443 \u0442\u0438\u043f\u0430 <i>\u00ab\u043d\u043e\u0432\u044b\u0439 \u0445\u043e\u0441\u0442 \u043f\u043e\u0441\u0430\u0434\u0438\u0442\u044c \u043d\u0430 \u043d\u0435\u043d\u0430\u0433\u0440\u0443\u0436\u0435\u043d\u043d\u044b\u0439 worker#4\u00bb<\/i> \u0438\u043b\u0438 <i>\u00abhostA \u043d\u0430\u0434\u043e \u043f\u0435\u0440\u0435\u0441\u0430\u0434\u0438\u0442\u044c \u043d\u0430 worker#3\u00bb<\/i>.<\/p>\n<p>  \u0422\u0443\u0442 \u0435\u0449\u0435 \u043d\u0430\u0434\u043e \u043f\u043e\u043c\u043d\u0438\u0442\u044c, \u0447\u0442\u043e, \u0432 \u043e\u0442\u043b\u0438\u0447\u0438\u0435 \u043e\u0442 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432 \u043c\u043e\u043d\u0438\u0442\u043e\u0440\u0438\u043d\u0433\u0430, \u0441\u0430\u043c\u0438 <b>\u043a\u043e\u043b\u043b\u0435\u043a\u0442\u043e\u0440\u044b \u0438\u043c\u0435\u044e\u0442 \u0432\u043e\u0432\u0441\u0435 \u043d\u0435 \u0440\u0430\u0432\u043d\u0443\u044e \u00ab\u043c\u043e\u0449\u043d\u043e\u0441\u0442\u044c\u00bb<\/b> \u2014 \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043d\u0430 \u043e\u0434\u043d\u043e\u043c \u0443 \u0432\u0430\u0441 \u043c\u043e\u0436\u0435\u0442 \u043e\u043a\u0430\u0437\u0430\u0442\u044c\u0441\u044f 8 \u044f\u0434\u0435\u0440 CPU, \u0430 \u043d\u0430 \u0434\u0440\u0443\u0433\u043e\u043c \u2014 \u0442\u043e\u043b\u044c\u043a\u043e 4, \u0434\u0430 \u0435\u0449\u0435 \u0438 \u043c\u0435\u043d\u044c\u0448\u0435\u0439 \u0447\u0430\u0441\u0442\u043e\u0442\u044b. \u0418 \u0435\u0441\u043b\u0438 \u043d\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044c \u0438\u0445 \u0437\u0430\u0434\u0430\u0447\u0430\u043c\u0438 \u00ab\u043f\u043e\u0440\u043e\u0432\u043d\u0443\u00bb, \u0442\u043e \u0432\u0442\u043e\u0440\u043e\u0439 \u043d\u0430\u0447\u043d\u0435\u0442 \u00ab\u0437\u0430\u0442\u044b\u043a\u0430\u0442\u044c\u0441\u044f\u00bb, \u0430 \u043f\u0435\u0440\u0432\u044b\u0439 \u2014 \u043f\u0440\u043e\u0441\u0442\u0430\u0438\u0432\u0430\u0442\u044c. \u041e\u0442\u0441\u044e\u0434\u0430 \u0438 \u0432\u044b\u0442\u0435\u043a\u0430\u044e\u0442\u2026<\/p>\n<h4>\u0417\u0430\u0434\u0430\u0447\u0438 \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u043e\u0440\u0430<\/h4>\n<p>  \u041f\u043e \u0441\u0443\u0442\u0438, \u0437\u0430\u0434\u0430\u0447\u0430 \u0432\u0441\u0435\u0433\u043e \u043e\u0434\u043d\u0430 \u2014 \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0432\u0430\u0442\u044c <b>\u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e \u0440\u0430\u0432\u043d\u043e\u043c\u0435\u0440\u043d\u043e\u0435 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u0432\u0441\u0435\u0439 \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u0438<\/b> (\u0432 %cpu) \u043f\u043e \u0432\u0441\u0435\u043c \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u043c worker&#8217;\u0430\u043c. \u0415\u0441\u043b\u0438 \u043c\u044b \u0441\u043c\u043e\u0436\u0435\u043c \u0440\u0435\u0448\u0438\u0442\u044c \u0435\u0435 \u0438\u0434\u0435\u0430\u043b\u044c\u043d\u043e, \u0442\u043e \u0438 \u0440\u0430\u0432\u043d\u043e\u043c\u0435\u0440\u043d\u043e\u0441\u0442\u044c \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f %cpu-\u043d\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u043f\u043e \u043a\u043e\u043b\u043b\u0435\u043a\u0442\u043e\u0440\u0430\u043c \u043f\u043e\u043b\u0443\u0447\u0438\u043c \u00ab\u0430\u0432\u0442\u043e\u043c\u0430\u0442\u043e\u043c\u00bb.<\/p>\n<p>  \u041f\u043e\u043d\u044f\u0442\u043d\u043e, \u0447\u0442\u043e, \u0434\u0430\u0436\u0435 \u0435\u0441\u043b\u0438 \u043a\u0430\u0436\u0434\u044b\u0439 \u043e\u0431\u044a\u0435\u043a\u0442 \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u0442 \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u0443\u044e \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u0443, \u0441\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0435\u043c \u043a\u0430\u043a\u0438\u0435-\u0442\u043e \u0438\u0437 \u043d\u0438\u0445 \u043c\u043e\u0433\u0443\u0442 \u00ab\u043e\u0442\u043c\u0438\u0440\u0430\u0442\u044c\u00bb, \u0430 \u043a\u0430\u043a\u0438\u0435-\u0442\u043e \u0432\u043e\u0437\u043d\u0438\u043a\u0430\u0442\u044c \u043d\u043e\u0432\u044b\u0435. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u0432\u0441\u0435\u0439 \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u0435\u0439 \u043d\u0430\u0434\u043e \u0443\u043c\u0435\u0442\u044c \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u0438 \u0438 <b>\u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0442\u044c \u0431\u0430\u043b\u0430\u043d\u0441 \u043f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u043e<\/b>.<\/p>\n<h2>\u0414\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u0430\u044f \u0431\u0430\u043b\u0430\u043d\u0441\u0438\u0440\u043e\u0432\u043a\u0430<\/h2>\n<p>  \u041f\u0440\u043e\u0441\u0442\u0443\u044e \u0437\u0430\u0434\u0430\u0447\u0443 (zabbix) \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0440\u0435\u0448\u0438\u0442\u044c \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0431\u0430\u043d\u0430\u043b\u044c\u043d\u043e:<\/p>\n<ul>\n<li>\u0432\u044b\u0447\u0438\u0441\u043b\u044f\u0435\u043c <b>\u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0435\u043b\u044c\u043d\u0443\u044e \u043c\u043e\u0449\u043d\u043e\u0441\u0442\u044c<\/b> \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u043a\u043e\u043b\u043b\u0435\u043a\u0442\u043e\u0440\u0430 \u00ab\u0432 \u0437\u0430\u0434\u0430\u0447\u0430\u0445\u00bb<\/li>\n<li>\u0434\u0435\u043b\u0438\u043c \u0432\u0441\u0435 \u0437\u0430\u0434\u0430\u0447\u0438 \u043c\u0435\u0436\u0434\u0443 \u043d\u0438\u043c\u0438 <b>\u043f\u0440\u043e\u043f\u043e\u0440\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u043e<\/b><\/li>\n<li>\u043c\u0435\u0436\u0434\u0443 worker&#8217;\u0430\u043c\u0438 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u043c <b>\u0440\u0430\u0432\u043d\u043e\u043c\u0435\u0440\u043d\u043e<\/b><\/li>\n<\/ul>\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/cg\/2t\/9g\/cg2t9g0op1111esdysa0mfeajba.png\"><\/div>\n<p>  \u041d\u043e \u0447\u0442\u043e \u0434\u0435\u043b\u0430\u0442\u044c \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u00ab\u0441\u0438\u043b\u044c\u043d\u043e \u043d\u0435\u0440\u0430\u0432\u043d\u044b\u0445\u00bb \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432, \u043a\u0430\u043a \u0434\u043b\u044f \u043a\u043e\u043b\u043b\u0435\u043a\u0442\u043e\u0440\u0430 \u043b\u043e\u0433\u043e\u0432?..<\/p>\n<h4>\u041e\u0446\u0435\u043d\u043a\u0430 \u0440\u0430\u0432\u043d\u043e\u043c\u0435\u0440\u043d\u043e\u0441\u0442\u0438<\/h4>\n<p>  \u0412\u044b\u0448\u0435 \u043c\u044b \u0432\u0441\u0435 \u0432\u0440\u0435\u043c\u044f \u0443\u043f\u043e\u0442\u0440\u0435\u0431\u043b\u044f\u043b\u0438 \u0442\u0435\u0440\u043c\u0438\u043d &quot;<i>\u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e \u0440\u0430\u0432\u043d\u043e\u043c\u0435\u0440\u043d\u043e\u0435 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435<\/i>&quot;, \u0430 \u043a\u0430\u043a \u0432\u043e\u043e\u0431\u0449\u0435 \u043c\u043e\u0436\u043d\u043e \u0444\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u043e \u0441\u0440\u0430\u0432\u043d\u0438\u0442\u044c \u0434\u0432\u0430 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f, \u043a\u0430\u043a\u043e\u0435 \u0438\u0437 \u043d\u0438\u0445 \u00ab\u0440\u0430\u0432\u043d\u043e\u043c\u0435\u0440\u043d\u0435\u0435\u00bb?<\/p>\n<p>  \u0414\u043b\u044f \u043e\u0446\u0435\u043d\u043a\u0438 \u0440\u0430\u0432\u043d\u043e\u043c\u0435\u0440\u043d\u043e\u0441\u0442\u0438 \u0432 \u043c\u0430\u0442\u0435\u043c\u0430\u0442\u0438\u043a\u0435 \u0434\u0430\u0432\u043d\u043e \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u0442\u0430\u043a\u0430\u044f \u0432\u0435\u0449\u044c \u043a\u0430\u043a <a href=\"https:\/\/ru.wikipedia.org\/wiki\/%D0%A1%D1%80%D0%B5%D0%B4%D0%BD%D0%B5%D0%BA%D0%B2%D0%B0%D0%B4%D1%80%D0%B0%D1%82%D0%B8%D1%87%D0%B5%D1%81%D0%BA%D0%BE%D0%B5_%D0%BE%D1%82%D0%BA%D0%BB%D0%BE%D0%BD%D0%B5%D0%BD%D0%B8%D0%B5\">\u0441\u0440\u0435\u0434\u043d\u0435\u043a\u0432\u0430\u0434\u0440\u0430\u0442\u0438\u0447\u043d\u043e\u0435 \u043e\u0442\u043a\u043b\u043e\u043d\u0435\u043d\u0438\u0435<\/a>. \u041a\u043e\u043c\u0443 \u043b\u0435\u043d\u0438\u0432\u043e \u0432\u0447\u0438\u0442\u044b\u0432\u0430\u0442\u044c\u0441\u044f:  <\/p>\n<blockquote><p><code><b>S<\/b>[X] = <b>sqrt<\/b>( <b>sum<\/b>[ ( x - <b>avg<\/b>[X] ) ^ 2 of X ] \/ <b>count<\/b>[X] )<\/code><\/p><\/blockquote>\n<p>  \u041f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 <b>\u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e worker&#8217;\u043e\u0432<\/b> \u043d\u0430 \u043a\u0430\u0436\u0434\u043e\u043c \u0438\u0437 \u043a\u043e\u043b\u043b\u0435\u043a\u0442\u043e\u0440\u043e\u0432 \u0443 \u043d\u0430\u0441 \u0442\u043e\u0436\u0435 \u043c\u043e\u0436\u0435\u0442 \u043e\u0442\u043b\u0438\u0447\u0430\u0442\u044c\u0441\u044f, \u0442\u043e \u043d\u043e\u0440\u043c\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0440\u0430\u0437\u0431\u0440\u043e\u0441 \u043f\u043e \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u0435 \u043d\u0430\u0434\u043e \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u043c\u0435\u0436\u0434\u0443 \u043d\u0438\u043c\u0438, \u043d\u043e <b>\u0438 \u043c\u0435\u0436\u0434\u0443 \u043a\u043e\u043b\u043b\u0435\u043a\u0442\u043e\u0440\u0430\u043c\u0438 \u0432 \u0446\u0435\u043b\u043e\u043c<\/b>.<\/p>\n<p>  \u0422\u043e \u0435\u0441\u0442\u044c \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u043f\u043e worker&#8217;\u0430\u043c \u0434\u0432\u0443\u0445 \u043a\u043e\u043b\u043b\u0435\u043a\u0442\u043e\u0440\u043e\u0432 <code>[ (10%, 10%, 10%, 10%, 10%, 10%) ; (20%) ]<\/code> \u2014 \u044d\u0442\u043e \u0442\u043e\u0436\u0435 \u043d\u0435 \u043e\u0447\u0435\u043d\u044c \u0445\u043e\u0440\u043e\u0448\u043e, \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u043d\u0430 \u043f\u0435\u0440\u0432\u043e\u043c \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0441\u044f <b>10%<\/b>, \u0430 \u043d\u0430 \u0432\u0442\u043e\u0440\u043e\u043c \u2014 <b>20%<\/b>, \u0447\u0442\u043e \u043a\u0430\u043a \u0431\u044b \u0432\u0434\u0432\u043e\u0435 \u0431\u043e\u043b\u044c\u0448\u0435 \u0432 \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u0432\u0435\u043b\u0438\u0447\u0438\u043d\u0430\u0445.<\/p>\n<p>  \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u0432\u0432\u0435\u0434\u0435\u043c <b>\u0435\u0434\u0438\u043d\u0443\u044e \u043c\u0435\u0442\u0440\u0438\u043a\u0443-\u0440\u0430\u0441\u0441\u0442\u043e\u044f\u043d\u0438\u0435<\/b> \u0434\u043b\u044f \u043e\u0431\u0449\u0435\u0439 \u043e\u0446\u0435\u043d\u043a\u0438 \u00ab\u0440\u0430\u0432\u043d\u043e\u043c\u0435\u0440\u043d\u043e\u0441\u0442\u0438\u00bb:  <\/p>\n<blockquote><p><code><b>d<\/b>([%wrk], [%col]) = <b>sqrt<\/b>( <b>S<\/b>[%wrk] ^ 2 + <b>S<\/b>[%col] ^ 2 )<\/code><\/p><\/blockquote>\n<p>\u0422\u043e \u0435\u0441\u0442\u044c \u0432\u0435\u043b\u0438\u0447\u0438\u043d\u044b \u0441\u0440\u0435\u0434\u043d\u0435\u043a\u0432\u0430\u0434\u0440\u0430\u0442\u0438\u0447\u043d\u043e\u0433\u043e \u043e\u0442\u043a\u043b\u043e\u043d\u0435\u043d\u0438\u044f \u0434\u043b\u044f \u043d\u0430\u0431\u043e\u0440\u043e\u0432 \u0432\u0435\u043b\u0438\u0447\u0438\u043d \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u043f\u043e \u0432\u0441\u0435\u043c worker&#8217;\u0430\u043c \u0438 \u043f\u043e \u0432\u0441\u0435\u043c \u043a\u043e\u043b\u043b\u0435\u043a\u0442\u043e\u0440\u0430\u043c \u0432\u043e\u0441\u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u043c \u043a\u0430\u043a \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u044b \u0432\u0435\u043a\u0442\u043e\u0440\u0430, \u0434\u043b\u0438\u043d\u0443 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u0431\u0443\u0434\u0435\u043c \u0441\u0442\u0430\u0440\u0430\u0442\u044c\u0441\u044f \u043c\u0438\u043d\u0438\u043c\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c.<\/p>\n<h4>\u041c\u043e\u0434\u0435\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435<\/h4>\n<p>  \u0415\u0441\u043b\u0438 \u0431\u044b \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432 \u0443 \u043d\u0430\u0441 \u0431\u044b\u043b\u043e \u043d\u0435\u043c\u043d\u043e\u0433\u043e, \u0442\u043e \u043c\u044b \u043c\u043e\u0433\u043b\u0438 \u0431\u044b <b>\u043f\u043e\u043b\u043d\u044b\u043c \u043f\u0435\u0440\u0435\u0431\u043e\u0440\u043e\u043c<\/b> \u00ab\u0440\u0430\u0437\u043b\u043e\u0436\u0438\u0442\u044c\u00bb \u0438\u0445 \u043c\u0435\u0436\u0434\u0443 worker&#8217;\u0430\u043c\u0438 \u0442\u0430\u043a, <b>\u0447\u0442\u043e\u0431\u044b \u043c\u0435\u0442\u0440\u0438\u043a\u0430 \u043e\u043a\u0430\u0437\u0430\u043b\u0430\u0441\u044c \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0439<\/b>. \u041d\u043e \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432 \u0443 \u043d\u0430\u0441 \u2014 \u0442\u044b\u0441\u044f\u0447\u0438, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0442\u0430\u043a\u043e\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u043d\u0435 \u043f\u043e\u0434\u043e\u0439\u0434\u0435\u0442. \u0417\u0430\u0442\u043e \u043c\u044b \u0437\u043d\u0430\u0435\u043c, \u0447\u0442\u043e \u043a\u043e\u043b\u043b\u0435\u043a\u0442\u043e\u0440 \u0443\u043c\u0435\u0435\u0442 \u00ab\u043f\u0435\u0440\u0435\u043c\u0435\u0449\u0430\u0442\u044c\u00bb \u043e\u0431\u044a\u0435\u043a\u0442 \u0441 \u043e\u0434\u043d\u043e\u0433\u043e worker&#8217;\u0430 \u043d\u0430 \u0434\u0440\u0443\u0433\u043e\u0439 \u2014 \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u044d\u0442\u043e\u0442 \u0432\u0430\u0440\u0438\u0430\u043d\u0442 \u0438 \u0441\u043c\u043e\u0434\u0435\u043b\u0438\u0440\u0443\u0435\u043c, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f <a href=\"https:\/\/ru.wikipedia.org\/wiki\/%D0%93%D1%80%D0%B0%D0%B4%D0%B8%D0%B5%D0%BD%D1%82%D0%BD%D1%8B%D0%B9_%D1%81%D0%BF%D1%83%D1%81%D0%BA\">\u043c\u0435\u0442\u043e\u0434 \u0433\u0440\u0430\u0434\u0438\u0435\u043d\u0442\u043d\u043e\u0433\u043e \u0441\u043f\u0443\u0441\u043a\u0430<\/a>.<\/p>\n<p>  \u041f\u043e\u043d\u044f\u0442\u043d\u043e, \u0447\u0442\u043e \u00ab\u0438\u0434\u0435\u0430\u043b\u044c\u043d\u044b\u0439\u00bb \u043c\u0438\u043d\u0438\u043c\u0443\u043c \u043c\u0435\u0442\u0440\u0438\u043a\u0438 \u043c\u044b \u0442\u0430\u043a \u043c\u043e\u0436\u0435\u043c \u0438 \u043d\u0435 \u043d\u0430\u0439\u0442\u0438, \u043d\u043e \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u044b\u0439 \u2014 \u0442\u043e\u0447\u043d\u043e. \u0414\u0430 \u0438 \u0441\u0430\u043c\u0430 \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u0430 \u043c\u043e\u0436\u0435\u0442 \u0438\u0437\u043c\u0435\u043d\u044f\u0442\u044c\u0441\u044f \u0432\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u043d\u0430\u0441\u0442\u043e\u043b\u044c\u043a\u043e \u0441\u0438\u043b\u044c\u043d\u043e, \u0447\u0442\u043e <b>\u0438\u0441\u043a\u0430\u0442\u044c \u0437\u0430 \u0431\u0435\u0441\u043a\u043e\u043d\u0435\u0447\u043d\u043e\u0435 \u0432\u0440\u0435\u043c\u044f \u00ab\u0438\u0434\u0435\u0430\u043b\u00bb \u0430\u0431\u0441\u043e\u043b\u044e\u0442\u043d\u043e \u043d\u0435\u0437\u0430\u0447\u0435\u043c<\/b>.<\/p>\n<p>  \u0422\u043e \u0435\u0441\u0442\u044c \u043d\u0430\u043c \u043e\u0441\u0442\u0430\u043b\u043e\u0441\u044c \u0432\u0441\u0435\u0433\u043e \u043b\u0438\u0448\u044c \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c, \u043a\u0430\u043a\u043e\u0439 \u043e\u0431\u044a\u0435\u043a\u0442 \u0438 \u043d\u0430 \u043a\u0430\u043a\u043e\u0439 worker \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u0435\u0435 \u0432\u0441\u0435\u0433\u043e \u00ab\u043f\u0435\u0440\u0435\u043c\u0435\u0441\u0442\u0438\u0442\u044c\u00bb. \u0418 \u0441\u0434\u0435\u043b\u0430\u0435\u043c \u044d\u0442\u043e \u0431\u0430\u043d\u0430\u043b\u044c\u043d\u044b\u043c \u043f\u0435\u0440\u0435\u0431\u043e\u0440\u043d\u044b\u043c \u043c\u043e\u0434\u0435\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435\u043c:<\/p>\n<ul>\n<li>\u0434\u043b\u044f <b>\u043a\u0430\u0436\u0434\u043e\u0439 \u043f\u0430\u0440\u044b (\u0446\u0435\u043b\u0435\u0432\u043e\u0439 host, worker)<\/b> \u043c\u043e\u0434\u0435\u043b\u0438\u0440\u0443\u0435\u043c \u043f\u0435\u0440\u0435\u043d\u043e\u0441 \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u0438<\/li>\n<li><b>\u043d\u0430\u0433\u0440\u0443\u0437\u043a\u0443 \u043e\u0442 host<\/b> \u0432\u043d\u0443\u0442\u0440\u0438 \u0438\u0441\u0445\u043e\u0434\u043d\u043e\u0433\u043e worker&#8217;\u0430 \u0441\u0447\u0438\u0442\u0430\u0435\u043c <b>\u043f\u0440\u043e\u043f\u043e\u0440\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u043e \u00ab\u043f\u043e\u043f\u0443\u0433\u0430\u044f\u043c\u00bb<\/b><br \/>  \u0412 \u043d\u0430\u0448\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0437\u0430 \u00ab\u043f\u043e\u043f\u0443\u0433\u0430\u044f\u00bb \u043e\u043a\u0430\u0437\u0430\u043b\u043e\u0441\u044c \u0432\u043f\u043e\u043b\u043d\u0435 \u0440\u0430\u0437\u0443\u043c\u043d\u043e \u0432\u0437\u044f\u0442\u044c \u043e\u0431\u044a\u0435\u043c \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c\u043e\u0433\u043e \u043f\u043e\u0442\u043e\u043a\u0430 \u043b\u043e\u0433\u043e\u0432 \u0432 \u0431\u0430\u0439\u0442\u0430\u0445.<\/li>\n<li>\u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0435\u043b\u044c\u043d\u0443\u044e \u043c\u043e\u0449\u043d\u043e\u0441\u0442\u044c \u043c\u0435\u0436\u0434\u0443 \u043a\u043e\u043b\u043b\u0435\u043a\u0442\u043e\u0440\u0430\u043c\u0438 \u0441\u0447\u0438\u0442\u0430\u0435\u043c <b>\u043f\u0440\u043e\u043f\u043e\u0440\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u043e\u0439 \u00ab\u0441\u0443\u043c\u043c\u0430\u0440\u043d\u044b\u043c \u043f\u043e\u043f\u0443\u0433\u0430\u044f\u043c\u00bb<\/b><\/li>\n<li>\u0432\u044b\u0447\u0438\u0441\u043b\u044f\u0435\u043c \u043c\u0435\u0442\u0440\u0438\u043a\u0443 <b>d<\/b> \u0434\u043b\u044f \u00ab\u043f\u0435\u0440\u0435\u043d\u0435\u0441\u0435\u043d\u043d\u043e\u0433\u043e\u00bb \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f<\/li>\n<\/ul>\n<p>  \u0412\u044b\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u043c \u0432\u0441\u0435 \u043f\u0430\u0440\u044b <b>\u043f\u043e \u0432\u043e\u0437\u0440\u0430\u0441\u0442\u0430\u043d\u0438\u044e \u043c\u0435\u0442\u0440\u0438\u043a\u0438<\/b>. \u0412 \u0438\u0434\u0435\u0430\u043b\u0435, \u043d\u0430\u043c \u0432\u0441\u0435\u0433\u0434\u0430 \u0441\u0442\u043e\u0438\u0442 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u043f\u0435\u0440\u0435\u043d\u043e\u0441 \u0438\u043c\u0435\u043d\u043d\u043e <b>\u043f\u0435\u0440\u0432\u043e\u0439 \u043f\u0430\u0440\u044b<\/b>, \u043a\u0430\u043a \u0434\u0430\u044e\u0449\u0438\u0439 \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u0443\u044e \u0446\u0435\u043b\u0435\u0432\u0443\u044e \u043c\u0435\u0442\u0440\u0438\u043a\u0443. \u041a \u0441\u043e\u0436\u0430\u043b\u0435\u043d\u0438\u044e, \u0432 \u0440\u0435\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u0441\u0430\u043c \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u043f\u0435\u0440\u0435\u043d\u043e\u0441\u0430 \u00ab\u0441\u0442\u043e\u0438\u0442 \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0432\u00bb, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043d\u0435 \u0441\u0442\u043e\u0438\u0442 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u0435\u0433\u043e \u0434\u043b\u044f \u043e\u0434\u043d\u043e\u0433\u043e \u0438 \u0442\u043e\u0433\u043e \u0436\u0435 \u043e\u0431\u044a\u0435\u043a\u0442\u0430 \u0447\u0430\u0449\u0435 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u0433\u043e <b>\u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b\u0430 \u00ab\u043e\u0445\u043b\u0430\u0436\u0434\u0435\u043d\u0438\u044f\u00bb<\/b>.<\/p>\n<p>  \u0412 \u044d\u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0432\u0437\u044f\u0442\u044c \u0432\u0442\u043e\u0440\u0443\u044e, \u0442\u0440\u0435\u0442\u044c\u044e,\u2026 \u043f\u043e \u0440\u0430\u043d\u0433\u0443 \u043f\u0430\u0440\u0443 \u2014 \u043b\u0438\u0448\u044c \u0431\u044b \u0446\u0435\u043b\u0435\u0432\u0430\u044f \u043c\u0435\u0442\u0440\u0438\u043a\u0430 \u0443\u043c\u0435\u043d\u044c\u0448\u0430\u043b\u0430\u0441\u044c \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0442\u0435\u043a\u0443\u0449\u0435\u0433\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f.<\/p>\n<p>  \u0415\u0441\u043b\u0438 \u0436\u0435 \u0443\u043c\u0435\u043d\u044c\u0448\u0430\u0442\u044c \u043d\u0435\u043a\u0443\u0434\u0430 \u2014 \u0432\u043e\u0442 \u043e\u043d \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u044b\u0439 \u043c\u0438\u043d\u0438\u043c\u0443\u043c!<\/p>\n<p>  \u041f\u0440\u0438\u043c\u0435\u0440 \u043d\u0430 \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0435:<\/p>\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/5o\/gj\/_t\/5ogj_trgnsdo94y5ltn8knk29z0.png\"><\/div>\n<p>  \u0417\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u0438\u0442\u0435\u0440\u0430\u0446\u0438\u0438 \u00ab\u0434\u043e \u0443\u043f\u043e\u0440\u0430\u00bb \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u0432\u043e\u0432\u0441\u0435 \u043d\u0435 \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043c\u043e\u0436\u043d\u043e \u0434\u0435\u043b\u0430\u0442\u044c \u0443\u0441\u0440\u0435\u0434\u043d\u0435\u043d\u043d\u044b\u0439 \u0430\u043d\u0430\u043b\u0438\u0437 \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u043d\u0430 \u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b\u0435 1 \u043c\u0438\u043d, \u0438 \u043f\u043e \u0435\u0433\u043e \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u044e \u0434\u0435\u043b\u0430\u0442\u044c \u0435\u0434\u0438\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0439 \u043f\u0435\u0440\u0435\u043d\u043e\u0441.<\/p>\n<h2>\u041c\u0438\u043a\u0440\u043e-\u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0438<\/h2>\n<p>  \u041f\u043e\u043d\u044f\u0442\u043d\u043e, \u0447\u0442\u043e \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u0441\u043e \u0441\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u044c\u044e <code>T(\u0446\u0435\u043b\u0435\u0439) x W(\u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0432)<\/code> \u2014 \u044d\u0442\u043e \u043d\u0435 \u043e\u0447\u0435\u043d\u044c \u0445\u043e\u0440\u043e\u0448\u043e. \u041d\u043e \u0432 \u043d\u0435\u043c \u0441\u0442\u043e\u0438\u0442 \u043d\u0435 \u0437\u0430\u0431\u044b\u0442\u044c \u043f\u0440\u0438\u043c\u0435\u043d\u0438\u0442\u044c \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0431\u043e\u043b\u0435\u0435-\u043c\u0435\u043d\u0435\u0435 \u043e\u0447\u0435\u0432\u0438\u0434\u043d\u044b\u0435 \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0435\u0433\u043e \u043c\u043e\u0433\u0443\u0442 \u0443\u0441\u043a\u043e\u0440\u0438\u0442\u044c \u0432 \u0440\u0430\u0437\u044b.<\/p>\n<h4>\u041d\u0443\u043b\u0435\u0432\u044b\u0435 \u00ab\u043f\u043e\u043f\u0443\u0433\u0430\u0438\u00bb<\/h4>\n<p>  \u0415\u0441\u043b\u0438 \u043d\u0430 \u0437\u0430\u043c\u0435\u0440\u0435\u043d\u043d\u043e\u043c \u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b\u0435 \u043e\u0431\u044a\u0435\u043a\u0442\/\u0437\u0430\u0434\u0430\u0447\u0430\/\u0445\u043e\u0441\u0442 \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043b \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u0443 <b>\u00ab0 \u0448\u0442\u0443\u043a\u00bb<\/b>, \u0442\u043e \u0435\u0433\u043e \u043d\u0435 \u0442\u043e \u0447\u0442\u043e \u043f\u0435\u0440\u0435\u043c\u0435\u0449\u0430\u0442\u044c \u043a\u0443\u0434\u0430-\u0442\u043e \u2014 \u0435\u0433\u043e \u0434\u0430\u0436\u0435 \u0440\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u0442\u044c \u0438 \u0430\u043d\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043d\u0435 \u043d\u0430\u0434\u043e.<\/p>\n<h4>\u0421\u0430\u043c\u043e\u043f\u0435\u0440\u0435\u043d\u043e\u0441<\/h4>\n<p>  \u041f\u0440\u0438 \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 \u043f\u0430\u0440 \u043d\u0435\u0442 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0446\u0435\u043d\u0438\u0432\u0430\u0442\u044c \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u043e\u0441\u0442\u044c <b>\u043f\u0435\u0440\u0435\u043d\u043e\u0441\u0430 \u043e\u0431\u044a\u0435\u043a\u0442\u0430 \u043d\u0430 \u0442\u043e\u0442 \u0436\u0435 \u0441\u0430\u043c\u044b\u0439 worker<\/b>, \u0433\u0434\u0435 \u043e\u043d \u0438 \u0442\u0430\u043a \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f. \u0412\u0441\u0435-\u0442\u0430\u043a\u0438 \u0443\u0436\u0435 \u0431\u0443\u0434\u0435\u0442 <code>T x (W - 1)<\/code> \u2014 \u043c\u0435\u043b\u043e\u0447\u044c, \u0430 \u043f\u0440\u0438\u044f\u0442\u043d\u043e!<\/p>\n<h4>\u041d\u0435\u0440\u0430\u0437\u043b\u0438\u0447\u0438\u043c\u0430\u044f \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u0430<\/h4>\n<p>  \u041f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u043c\u044b \u043c\u043e\u0434\u0435\u043b\u0438\u0440\u0443\u0435\u043c \u0432\u0441\u0435-\u0442\u0430\u043a\u0438 \u043f\u0435\u0440\u0435\u043d\u043e\u0441 \u0438\u043c\u0435\u043d\u043d\u043e \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u0438, \u0430 \u043e\u0431\u044a\u0435\u043a\u0442 \u2014 \u0432\u0441\u0435\u0433\u043e \u043b\u0438\u0448\u044c \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442, \u0442\u043e \u043f\u0440\u043e\u0431\u043e\u0432\u0430\u0442\u044c <b>\u043f\u0435\u0440\u0435\u043d\u043e\u0441\u0438\u0442\u044c \u00ab\u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u044b\u0439\u00bb %cpu \u043d\u0435\u0442 \u0441\u043c\u044b\u0441\u043b\u0430<\/b> \u2014 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043c\u0435\u0442\u0440\u0438\u043a \u043e\u0441\u0442\u0430\u043d\u0443\u0442\u0441\u044f \u0442\u043e\u0447\u043d\u043e \u0442\u0435 \u0436\u0435, \u0445\u043e\u0442\u044c \u0438 \u0434\u043b\u044f \u0434\u0440\u0443\u0433\u043e\u0433\u043e \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432.<\/p>\n<p>  \u0422\u043e \u0435\u0441\u0442\u044c \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043e\u0446\u0435\u043d\u0438\u0442\u044c <b>\u0435\u0434\u0438\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u0443\u044e \u043c\u043e\u0434\u0435\u043b\u044c \u0434\u043b\u044f \u043a\u043e\u0440\u0442\u0435\u0436\u0430 (wrkSrc, wrkDst, %cpu)<\/b>. \u041d\u0443, \u0430 \u00ab\u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u044b\u043c\u0438\u00bb \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0441\u0447\u0438\u0442\u0430\u0442\u044c, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f %cpu, \u0441\u043e\u0432\u043f\u0430\u0434\u0430\u044e\u0449\u0438\u0435 \u0434\u043e 1 \u0437\u043d\u0430\u043a\u0430 \u043f\u043e\u0441\u043b\u0435 \u0437\u0430\u043f\u044f\u0442\u043e\u0439.<\/p>\n<div class=\"spoiler\" role=\"button\" tabindex=\"0\">                         <b class=\"spoiler_title\">\u041f\u0440\u0438\u043c\u0435\u0440 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043d\u0430 JavaScript<\/b>                         <\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"javascript\">var col = {   'c1' : {     'wrk' : {       'w1' : {         'hst' : {           'h1' : 5         , 'h2' : 1         , 'h3' : 1         }       , 'cpu' : 80.0       }     , 'w2' : {         'hst' : {           'h4' : 1         , 'h5' : 1         , 'h6' : 1         }       , 'cpu' : 20.0       }     }   } , 'c2' : {     'wrk' : {       'w1' : {         'hst' : {           'h7' : 1         , 'h8' : 2         }       , 'cpu' : 100.0       }     , 'w2' : {         'hst' : {           'h9' : 1         , 'hA' : 1         , 'hB' : 1         }       , 'cpu' : 50.0       }     }   } };  \/\/ \u0432\u044b\u0447\u0438\u0441\u043b\u044f\u0435\u043c \u043e\u043f\u043e\u0440\u043d\u044b\u0435 \u043c\u0435\u0442\u0440\u0438\u043a\u0438 \u0438 \u043d\u043e\u0440\u043c\u0430\u043b\u0438\u0437\u0443\u0435\u043c \u043f\u043e &quot;\u043c\u043e\u0449\u043d\u043e\u0441\u0442\u0438&quot; let $iv = (obj, fn) =&gt; Object.values(obj).forEach(fn); let $mv = (obj, fn) =&gt; Object.values(obj).map(fn);  \/\/ initial reparse for (const [cid, c] of Object.entries(col)) {   $iv(c.wrk, w =&gt; {     w.hst = Object.keys(w.hst).reduce((rv, hid) =&gt; {       if (typeof w.hst[hid] == 'object') {         rv[hid] = w.hst[hid];         return rv;       }       \/\/ \u043d\u0443\u043b\u0435\u0432\u044b\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043d\u0438\u0447\u0435\u0433\u043e \u043d\u0435 \u0440\u0435\u0448\u0430\u044e\u0442, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0441\u0440\u0430\u0437\u0443 \u043e\u0442\u0431\u0440\u0430\u0441\u044b\u0432\u0430\u0435\u043c       if (w.hst[hid]) {         rv[hid] = {'qty' : w.hst[hid]};       }       return rv;     }, {});   });   c.wrk = Object.keys(c.wrk).reduce((rv, wid) =&gt; {     \/\/ ID \u0432\u043e\u0440\u043a\u0435\u0440\u043e\u0432 \u0434\u043e\u043b\u0436\u043d\u044b \u0431\u044b\u0442\u044c \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u043e-\u0443\u043d\u0438\u043a\u0430\u043b\u044c\u043d\u044b     rv[cid + ':' + wid] = c.wrk[wid];     return rv;   }, {}); }  \/\/ \u0441\u0440\u0435\u0434\u043d\u0435\u043a\u0432\u0430\u0434\u0440\u0430\u0442\u0438\u0447\u043d\u043e\u0435 \u043e\u0442\u043a\u043b\u043e\u043d\u0435\u043d\u0438\u0435 let S = col =&gt; {   let wsum = 0     , wavg = 0     , wqty = 0     , csum = 0     , cavg = 0     , cqty = 0;    $iv(col, c =&gt; {     $iv(c.wrk, w =&gt; {       wsum += w.cpu;       wqty++;     });     csum += c.cpu;     cqty++;   });   wavg = wsum\/wqty;   wsum = 0;   cavg = csum\/cqty;   csum = 0;   $iv(col, c =&gt; {     $iv(c.wrk, w =&gt; {       wsum += (w.cpu - wavg) ** 2;     });     csum += (c.cpu - cavg) ** 2;   });   return [Math.sqrt(wsum\/wqty), Math.sqrt(csum\/cqty)]; };  \/\/ \u043c\u0435\u0442\u0440\u0438\u043a\u0430-\u0440\u0430\u0441\u0441\u0442\u043e\u044f\u043d\u0438\u0435 let distS = S =&gt; Math.sqrt(S[0] ** 2 + S[1] ** 2);  \/\/ \u0432\u044b\u0431\u0438\u0440\u0430\u0435\u043c \u043e\u043f\u0442\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u0439 \u043f\u0435\u0440\u0435\u043d\u043e\u0441 \u0438 \u043c\u043e\u0434\u0435\u043b\u0438\u0440\u0443\u0435\u043c \u0435\u0433\u043e let iterReOrder = col =&gt; {   let qty = 0     , max = 0;    $iv(col, c =&gt; {     c.qty = 0;     c.cpu = 0;     $iv(c.wrk, w =&gt; {       w.qty = 0;       $iv(w.hst, h =&gt; {         w.qty += h.qty;       });       w.max = w.qty * (100\/w.cpu);       c.qty += w.qty;       c.cpu += w.cpu;     });     c.cpu = c.cpu\/Object.keys(c.wrk).length;     c.max = c.qty * (100\/c.cpu);     qty += c.qty;     max += c.max;   });    $iv(col, c =&gt; {     c.nrm = c.max\/max;     $iv(c.wrk, w =&gt; {       $iv(w.hst, h =&gt; {         h.cpu = h.qty\/w.qty * w.cpu;         h.nrm = h.cpu * c.nrm;       });     });   });    \/\/ &quot;\u0442\u0435\u043a\u0443\u0449\u0435\u0435&quot; \u0441\u0440\u0435\u0434\u043d\u0435\u043a\u0432\u0430\u0434\u0440\u0430\u0442\u0438\u0447\u043d\u043e\u0435 \u043e\u0442\u043a\u043b\u043e\u043d\u0435\u043d\u0438\u0435   console.log(S(col), distS(S(col)));    \/\/ \u0444\u043e\u0440\u043c\u0438\u0440\u0443\u0435\u043c \u043d\u0430\u0431\u043e\u0440 \u0445\u043e\u0441\u0442\u043e\u0432 \u0438 \u0432\u043e\u0440\u043a\u0435\u0440\u043e\u0432   let wrk = {};   let hst = {};   for (const [cid, c] of Object.entries(col)) {     for (const [wid, w] of Object.entries(c.wrk)) {       wrk[wid] = {         wid       , cid       , 'wrk' : w       , 'col' : c       };       for (const [hid, h] of Object.entries(w.hst)) {         hst[hid] = {           hid         , wid         , cid         , 'hst' : h         , 'wrk' : w         , 'col' : c         };       }     }   }    \/\/ \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u043f\u0435\u0440\u0435\u043d\u043e\u0441\u0430 \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u043d\u0430 \u0446\u0435\u043b\u0435\u0432\u043e\u0439 worker   let move = (col, hid, wid) =&gt; {     let w = wrk[wid]       , h = hst[hid];      let wsrc = col[h.cid].wrk[h.wid]       , wdst = col[w.cid].wrk[w.wid];      wsrc.cpu -= h.hst.cpu;     wsrc.qty -= h.hst.qty;     wdst.qty += h.hst.qty;     \/\/ \u043f\u0435\u0440\u0435\u043d\u043e\u0441 \u043d\u0430 \u0434\u0440\u0443\u0433\u043e\u0439 \u043a\u043e\u043b\u043b\u0435\u043a\u0442\u043e\u0440 \u0441 &quot;\u043f\u0440\u043e\u0446\u0435\u043d\u0442\u043e\u0432\u0430\u043d\u0438\u0435\u043c&quot; \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u043d\u0430 CPU     if (h.cid != w.cid) {       let csrc = col[h.cid]         , cdst = col[w.cid];       csrc.qty -= h.hst.qty;       csrc.cpu -= h.hst.cpu\/Object.keys(csrc.wrk).length;       wsrc.hst[hid].cpu = h.hst.cpu * csrc.nrm\/cdst.nrm;       cdst.qty += h.hst.qty;       cdst.cpu += h.hst.cpu\/Object.keys(cdst.wrk).length;     }     wdst.cpu += wsrc.hst[hid].cpu;     wdst.hst[hid] = wsrc.hst[hid];     delete wsrc.hst[hid];   };    \/\/ \u043c\u043e\u0434\u0435\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0438 \u043e\u0446\u0435\u043d\u043a\u0430 \u043f\u0435\u0440\u0435\u043d\u043e\u0441\u0430 \u0434\u043b\u044f \u043f\u0430\u0440\u044b (host, worker)   let moveCheck = (orig, hid, wid) =&gt; {     let w = wrk[wid]       , h = hst[hid];      \/\/ \u0442\u043e\u0442 \u0436\u0435 \u0432\u043e\u0440\u043a\u0435\u0440 - \u043d\u0438\u0447\u0435\u0433\u043e \u043d\u0435 \u0434\u0435\u043b\u0430\u0435\u043c     if (h.wid == w.wid) {       return;     }      let col = JSON.parse(JSON.stringify(orig));     move(col, hid, wid);      return S(col);   };    \/\/ \u0445\u044d\u0448 \u0443\u0436\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u0435\u043d\u043d\u044b\u0445 \u043f\u0435\u0440\u0435\u043d\u043e\u0441\u043e\u0432 (hsrc,hdst,%cpu)   let checked = {};    \/\/ \u043f\u0435\u0440\u0435\u0431\u0438\u0440\u0430\u0435\u043c \u0432\u0441\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u0435 \u043f\u0430\u0440\u044b (\u043a\u0430\u043a\u043e\u0439 \u0445\u043e\u0441\u0442 -&gt; \u043d\u0430 \u043a\u0430\u043a\u043e\u0439 \u0432\u043e\u0440\u043a\u0435\u0440)   let moveRanker = col =&gt; {     let currS = S(col);     let order = [];      for (hid in hst) {       for (wid in wrk) {         \/\/ \u043d\u0435\u0442 \u0441\u043c\u044b\u0441\u043b\u0430 \u043f\u0440\u043e\u0431\u043e\u0432\u0430\u0442\u044c \u043f\u043e\u0432\u0442\u043e\u0440\u043d\u043e \u043f\u0435\u0440\u0435\u043c\u0435\u0449\u0430\u0442\u044c \u043e\u0434\u043d\u0443 \u0438 \u0442\u0443 \u0436\u0435 (\u0441 \u0442\u043e\u0447\u043d\u043e\u0441\u0442\u044c\u044e \u0434\u043e 0.1%) &quot;\u043c\u043e\u0449\u043d\u043e\u0441\u0442\u044c&quot; \u043c\u0435\u0436\u0434\u0443 \u043e\u0434\u043d\u043e\u0439 \u043f\u0430\u0440\u043e\u0439 \u0432\u043e\u0440\u043a\u0435\u0440\u043e\u0432         let widsrc = hst[hid].wid;         let idx = widsrc + '|' + wid + '|' + hst[hid].hst.cpu.toFixed(1);         if (idx in checked) {           continue;         }                  let _S = moveCheck(col, hid, wid);         if (_S === undefined) {           _S = currS;         }         checked[idx] = {           hid         , wid         , S : _S         };         order.push(checked[idx]);       }     }     order.sort((x, y) =&gt; distS(x.S) - distS(y.S));     return order;   };    let currS = S(col);   let order = moveRanker(col);    let opt = order[0];   console.log('best move', opt);    \/\/ \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u0435\u043c \u043f\u0435\u0440\u0435\u043d\u043e\u0441   if (distS(opt.S) &lt; distS(currS)) {     console.log('move!', opt.hid, opt.wid);     move(col, opt.hid, opt.wid);     console.log('after move', JSON.parse(JSON.stringify(col)));     return true;   }   else {     console.log('none!');   }   return false; };  \/\/ \u043f\u043e\u043a\u0430 \u0435\u0441\u0442\u044c \u0447\u0442\u043e-\u043a\u0443\u0434\u0430 \u043f\u0435\u0440\u0435\u043d\u043e\u0441\u0438\u0442\u044c while(iterReOrder(col));<\/code><\/pre>\n<\/div><\/div>\n<p>  \u0412 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435, \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u0430 \u043f\u043e \u043d\u0430\u0448\u0438\u043c \u043a\u043e\u043b\u043b\u0435\u043a\u0442\u043e\u0440\u0430\u043c \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442\u0441\u044f \u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u043e \u0432 \u043a\u0430\u0436\u0434\u044b\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 \u0432\u0440\u0435\u043c\u0435\u043d\u0438, \u043e\u043f\u0435\u0440\u0430\u0442\u0438\u0432\u043d\u043e \u043d\u0438\u0432\u0435\u043b\u0438\u0440\u0443\u044f \u0432\u043e\u0437\u043d\u0438\u043a\u0430\u044e\u0449\u0438\u0435 \u043f\u0438\u043a\u0438:<\/p>\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/l5\/z7\/ww\/l5z7ww2sfoqucmo2-zszr9hxtvu.png\"><\/div>\n<\/div>\n<p> \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\/company\/tensor\/blog\/517358\/\"> https:\/\/habr.com\/ru\/company\/tensor\/blog\/517358\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"\n<div class=\"post__text post__text-html post__text_v1\" id=\"post-content-body\" data-io-article-url=\"https:\/\/habr.com\/ru\/company\/tensor\/blog\/517358\/\">\u0412 \u043f\u0440\u043e\u0448\u043b\u043e\u0439 \u043d\u043e\u0432\u043e\u0441\u0442\u0438 \u043f\u0440\u043e <a href=\"https:\/\/habr.com\/ru\/post\/516384\/\">\u043f\u0440\u0438\u043d\u0446\u0438\u043f\u044b \u0440\u0430\u0431\u043e\u0442\u044b \u043a\u043e\u043b\u043b\u0435\u043a\u0442\u043e\u0440\u043e\u0432 \u043b\u043e\u0433\u043e\u0432 PostgreSQL<\/a> \u044f \u0443\u043f\u043e\u043c\u044f\u043d\u0443\u043b, \u0447\u0442\u043e \u043e\u0434\u043d\u0438\u043c \u0438\u0437 \u043d\u0435\u0434\u043e\u0441\u0442\u0430\u0442\u043a\u043e\u0432 pull-\u043c\u043e\u0434\u0435\u043b\u0438 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f <b>\u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u044c \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u0431\u0430\u043b\u0430\u043d\u0441\u0438\u0440\u043e\u0432\u043a\u0438<\/b> \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u0438. \u041d\u043e \u0435\u0441\u043b\u0438 \u0434\u0435\u043b\u0430\u0442\u044c \u0435\u0435 \u0430\u043a\u043a\u0443\u0440\u0430\u0442\u043d\u043e, \u0442\u043e \u043d\u0435\u0434\u043e\u0441\u0442\u0430\u0442\u043e\u043a \u043f\u0440\u0435\u0432\u0440\u0430\u0449\u0430\u0435\u0442\u0441\u044f \u0432 \u0434\u043e\u0441\u0442\u043e\u0438\u043d\u0441\u0442\u0432\u043e, \u0430 \u0441\u0438\u0441\u0442\u0435\u043c\u0430 \u0432 \u0446\u0435\u043b\u043e\u043c \u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0441\u044f \u0433\u043e\u0440\u0430\u0437\u0434\u043e \u0431\u043e\u043b\u0435\u0435 \u0443\u0441\u0442\u043e\u0439\u0447\u0438\u0432\u043e\u0439 \u043a \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f\u043c \u043f\u043e\u0442\u043e\u043a\u0430 \u0434\u0430\u043d\u043d\u044b\u0445.<\/p>\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/vb\/hd\/ss\/vbhdsswisljqtm6dz_ssvg82ubs.png\"><\/div>\n<p>  \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c, \u043a\u0430\u043a\u0438\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u0435\u0441\u0442\u044c \u0443 \u044d\u0442\u043e\u0439 \u0437\u0430\u0434\u0430\u0447\u0438.  <\/p>\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-309311","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/309311","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=309311"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/309311\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=309311"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=309311"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=309311"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}