{"id":322086,"date":"2021-04-26T09:00:30","date_gmt":"2021-04-26T09:00:30","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=322086"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=322086","title":{"rendered":"WorkerKiller"},"content":{"rendered":"\n<div class=\"post__text post__text_v2\" id=\"post-content-body\">\n<p>\u0423\u0442\u0435\u0447\u043a\u0438 \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0432 \u0438\/\u0438\u043b\u0438 \u043f\u0430\u043c\u044f\u0442\u0438, \u0430 \u0442\u0430\u043a\u0436\u0435 \u0435\u0451 \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044f \u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u043e\u0431\u044b\u0447\u043d\u043e\u0439 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u043e\u0439 \u0434\u043b\u044f \u0432\u0441\u0435\u0445 \u044f\u0437\u044b\u043a\u043e\u0432 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f. \u041d\u0435\u0432\u0430\u0436\u043d\u043e \u0435\u0441\u0442\u044c \u0442\u0430\u043c \u0441\u0431\u043e\u0440\u0449\u0438\u043a \u043c\u0443\u0441\u043e\u0440\u0430 \u0438\u043b\u0438 \u043d\u0435\u0442, \u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u0443\u0435\u043c\u044b\u0439 \u044f\u0437\u044b\u043a \u0438\u043b\u0438 \u0438\u043d\u0442\u0435\u0440\u043f\u0440\u0435\u0442\u0438\u0440\u0443\u0435\u043c\u044b\u0439. Ruby \u043d\u0435 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435\u043c \u0438 \u0441\u0435\u0433\u043e\u0434\u043d\u044f \u043c\u044b \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u043f\u043e\u0433\u043e\u0432\u043e\u0440\u0438\u043c \u043f\u0440\u043e \u044d\u0442\u0438 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b, \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u044b \u0438\u0445 \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u0438 \u0434\u0430\u0436\u0435 \u043d\u0430\u043f\u0438\u0448\u0435\u043c \u0441\u0432\u043e\u0451 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0435.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/f2d\/14f\/315\/f2d14f315af848955cb6d21f26cf90f2.jpeg\" width=\"600\" height=\"391\"><figcaption><\/figcaption><\/figure>\n<p>\u041f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u043c\u043e\u0436\u0435\u0442 \u043f\u043e\u044f\u0432\u0438\u0442\u044c\u0441\u044f \u0438 \u043f\u043e\u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043a\u043e\u0433\u0434\u0430 \u0443 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c \u043f\u0440\u043e\u0446\u0435\u0441\u0441, \u0437\u0430\u043f\u0443\u0449\u0435\u043d\u043d\u044b\u0439 \u0434\u043b\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0435 \u0432\u0440\u0435\u043c\u044f \u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u044e\u0449\u0438\u0439 \u043c\u043d\u043e\u0433\u043e \u0440\u0430\u0437\u043d\u043e\u043e\u0431\u0440\u0430\u0437\u043d\u043e\u0439 \u0440\u0430\u0431\u043e\u0442\u044b. \u0411\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u043e \u044d\u0442\u0438\u0445 \u043f\u0440\u043e\u0431\u043b\u0435\u043c \u0441\u0432\u044f\u0437\u0430\u043d\u044b \u0441 \u043e\u0448\u0438\u0431\u043a\u0430\u043c\u0438 \u0432 \u043a\u043e\u0434\u0435 \u043f\u0440\u0438 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043a\u043e\u0434 \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0430\u0435\u0442 \u0432\u043f\u043e\u043b\u043d\u0435 \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c \u0441\u0432\u043e\u044e \u0431\u0438\u0437\u043d\u0435\u0441-\u0444\u0443\u043d\u043a\u0446\u0438\u044e. \u0418\u0445 \u043d\u0435 \u0432\u0441\u0435\u0433\u0434\u0430 \u043b\u0435\u0433\u043a\u043e \u043d\u0430\u0439\u0442\u0438 \u0438 \u0438\u0441\u043f\u0440\u0430\u0432\u0438\u0442\u044c. \u0410 \u0432\u043e\u0442 \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044f \u043f\u0430\u043c\u044f\u0442\u0438 \u043f\u043e\u0434\u0436\u0438\u0434\u0430\u0435\u0442 \u043d\u0430\u0441 \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u0441 \u0434\u0440\u0443\u0433\u043e\u0439 \u0441\u0442\u043e\u0440\u043e\u043d\u044b \u0438 \u0434\u0430\u0436\u0435 \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u044b\u0439 \u043a\u043e\u0434 \u043c\u043e\u0436\u0435\u0442 \u043f\u043e\u0441\u0442\u0435\u043f\u0435\u043d\u043d\u043e \u043d\u0430\u043a\u0430\u043f\u043b\u0438\u0432\u0430\u0442\u044c \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u0443\u044e \u043f\u0430\u043c\u044f\u0442\u044c. \u0412 \u043c\u0438\u0440\u0435 Rails \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430\u043c\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u043e\u043f\u0430\u0434\u0430\u044e\u0442 \u043f\u043e\u0434 \u043a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u044e \u201c\u0434\u043e\u043b\u0433\u043e\u0438\u0433\u0440\u0430\u044e\u0449\u0438\u0445\u201d, \u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f, \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e, \u0432\u0435\u0431-\u0441\u0435\u0440\u0432\u0435\u0440 \u0438 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0435 \u043c\u0435\u043d\u0435\u0434\u0436\u0435\u0440\u044b \u0444\u043e\u043d\u043e\u0432\u044b\u0445\/\u043e\u0442\u043b\u043e\u0436\u0435\u043d\u043d\u044b\u0445 \u0437\u0430\u0434\u0430\u0447\u200a\u2014\u200a<code>DelayedJob<\/code>, <code>Sidekiq<\/code> \u0438 \u043f\u0440. \u0412\u043e\u0442 \u043f\u0440\u043e \u043d\u0438\u0445 \u0434\u0430\u043b\u044c\u0448\u0435 \u0438 \u043f\u043e\u0433\u043e\u0432\u043e\u0440\u0438\u043c.<\/p>\n<h4>\u0412\u0435\u0431-\u0441\u0435\u0440\u0432\u0435\u0440<\/h4>\n<p>\u0421\u0430\u043c\u044b\u043c \u043d\u0430\u0434\u0451\u0436\u043d\u044b\u043c \u0441\u043f\u043e\u0441\u043e\u0431\u043e\u043c \u201c\u043e\u0442\u0434\u0430\u0442\u044c\u201d \u043f\u0430\u043c\u044f\u0442\u044c \u0441\u0438\u0441\u0442\u0435\u043c\u0435 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u0435 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430. \u0414\u043b\u044f \u043c\u043d\u043e\u0433\u0438\u0445 \u0441\u0435\u0440\u0432\u0435\u0440\u043e\u0432 \u0443\u0436\u0435 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u044b \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0435 \u043f\u043b\u0430\u0433\u0438\u043d\u044b\/\u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0440\u0435\u0448\u0430\u044e\u0442 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b \u0441 \u043f\u0430\u043c\u044f\u0442\u044c\u044e \u043f\u0443\u0442\u0435\u043c \u043f\u0435\u0440\u0438\u043e\u0434\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u043f\u0435\u0440\u0435\u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u0440\u0430\u0431\u043e\u0447\u0438\u0445 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0432 (puma, unicorn), \u0430 \u0432 <a href=\"https:\/\/www.phusionpassenger.com\/\" rel=\"noopener noreferrer nofollow\">Phusion Passenger<\/a> \u044d\u0442\u043e \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043e \u0432 \u0441\u0430\u043c \u0441\u0435\u0440\u0432\u0435\u0440. \u0423 \u043d\u0430\u0441 \u0432 \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u0438 \u0438\u043c\u0435\u043d\u043d\u043e \u201c\u043f\u0430\u0441\u0441\u0430\u0436\u0438\u0440\u201d \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u043c \u0432\u0435\u0431-\u0441\u0435\u0440\u0432\u0435\u0440\u043e\u043c, \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u043a\u0440\u0443\u0442\u044f\u0442\u0441\u044f \u0432\u0441\u0435 \u043d\u0430\u0448\u0438 Rails-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f. \u041a\u043e\u043c\u0443 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e \u0431\u043e\u043b\u0435\u0435 \u0434\u0435\u0442\u0430\u043b\u044c\u043d\u043e \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u043d\u0430 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u044f, \u0434\u043e\u0431\u0440\u043e \u043f\u043e\u0436\u0430\u043b\u043e\u0432\u0430\u0442\u044c:<\/p>\n<ul>\n<li>\n<p><a href=\"https:\/\/about.gitlab.com\/blog\/2015\/06\/05\/how-gitlab-uses-unicorn-and-unicorn-worker-killer\/\" rel=\"noopener noreferrer nofollow\">https:\/\/about.gitlab.com\/blog\/2015\/06\/05\/how-gitlab-uses-unicorn-and-unicorn-worker-killer\/<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/github.com\/schneems\/puma_worker_killer\" rel=\"noopener noreferrer nofollow\">https:\/\/github.com\/schneems\/puma_worker_killer<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/docs.gitlab.com\/ee\/administration\/operations\/sidekiq_memory_killer.html\" rel=\"noopener noreferrer nofollow\">https:\/\/docs.gitlab.com\/ee\/administration\/operations\/sidekiq_memory_killer.html<\/a><\/p>\n<\/li>\n<\/ul>\n<p>\u0410\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u044b, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u044b\u0435 \u0432 \u0442\u0430\u043a\u0438\u0445 \u201c\u043f\u0435\u0440\u0435\u0437\u0430\u043f\u0443\u0441\u043a\u0430\u043b\u044c\u0449\u0438\u043a\u0430\u0445\u201d \u0432 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u043c \u0431\u0430\u0437\u0438\u0440\u0443\u044e\u0442\u0441\u044f \u043d\u0430 \u0434\u0432\u0443\u0445 \u043a\u0440\u0438\u0442\u0435\u0440\u0438\u044f\u0445\u200a\u2014\u200a\u0447\u0438\u0441\u043b\u043e \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0430\u043d\u043d\u044b\u0445 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u0438 \u043f\u043e\u0442\u0440\u0435\u0431\u043b\u0451\u043d\u043d\u0430\u044f \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u043c \u043f\u0430\u043c\u044f\u0442\u044c. \u0421 \u0447\u0438\u0441\u043b\u043e\u043c \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u0432\u0441\u0451 \u043f\u0440\u043e\u0441\u0442\u043e\u200a\u2014\u200a\u0432 \u043a\u0430\u0436\u0434\u043e\u043c \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0435 \u0441\u0447\u0438\u0442\u0430\u0435\u043c \u043a\u0430\u0436\u0434\u044b\u0439 \u0437\u0430\u043f\u0440\u043e\u0441 \u0438 \u043f\u043e \u0434\u043e\u0441\u0442\u0438\u0436\u0435\u043d\u0438\u0438 \u043b\u0438\u043c\u0438\u0442\u0430\u200a\u2014\u200a\u043f\u0435\u0440\u0435\u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c\u0441\u044f. \u0410 \u0432\u043e\u0442 \u0441 \u043f\u0430\u043c\u044f\u0442\u044c\u044e \u0432\u0441\u0435 \u043e\u0431\u0441\u0442\u043e\u0438\u0442 \u043a\u0443\u0434\u0430 \u0445\u0443\u0436\u0435\u200a\u2014\u200a\u043f\u043e\u0442\u0440\u0435\u0431\u043b\u0451\u043d\u043d\u0443\u044e \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u043c \u043f\u0430\u043c\u044f\u0442\u044c \u043c\u043e\u0436\u043d\u043e <a href=\"https:\/\/utcc.utoronto.ca\/~cks\/space\/blog\/unix\/UnderstandingRSS\" rel=\"noopener noreferrer nofollow\">\u043f\u043e\u0441\u0447\u0438\u0442\u0430\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u0440\u0438\u0431\u043b\u0438\u0437\u0438\u0442\u0435\u043b\u044c\u043d\u043e<\/a> \u0438 Passenger \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u0435\u0442 <a href=\"https:\/\/www.phusionpassenger.com\/library\/config\/standalone\/reference\/#--memory-limit-memory_limit\" rel=\"noopener noreferrer nofollow\">\u0442\u0430\u043a\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b<\/a> \u0442\u043e\u043b\u044c\u043a\u043e \u0432 Enterprise \u0432\u0435\u0440\u0441\u0438\u0438.<\/p>\n<h4>\u041c\u0435\u043d\u0435\u0434\u0436\u0435\u0440 \u0444\u043e\u043d\u043e\u0432\u044b\u0445&nbsp;\u0437\u0430\u0434\u0430\u0447<\/h4>\n<p>\u041a\u0430\u043a-\u0442\u043e \u0442\u0430\u043a \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u043e\u0441\u044c, \u0447\u0442\u043e \u044f \u044f\u0432\u043b\u044f\u044e\u0441\u044c \u044f\u0440\u044b\u043c \u0435\u0432\u0430\u043d\u0433\u0435\u043b\u0438\u0441\u0442\u043e\u043c <code>DelayedJob<\/code>, \u0430 \u0442\u043e\u0447\u043d\u0435\u0435 <code>ActiveJob<\/code>(\u0447\u0442\u043e\u0431 \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u043f\u0440\u043e\u0431\u043b\u0435\u043c \u0441 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c\u044e \u043c\u043e\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u043f\u0435\u0440\u0435\u0431\u0440\u0430\u0442\u044c\u0441\u044f \u201c\u043d\u0430 \u044d\u0442\u043e\u0442 \u0432\u0430\u0448 \u0441\u0430\u0439\u0434\u043a\u0438\u043a\u201d \u0431\u0435\u0437 \u043f\u0440\u043e\u0431\u043b\u0435\u043c). \u041d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435 \u043d\u0435\u0442 \u043e\u0441\u043e\u0431\u043e\u0439 \u0440\u0430\u0437\u043d\u0438\u0446\u044b \u043a\u0430\u043a\u043e\u0439 \u0438\u043c\u0435\u043d\u043d\u043e \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u200a\u2014\u200a\u043f\u0440\u0438\u043d\u0446\u0438\u043f \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u043d\u0430\u0448\u0435\u0439 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b \u043e\u0442 \u044d\u0442\u043e\u0433\u043e \u043d\u0435 \u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f\u200a\u2014\u200a\u043f\u0435\u0440\u0435\u0437\u0430\u043f\u0443\u0441\u043a \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430. \u0414\u043b\u044f <code>Sidekiq<\/code> <a href=\"https:\/\/github.com\/klaxit\/sidekiq-worker-killer\" rel=\"noopener noreferrer nofollow\">\u0443\u0436\u0435 \u0435\u0441\u0442\u044c \u0440\u0435\u0448\u0435\u043d\u0438\u0435<\/a>, \u0430 \u0434\u043b\u044f <code>DelayedJob<\/code> \u0435\u0449\u0435 \u043d\u0435\u0442!<\/p>\n<p>\u0412\u043d\u0438\u043c\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0432 \u0438 \u043f\u043e\u0434\u0443\u043c\u0430\u0432 \u043d\u0430\u0434 \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u0435\u0439 \u043c\u044b \u0440\u0435\u0448\u0438\u043b\u0438 \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0441\u0432\u043e\u0451 <a href=\"https:\/\/github.com\/RND-SOFT\/worker_killer\" rel=\"noopener noreferrer nofollow\">\u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u0435<\/a> \u0434\u043b\u044f \u043d\u0430\u0448\u0435\u0433\u043e \u043b\u044e\u0431\u0438\u043c\u043e\u0433\u043e \u0432\u0435\u0431-\u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u0438 \u043c\u043e\u0435\u0433\u043e \u043b\u044e\u0431\u0438\u043c\u043e\u0433\u043e <code>DelayedJob <\/code>\u0438 \u043d\u0430\u0437\u0432\u0430\u043b\u0438 \u0435\u0433\u043e <code>WorkerKiller<\/code>\u200a\u2014\u200a<a href=\"https:\/\/github.com\/RND-SOFT\/worker_killer\" rel=\"noopener noreferrer nofollow\">\u0432\u0441\u0442\u0440\u0435\u0447\u0430\u0439\u0442\u0435!<\/a><\/p>\n<h4>\u041a\u0430\u043a \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0440\u043e\u0441\u043a\u043e\u0448\u043d\u044b\u0439 \u0432\u0435\u043b\u043e\u0441\u0438\u043f\u0435\u0434?<\/h4>\n<p>\u041d\u0430\u0447\u0438\u043d\u0430\u0435\u0442\u0441\u044f \u0432\u0441\u0451 \u0441 <code>middleware<\/code>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442 \u0430\u043d\u0430\u043b\u0438\u0437 \u043a\u0440\u0438\u0442\u0435\u0440\u0438\u0435\u0432, \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0445 \u0434\u043b\u044f \u043f\u0435\u0440\u0435\u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043f\u0435\u0440\u0435\u0434\u0430\u043d\u043d\u043e\u0439 \u0441\u0442\u0440\u0430\u0442\u0435\u0433\u0438\u0438.<\/p>\n<p><iframe id=\"60866808388fa3867a8ff43b\" src=\"https:\/\/embedd.srv.habr.com\/iframe\/60866808388fa3867a8ff43b\" class=\"embed_video embed__content\" allowfullscreen=\"true\"><\/iframe><\/p>\n<p>\u0415\u0441\u043b\u0438 \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u0441\u0447\u0438\u0442\u0430\u0442\u044c \u0432\u0435\u0441\u044c\u043c\u0430 \u0434\u0451\u0448\u0435\u0432\u043e \u0441 \u0442\u043e\u0447\u043a\u0438 \u0437\u0440\u0435\u043d\u0438\u044f CPU, \u0442\u043e \u0441 \u043f\u0430\u043c\u044f\u0442\u044c\u044e \u0441\u043b\u043e\u0436\u043d\u0435\u0435. \u041e\u0434\u043d\u0430\u043a\u043e \u043d\u0430\u043c \u043d\u0435 \u043d\u0443\u0436\u043d\u043e \u0447\u0451\u0442\u043a\u043e \u0443\u043a\u043b\u0430\u0434\u044b\u0432\u0430\u0442\u044c\u0441\u044f \u0432 \u043b\u0438\u043c\u0438\u0442\u044b\u200a\u2014\u200a\u043d\u0438\u0447\u0435\u0433\u043e \u0441\u0442\u0440\u0430\u0448\u043d\u043e\u0433\u043e, \u0435\u0441\u043b\u0438 \u043d\u0430\u0448\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043d\u0430 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u0431\u043e\u043b\u044c\u0448\u0435, \u0447\u0435\u043c \u043c\u044b \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0438\u043b\u0438 \u0438\u043b\u0438 \u043e\u0442\u044a\u0435\u0441\u0442 \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u0431\u043e\u043b\u044c\u0448\u0435 \u043f\u0430\u043c\u044f\u0442\u0438 \u043f\u0435\u0440\u0435\u0434 \u043f\u0435\u0440\u0435\u0437\u0430\u043f\u0443\u0441\u043a\u043e\u043c, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0440\u0430\u0441\u0447\u0435\u0442 \u043f\u0430\u043c\u044f\u0442\u0438 \u0431\u0443\u0434\u0435\u043c \u0434\u0435\u043b\u0430\u0442\u044c \u201c\u043f\u0435\u0440\u0438\u043e\u0434\u0438\u0447\u0435\u0441\u043a\u0438&#187;\u200a\u2014\u200a\u0441 \u044d\u0442\u0438\u043c \u043d\u0430\u043c \u043f\u043e\u043c\u043e\u0436\u0435\u0442 <code>Limiter<\/code>.<\/p>\n<p><iframe id=\"60866870d990706d645cc0d3\" src=\"https:\/\/embedd.srv.habr.com\/iframe\/60866870d990706d645cc0d3\" class=\"embed_video embed__content\" allowfullscreen=\"true\"><\/iframe><\/p>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043f\u0440\u043e \u0441\u0430\u043c \u043f\u0435\u0440\u0435\u0437\u0430\u043f\u0443\u0441\u043a\u200a\u2014\u200a\u043d\u0430\u043c \u043d\u0443\u0436\u0435\u043d <code>Killer<\/code>. \u0421\u043d\u0430\u0447\u0430\u043b\u0430 \u043c\u044b \u043f\u043e\u0448\u043b\u0438 \u043f\u043e \u043f\u0443\u0442\u0438 <code>unicorn\u200a<\/code>\u2014\u200a\u043f\u0440\u043e\u0446\u0435\u0441\u0441 <a href=\"https:\/\/github.com\/kzk\/unicorn-worker-killer\/blob\/bdec225f028d1bda01b5888578c479b0c705f1a8\/lib\/unicorn\/worker_killer.rb#L15\" rel=\"noopener noreferrer nofollow\">\u043f\u043e\u0441\u044b\u043b\u0430\u043b \u0441\u0435\u0431\u0435 SIGTERM<\/a>. \u041f\u0440\u0438 \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0435 \u0432\u0441\u0435 \u0431\u044b\u043b\u043e \u0445\u043e\u0440\u043e\u0448\u043e\u200a\u2014\u200a\u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u0437\u0430\u0432\u0435\u0440\u0448\u0430\u043b\u0441\u044f, \u0430 Passenger Master Process \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u043b \u043d\u043e\u0432\u044b\u0439 \u0435\u043c\u0443 \u043d\u0430 \u0437\u0430\u043c\u0435\u043d\u0443. \u041d\u043e \u043f\u0440\u0438 \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0438 \u0438 \u0431\u0435\u043d\u0447\u043c\u0430\u0440\u043a\u0438\u043d\u0433\u0435 <a href=\"https:\/\/github.com\/yandex\/yandex-tank\" rel=\"noopener noreferrer nofollow\">\u042f\u043d\u0434\u0435\u043a\u0441 \u0422\u0430\u043d\u043a\u043e\u043c<\/a> \u043e\u043a\u0430\u0437\u0430\u043b\u043e\u0441\u044c, \u0447\u0442\u043e \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u0442\u0435\u0440\u044f\u044e\u0442\u0441\u044f \u0437\u0430\u043f\u0440\u043e\u0441\u044b, \u043d\u0430\u0445\u043e\u0434\u044f\u0449\u0438\u0435\u0441\u044f \u201cinflight\u201d \u043c\u0435\u0436\u0434\u0443 \u043f\u0430\u0441\u0441\u0430\u0436\u0438\u0440\u043e\u043c \u0438 \u0437\u0430\u0432\u0435\u0440\u0448\u0451\u043d\u043d\u044b\u043c \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u043c. \u041d\u0435\u043c\u043d\u043e\u0433\u043e \u043f\u043e\u043a\u043e\u043f\u0430\u0432 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044e, \u0431\u044b\u043b \u043d\u0430\u0439\u0434\u0435\u043d \u0441\u043f\u043e\u0441\u043e\u0431 \u0437\u0430\u0432\u0435\u0440\u0448\u0430\u0442\u044c \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e:<\/p>\n<pre><code class=\"bash\">passenger-config detach-process &lt;PID&gt;<\/code><\/pre>\n<p>\u041f\u0440\u0438 \u044d\u0442\u043e\u043c \u043d\u0435\u0442 \u0430\u0431\u0441\u043e\u043b\u044e\u0442\u043d\u043e \u043d\u0438\u043a\u0430\u043a\u043e\u0439 \u043f\u0440\u043e\u0441\u0430\u0434\u043a\u0438 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438, \u0434\u0430\u0436\u0435 \u0435\u0441\u043b\u0438 \u043c\u044b \u0448\u043b\u0435\u043c 500 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u0432 \u0441\u0435\u043a\u0443\u043d\u0434\u0443, \u0430 \u0440\u0435\u0441\u0442\u0430\u0440\u0442\u0443\u0435\u043c \u0447\u0435\u0440\u0435\u0437 \u043a\u0430\u0436\u0434\u044b\u0435 100. \u042d\u0442\u043e \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e Passenger \u043e\u0447\u0435\u043d\u044c \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u0442 \u043f\u0435\u0440\u0435\u0437\u0430\u043f\u0443\u0441\u043a\u200a\u2014\u200a\u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u043e\u043d \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442 \u043d\u043e\u0432\u044b\u0439 \u043f\u0440\u043e\u0446\u0435\u0441\u0441-\u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a, \u043f\u043e\u0442\u043e\u043c \u043e\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u0442 \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u0441\u0442\u0430\u0440\u043e\u043c\u0443, \u0434\u043e\u0436\u0438\u0434\u0430\u0435\u0442\u0441\u044f \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0432\u0441\u0435\u0439 \u0435\u0433\u043e \u043e\u0447\u0435\u0440\u0435\u0434\u0438 \u0438 \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u043e\u0442\u043e\u043c \u0437\u0430\u0432\u0435\u0440\u0448\u0430\u0435\u0442 \u043f\u0440\u043e\u0446\u0435\u0441\u0441.<\/p>\n<p><iframe id=\"608668b229e351865d365482\" src=\"https:\/\/embedd.srv.habr.com\/iframe\/608668b229e351865d365482\" class=\"embed_video embed__content\" allowfullscreen=\"true\"><\/iframe><\/p>\n<p>\u0420\u0430\u0437\u0440\u044f\u0434!<\/p>\n<p><iframe id=\"608668cc563ace6d7a18d831\" src=\"https:\/\/embedd.srv.habr.com\/iframe\/608668cc563ace6d7a18d831\" class=\"embed_video embed__content\" allowfullscreen=\"true\"><\/iframe><\/p>\n<p>\u0421 \u0432\u0435\u0431-\u0441\u0435\u0440\u0432\u0435\u0440\u043e\u043c, \u043a\u0430\u0436\u0435\u0442\u0441\u044f, \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u043b\u0438\u0441\u044c, \u0434\u0430\u043b\u044c\u0448\u0435 &#8212; <code>DelayedJob<\/code>. \u0423 \u043d\u0435\u0433\u043e \u043f\u0440\u0438\u043c\u0438\u0442\u0438\u0432\u043d\u0430\u044f \u0441\u0438\u0441\u0442\u0435\u043c\u0430 \u043f\u043b\u0430\u0433\u0438\u043d\u043e\u0432, \u043e\u0441\u043d\u043e\u0432\u0430\u043d\u043d\u0430\u044f \u043d\u0430 \u0445\u0443\u043a\u0430\u0445, \u043d\u043e \u0432\u043e\u0442 \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0442\u044c \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u0432 \u043f\u043b\u0430\u0433\u0438\u043d\u044b \u043d\u0435 \u043e\u0447\u0435\u043d\u044c \u0443\u0434\u043e\u0431\u043d\u043e.<\/p>\n<p><iframe id=\"608668e393c5636d47c919d8\" src=\"https:\/\/embedd.srv.habr.com\/iframe\/608668e393c5636d47c919d8\" class=\"embed_video embed__content\" allowfullscreen=\"true\"><\/iframe><\/p>\n<p>\u0420\u0430\u0437\u0440\u044f\u0434!<\/p>\n<p><iframe id=\"608668f7388fa3867a8ff43c\" src=\"https:\/\/embedd.srv.habr.com\/iframe\/608668f7388fa3867a8ff43c\" class=\"embed_video embed__content\" allowfullscreen=\"true\"><\/iframe><\/p>\n<p><strong>\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442<\/strong><\/p>\n<p>\u0427\u0442\u043e \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u0438 \u0432 \u043a\u043e\u043d\u0446\u0435? \u041f\u0440\u0435\u0436\u0434\u0435 \u0432\u0441\u0435\u0433\u043e \u043c\u044b \u0437\u0430\u043f\u0438\u043b\u0438\u043b\u0438 \u0441\u0432\u043e\u0439 <a href=\"https:\/\/github.com\/RND-SOFT\/worker_killer\" rel=\"noopener noreferrer nofollow\">\u0433\u0435\u043c WorkerKiller<\/a> ? \u041a\u0440\u043e\u043c\u0435 \u0442\u043e\u0433\u043e, \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u0438 \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u0438 \u043d\u0430\u0434\u0451\u0436\u043d\u044b\u0439 \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u043f\u0440\u043e\u0431\u043b\u0435\u043c \u0441 \u043f\u0430\u043c\u044f\u0442\u044c\u044e \u0447\u0435\u0440\u0435\u0437 \u043f\u0435\u0440\u0435\u0437\u0430\u043f\u0443\u0441\u043a \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0432. \u0422\u0443\u0442 \u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u043e\u0433\u043e\u0432\u043e\u0440\u0438\u0442\u044c\u0441\u044f\u200a\u2014\u200a\u0435\u0441\u043b\u0438 \u0443 \u0432\u0430\u0441 \u0432 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0438 \u0435\u0441\u0442\u044c \u0443\u0442\u0435\u0447\u043a\u0438 \u043f\u0430\u043c\u044f\u0442\u0438, \u0442\u043e \u0442\u0430\u043a\u043e\u0439 \u043f\u043e\u0434\u0445\u043e\u0434 \u0437\u0430\u043c\u0430\u0441\u043a\u0438\u0440\u0443\u0435\u0442 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0443 \u043d\u0435 \u0440\u0435\u0448\u0438\u0432 \u0435\u0451 \u043e\u043a\u043e\u043d\u0447\u0430\u0442\u0435\u043b\u044c\u043d\u043e, \u0438 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u0432\u0441\u0451 \u0440\u0430\u0432\u043d\u043e \u0432\u0430\u0441 \u0434\u043e\u0433\u043e\u043d\u0438\u0442 \u0438 \u043d\u0430\u043f\u043e\u0434\u0434\u0430\u0441\u0442 \u0432\u0430\u043c \u0432 \u0432\u0438\u0434\u0435 \u043f\u0430\u0434\u0435\u043d\u0438\u044f \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438, \u0447\u0440\u0435\u0437\u043c\u0435\u0440\u043d\u043e\u0439 \u043f\u0440\u043e\u0436\u043e\u0440\u043b\u0438\u0432\u043e\u0441\u0442\u0438 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0438\u043b\u0438 \u0440\u0435\u0434\u043a\u0438\u0445 \u043f\u043b\u0430\u0432\u0430\u044e\u0449\u0438\u0445 \u0431\u0430\u0433\u043e\u0432. \u0422\u0430\u043a \u0447\u0442\u043e \u0435\u0441\u043b\u0438 \u0432\u044b \u0437\u043d\u0430\u0435\u0442\u0435 \u0447\u0442\u043e \u0443 \u0432\u0430\u0441 \u0435\u0441\u0442\u044c \u0441\u0435\u0440\u044c\u0451\u0437\u043d\u044b\u0435 \u0443\u0442\u0435\u0447\u043a\u0438\u200a\u2014\u200a\u0437\u0430\u0439\u043c\u0438\u0442\u0435\u0441\u044c \u043f\u0440\u043e\u0444\u0438\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435\u043c, \u0430 \u043d\u0435 \u0442\u0443\u0448\u0438\u0442\u0435 \u043e\u0433\u043e\u043d\u044c \u043f\u0438\u0440\u043e\u0433\u0430\u043c\u0438.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/1c6\/15e\/495\/1c615e495dc25f35b31d25a602fda409.jpeg\" alt=\"Band-Aid on a bullet&nbsp;wound\" title=\"Band-Aid on a bullet&nbsp;wound\" width=\"570\" height=\"344\"><figcaption>Band-Aid on a bullet&nbsp;wound<\/figcaption><\/figure>\n<p><strong>\u0421\u0441\u044b\u043b\u043a\u0438<\/strong><\/p>\n<p>\u041c\u043d\u043e\u0433\u043e \u0432\u0441\u044f\u043a\u0438\u0445 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u044b\u0445 \u0441\u0441\u044b\u043b\u043e\u043a, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0440\u0435\u0448\u0438\u043b \u043f\u0440\u0438\u0432\u0435\u0441\u0442\u0438 \u0438\u0445 \u0432 \u043a\u043e\u043d\u0446\u0435:<\/p>\n<ul>\n<li>\n<p><a href=\"https:\/\/about.gitlab.com\/blog\/2015\/06\/05\/how-gitlab-uses-unicorn-and-unicorn-worker-killer\/\" rel=\"noopener noreferrer nofollow\">\u041f\u0440\u043e Giltab \u0438 Unicorn killer<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/docs.gitlab.com\/ee\/administration\/operations\/sidekiq_memory_killer.html\" rel=\"noopener noreferrer nofollow\">\u041f\u0440\u043e Gitlab \u0438 Sidekiq killer<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/github.com\/schneems\/puma_worker_killer\" rel=\"noopener noreferrer nofollow\">Killer \u0434\u043b\u044f puma<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/utcc.utoronto.ca\/~cks\/space\/blog\/unix\/UnderstandingRSS\" rel=\"noopener noreferrer nofollow\">\u041f\u0440\u043e \u0442\u043e \u043a\u0430\u043a \u0441\u0447\u0438\u0442\u0430\u0442\u044c \u043f\u0430\u043c\u044f\u0442\u044c \u0432 Linux<\/a>\u200a\u2014\u200a\u0442\u043e\u043b\u044c\u043a\u043e \u0434\u043b\u044f \u043d\u0430\u0441\u0442\u043e\u044f\u0449\u0438\u0445 \u043c\u0443\u0436\u0438\u043a\u043e\u0432<\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/github.com\/kzk\/unicorn-worker-killer\" rel=\"noopener noreferrer nofollow\">Killer \u0434\u043b\u044f unicorn<\/a>\u200a\u2014\u200a\u043e\u043d \u0431\u044b\u043b \u043f\u0435\u0440\u0432\u044b\u043c!<\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/samsaffron.com\/archive\/2015\/03\/31\/debugging-memory-leaks-in-ruby?utm_source=rubyweekly&amp;utm_medium=email\" rel=\"noopener noreferrer nofollow\">\u041a\u0430\u043a \u0434\u0435\u0431\u0430\u0436\u0438\u0442\u044c \u0443\u0442\u0435\u0447\u043a\u0438 \u0432 Ruby<\/a><\/p>\n<\/li>\n<\/ul>\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\/post\/554366\/\"> https:\/\/habr.com\/ru\/post\/554366\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"\n<div class=\"post__text post__text_v2\" id=\"post-content-body\">\n<p>\u0423\u0442\u0435\u0447\u043a\u0438 \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0432 \u0438\/\u0438\u043b\u0438 \u043f\u0430\u043c\u044f\u0442\u0438, \u0430 \u0442\u0430\u043a\u0436\u0435 \u0435\u0451 \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044f \u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u043e\u0431\u044b\u0447\u043d\u043e\u0439 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u043e\u0439 \u0434\u043b\u044f \u0432\u0441\u0435\u0445 \u044f\u0437\u044b\u043a\u043e\u0432 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f. \u041d\u0435\u0432\u0430\u0436\u043d\u043e \u0435\u0441\u0442\u044c \u0442\u0430\u043c \u0441\u0431\u043e\u0440\u0449\u0438\u043a \u043c\u0443\u0441\u043e\u0440\u0430 \u0438\u043b\u0438 \u043d\u0435\u0442, \u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u0443\u0435\u043c\u044b\u0439 \u044f\u0437\u044b\u043a \u0438\u043b\u0438 \u0438\u043d\u0442\u0435\u0440\u043f\u0440\u0435\u0442\u0438\u0440\u0443\u0435\u043c\u044b\u0439. Ruby \u043d\u0435 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435\u043c \u0438 \u0441\u0435\u0433\u043e\u0434\u043d\u044f \u043c\u044b \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u043f\u043e\u0433\u043e\u0432\u043e\u0440\u0438\u043c \u043f\u0440\u043e \u044d\u0442\u0438 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b, \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u044b \u0438\u0445 \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u0438 \u0434\u0430\u0436\u0435 \u043d\u0430\u043f\u0438\u0448\u0435\u043c \u0441\u0432\u043e\u0451 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0435.<\/p>\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<p>\u041f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u043c\u043e\u0436\u0435\u0442 \u043f\u043e\u044f\u0432\u0438\u0442\u044c\u0441\u044f \u0438 \u043f\u043e\u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043a\u043e\u0433\u0434\u0430 \u0443 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c \u043f\u0440\u043e\u0446\u0435\u0441\u0441, \u0437\u0430\u043f\u0443\u0449\u0435\u043d\u043d\u044b\u0439 \u0434\u043b\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0435 \u0432\u0440\u0435\u043c\u044f \u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u044e\u0449\u0438\u0439 \u043c\u043d\u043e\u0433\u043e \u0440\u0430\u0437\u043d\u043e\u043e\u0431\u0440\u0430\u0437\u043d\u043e\u0439 \u0440\u0430\u0431\u043e\u0442\u044b. \u0411\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u043e \u044d\u0442\u0438\u0445 \u043f\u0440\u043e\u0431\u043b\u0435\u043c \u0441\u0432\u044f\u0437\u0430\u043d\u044b \u0441 \u043e\u0448\u0438\u0431\u043a\u0430\u043c\u0438 \u0432 \u043a\u043e\u0434\u0435 \u043f\u0440\u0438 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043a\u043e\u0434 \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0430\u0435\u0442 \u0432\u043f\u043e\u043b\u043d\u0435 \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c \u0441\u0432\u043e\u044e \u0431\u0438\u0437\u043d\u0435\u0441-\u0444\u0443\u043d\u043a\u0446\u0438\u044e. \u0418\u0445 \u043d\u0435 \u0432\u0441\u0435\u0433\u0434\u0430 \u043b\u0435\u0433\u043a\u043e \u043d\u0430\u0439\u0442\u0438 \u0438 \u0438\u0441\u043f\u0440\u0430\u0432\u0438\u0442\u044c. \u0410 \u0432\u043e\u0442 \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044f \u043f\u0430\u043c\u044f\u0442\u0438 \u043f\u043e\u0434\u0436\u0438\u0434\u0430\u0435\u0442 \u043d\u0430\u0441 \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u0441 \u0434\u0440\u0443\u0433\u043e\u0439 \u0441\u0442\u043e\u0440\u043e\u043d\u044b \u0438 \u0434\u0430\u0436\u0435 \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u044b\u0439 \u043a\u043e\u0434 \u043c\u043e\u0436\u0435\u0442 \u043f\u043e\u0441\u0442\u0435\u043f\u0435\u043d\u043d\u043e \u043d\u0430\u043a\u0430\u043f\u043b\u0438\u0432\u0430\u0442\u044c \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u0443\u044e \u043f\u0430\u043c\u044f\u0442\u044c. \u0412 \u043c\u0438\u0440\u0435 Rails \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430\u043c\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u043e\u043f\u0430\u0434\u0430\u044e\u0442 \u043f\u043e\u0434 \u043a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u044e \u201c\u0434\u043e\u043b\u0433\u043e\u0438\u0433\u0440\u0430\u044e\u0449\u0438\u0445\u201d, \u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f, \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e, \u0432\u0435\u0431-\u0441\u0435\u0440\u0432\u0435\u0440 \u0438 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0435 \u043c\u0435\u043d\u0435\u0434\u0436\u0435\u0440\u044b \u0444\u043e\u043d\u043e\u0432\u044b\u0445\/\u043e\u0442\u043b\u043e\u0436\u0435\u043d\u043d\u044b\u0445 \u0437\u0430\u0434\u0430\u0447\u200a\u2014\u200a<code>DelayedJob<\/code>, <code>Sidekiq<\/code> \u0438 \u043f\u0440. \u0412\u043e\u0442 \u043f\u0440\u043e \u043d\u0438\u0445 \u0434\u0430\u043b\u044c\u0448\u0435 \u0438 \u043f\u043e\u0433\u043e\u0432\u043e\u0440\u0438\u043c.<\/p>\n<h4>\u0412\u0435\u0431-\u0441\u0435\u0440\u0432\u0435\u0440<\/h4>\n<p>\u0421\u0430\u043c\u044b\u043c \u043d\u0430\u0434\u0451\u0436\u043d\u044b\u043c \u0441\u043f\u043e\u0441\u043e\u0431\u043e\u043c \u201c\u043e\u0442\u0434\u0430\u0442\u044c\u201d \u043f\u0430\u043c\u044f\u0442\u044c \u0441\u0438\u0441\u0442\u0435\u043c\u0435 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u0435 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430. \u0414\u043b\u044f \u043c\u043d\u043e\u0433\u0438\u0445 \u0441\u0435\u0440\u0432\u0435\u0440\u043e\u0432 \u0443\u0436\u0435 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u044b \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0435 \u043f\u043b\u0430\u0433\u0438\u043d\u044b\/\u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0440\u0435\u0448\u0430\u044e\u0442 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b \u0441 \u043f\u0430\u043c\u044f\u0442\u044c\u044e \u043f\u0443\u0442\u0435\u043c \u043f\u0435\u0440\u0438\u043e\u0434\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u043f\u0435\u0440\u0435\u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u0440\u0430\u0431\u043e\u0447\u0438\u0445 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0432 (puma, unicorn), \u0430 \u0432 <a href=\"https:\/\/www.phusionpassenger.com\/\" rel=\"noopener noreferrer nofollow\">Phusion Passenger<\/a> \u044d\u0442\u043e \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043e \u0432 \u0441\u0430\u043c \u0441\u0435\u0440\u0432\u0435\u0440. \u0423 \u043d\u0430\u0441 \u0432 \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u0438 \u0438\u043c\u0435\u043d\u043d\u043e \u201c\u043f\u0430\u0441\u0441\u0430\u0436\u0438\u0440\u201d \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u043c \u0432\u0435\u0431-\u0441\u0435\u0440\u0432\u0435\u0440\u043e\u043c, \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u043a\u0440\u0443\u0442\u044f\u0442\u0441\u044f \u0432\u0441\u0435 \u043d\u0430\u0448\u0438 Rails-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f. \u041a\u043e\u043c\u0443 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e \u0431\u043e\u043b\u0435\u0435 \u0434\u0435\u0442\u0430\u043b\u044c\u043d\u043e \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u043d\u0430 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u044f, \u0434\u043e\u0431\u0440\u043e \u043f\u043e\u0436\u0430\u043b\u043e\u0432\u0430\u0442\u044c:<\/p>\n<ul>\n<li>\n<p><a href=\"https:\/\/about.gitlab.com\/blog\/2015\/06\/05\/how-gitlab-uses-unicorn-and-unicorn-worker-killer\/\" rel=\"noopener noreferrer nofollow\">https:\/\/about.gitlab.com\/blog\/2015\/06\/05\/how-gitlab-uses-unicorn-and-unicorn-worker-killer\/<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/github.com\/schneems\/puma_worker_killer\" rel=\"noopener noreferrer nofollow\">https:\/\/github.com\/schneems\/puma_worker_killer<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/docs.gitlab.com\/ee\/administration\/operations\/sidekiq_memory_killer.html\" rel=\"noopener noreferrer nofollow\">https:\/\/docs.gitlab.com\/ee\/administration\/operations\/sidekiq_memory_killer.html<\/a><\/p>\n<\/li>\n<\/ul>\n<p>\u0410\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u044b, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u044b\u0435 \u0432 \u0442\u0430\u043a\u0438\u0445 \u201c\u043f\u0435\u0440\u0435\u0437\u0430\u043f\u0443\u0441\u043a\u0430\u043b\u044c\u0449\u0438\u043a\u0430\u0445\u201d \u0432 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u043c \u0431\u0430\u0437\u0438\u0440\u0443\u044e\u0442\u0441\u044f \u043d\u0430 \u0434\u0432\u0443\u0445 \u043a\u0440\u0438\u0442\u0435\u0440\u0438\u044f\u0445\u200a\u2014\u200a\u0447\u0438\u0441\u043b\u043e \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0430\u043d\u043d\u044b\u0445 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u0438 \u043f\u043e\u0442\u0440\u0435\u0431\u043b\u0451\u043d\u043d\u0430\u044f \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u043c \u043f\u0430\u043c\u044f\u0442\u044c. \u0421 \u0447\u0438\u0441\u043b\u043e\u043c \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u0432\u0441\u0451 \u043f\u0440\u043e\u0441\u0442\u043e\u200a\u2014\u200a\u0432 \u043a\u0430\u0436\u0434\u043e\u043c \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0435 \u0441\u0447\u0438\u0442\u0430\u0435\u043c \u043a\u0430\u0436\u0434\u044b\u0439 \u0437\u0430\u043f\u0440\u043e\u0441 \u0438 \u043f\u043e \u0434\u043e\u0441\u0442\u0438\u0436\u0435\u043d\u0438\u0438 \u043b\u0438\u043c\u0438\u0442\u0430\u200a\u2014\u200a\u043f\u0435\u0440\u0435\u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c\u0441\u044f. \u0410 \u0432\u043e\u0442 \u0441 \u043f\u0430\u043c\u044f\u0442\u044c\u044e \u0432\u0441\u0435 \u043e\u0431\u0441\u0442\u043e\u0438\u0442 \u043a\u0443\u0434\u0430 \u0445\u0443\u0436\u0435\u200a\u2014\u200a\u043f\u043e\u0442\u0440\u0435\u0431\u043b\u0451\u043d\u043d\u0443\u044e \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u043c \u043f\u0430\u043c\u044f\u0442\u044c \u043c\u043e\u0436\u043d\u043e <a href=\"https:\/\/utcc.utoronto.ca\/~cks\/space\/blog\/unix\/UnderstandingRSS\" rel=\"noopener noreferrer nofollow\">\u043f\u043e\u0441\u0447\u0438\u0442\u0430\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u0440\u0438\u0431\u043b\u0438\u0437\u0438\u0442\u0435\u043b\u044c\u043d\u043e<\/a> \u0438 Passenger \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u0435\u0442 <a href=\"https:\/\/www.phusionpassenger.com\/library\/config\/standalone\/reference\/#--memory-limit-memory_limit\" rel=\"noopener noreferrer nofollow\">\u0442\u0430\u043a\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b<\/a> \u0442\u043e\u043b\u044c\u043a\u043e \u0432 Enterprise \u0432\u0435\u0440\u0441\u0438\u0438.<\/p>\n<h4>\u041c\u0435\u043d\u0435\u0434\u0436\u0435\u0440 \u0444\u043e\u043d\u043e\u0432\u044b\u0445&nbsp;\u0437\u0430\u0434\u0430\u0447<\/h4>\n<p>\u041a\u0430\u043a-\u0442\u043e \u0442\u0430\u043a \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u043e\u0441\u044c, \u0447\u0442\u043e \u044f \u044f\u0432\u043b\u044f\u044e\u0441\u044c \u044f\u0440\u044b\u043c \u0435\u0432\u0430\u043d\u0433\u0435\u043b\u0438\u0441\u0442\u043e\u043c <code>DelayedJob<\/code>, \u0430 \u0442\u043e\u0447\u043d\u0435\u0435 <code>ActiveJob<\/code>(\u0447\u0442\u043e\u0431 \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u043f\u0440\u043e\u0431\u043b\u0435\u043c \u0441 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c\u044e \u043c\u043e\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u043f\u0435\u0440\u0435\u0431\u0440\u0430\u0442\u044c\u0441\u044f \u201c\u043d\u0430 \u044d\u0442\u043e\u0442 \u0432\u0430\u0448 \u0441\u0430\u0439\u0434\u043a\u0438\u043a\u201d \u0431\u0435\u0437 \u043f\u0440\u043e\u0431\u043b\u0435\u043c). \u041d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435 \u043d\u0435\u0442 \u043e\u0441\u043e\u0431\u043e\u0439 \u0440\u0430\u0437\u043d\u0438\u0446\u044b \u043a\u0430\u043a\u043e\u0439 \u0438\u043c\u0435\u043d\u043d\u043e \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u200a\u2014\u200a\u043f\u0440\u0438\u043d\u0446\u0438\u043f \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u043d\u0430\u0448\u0435\u0439 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b \u043e\u0442 \u044d\u0442\u043e\u0433\u043e \u043d\u0435 \u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f\u200a\u2014\u200a\u043f\u0435\u0440\u0435\u0437\u0430\u043f\u0443\u0441\u043a \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430. \u0414\u043b\u044f <code>Sidekiq<\/code> <a href=\"https:\/\/github.com\/klaxit\/sidekiq-worker-killer\" rel=\"noopener noreferrer nofollow\">\u0443\u0436\u0435 \u0435\u0441\u0442\u044c \u0440\u0435\u0448\u0435\u043d\u0438\u0435<\/a>, \u0430 \u0434\u043b\u044f <code>DelayedJob<\/code> \u0435\u0449\u0435 \u043d\u0435\u0442!<\/p>\n<p>\u0412\u043d\u0438\u043c\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0432 \u0438 \u043f\u043e\u0434\u0443\u043c\u0430\u0432 \u043d\u0430\u0434 \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u0435\u0439 \u043c\u044b \u0440\u0435\u0448\u0438\u043b\u0438 \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0441\u0432\u043e\u0451 <a href=\"https:\/\/github.com\/RND-SOFT\/worker_killer\" rel=\"noopener noreferrer nofollow\">\u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u0435<\/a> \u0434\u043b\u044f \u043d\u0430\u0448\u0435\u0433\u043e \u043b\u044e\u0431\u0438\u043c\u043e\u0433\u043e \u0432\u0435\u0431-\u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u0438 \u043c\u043e\u0435\u0433\u043e \u043b\u044e\u0431\u0438\u043c\u043e\u0433\u043e <code>DelayedJob <\/code>\u0438 \u043d\u0430\u0437\u0432\u0430\u043b\u0438 \u0435\u0433\u043e <code>WorkerKiller<\/code>\u200a\u2014\u200a<a href=\"https:\/\/github.com\/RND-SOFT\/worker_killer\" rel=\"noopener noreferrer nofollow\">\u0432\u0441\u0442\u0440\u0435\u0447\u0430\u0439\u0442\u0435!<\/a><\/p>\n<h4>\u041a\u0430\u043a \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0440\u043e\u0441\u043a\u043e\u0448\u043d\u044b\u0439 \u0432\u0435\u043b\u043e\u0441\u0438\u043f\u0435\u0434?<\/h4>\n<p>\u041d\u0430\u0447\u0438\u043d\u0430\u0435\u0442\u0441\u044f \u0432\u0441\u0451 \u0441 <code>middleware<\/code>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442 \u0430\u043d\u0430\u043b\u0438\u0437 \u043a\u0440\u0438\u0442\u0435\u0440\u0438\u0435\u0432, \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0445 \u0434\u043b\u044f \u043f\u0435\u0440\u0435\u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043f\u0435\u0440\u0435\u0434\u0430\u043d\u043d\u043e\u0439 \u0441\u0442\u0440\u0430\u0442\u0435\u0433\u0438\u0438.<\/p>\n<p><iframe id=\"60866808388fa3867a8ff43b\" src=\"https:\/\/embedd.srv.habr.com\/iframe\/60866808388fa3867a8ff43b\" class=\"embed_video embed__content\" allowfullscreen=\"true\"><\/iframe><\/p>\n<p>\u0415\u0441\u043b\u0438 \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u0441\u0447\u0438\u0442\u0430\u0442\u044c \u0432\u0435\u0441\u044c\u043c\u0430 \u0434\u0451\u0448\u0435\u0432\u043e \u0441 \u0442\u043e\u0447\u043a\u0438 \u0437\u0440\u0435\u043d\u0438\u044f CPU, \u0442\u043e \u0441 \u043f\u0430\u043c\u044f\u0442\u044c\u044e \u0441\u043b\u043e\u0436\u043d\u0435\u0435. \u041e\u0434\u043d\u0430\u043a\u043e \u043d\u0430\u043c \u043d\u0435 \u043d\u0443\u0436\u043d\u043e \u0447\u0451\u0442\u043a\u043e \u0443\u043a\u043b\u0430\u0434\u044b\u0432\u0430\u0442\u044c\u0441\u044f \u0432 \u043b\u0438\u043c\u0438\u0442\u044b\u200a\u2014\u200a\u043d\u0438\u0447\u0435\u0433\u043e \u0441\u0442\u0440\u0430\u0448\u043d\u043e\u0433\u043e, \u0435\u0441\u043b\u0438 \u043d\u0430\u0448\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043d\u0430 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u0431\u043e\u043b\u044c\u0448\u0435, \u0447\u0435\u043c \u043c\u044b \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0438\u043b\u0438 \u0438\u043b\u0438 \u043e\u0442\u044a\u0435\u0441\u0442 \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u0431\u043e\u043b\u044c\u0448\u0435 \u043f\u0430\u043c\u044f\u0442\u0438 \u043f\u0435\u0440\u0435\u0434 \u043f\u0435\u0440\u0435\u0437\u0430\u043f\u0443\u0441\u043a\u043e\u043c, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0440\u0430\u0441\u0447\u0435\u0442 \u043f\u0430\u043c\u044f\u0442\u0438 \u0431\u0443\u0434\u0435\u043c \u0434\u0435\u043b\u0430\u0442\u044c \u201c\u043f\u0435\u0440\u0438\u043e\u0434\u0438\u0447\u0435\u0441\u043a\u0438&#187;\u200a\u2014\u200a\u0441 \u044d\u0442\u0438\u043c \u043d\u0430\u043c \u043f\u043e\u043c\u043e\u0436\u0435\u0442 <code>Limiter<\/code>.<\/p>\n<p><iframe id=\"60866870d990706d645cc0d3\" src=\"https:\/\/embedd.srv.habr.com\/iframe\/60866870d990706d645cc0d3\" class=\"embed_video embed__content\" allowfullscreen=\"true\"><\/iframe><\/p>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043f\u0440\u043e \u0441\u0430\u043c \u043f\u0435\u0440\u0435\u0437\u0430\u043f\u0443\u0441\u043a\u200a\u2014\u200a\u043d\u0430\u043c \u043d\u0443\u0436\u0435\u043d <code>Killer<\/code>. \u0421\u043d\u0430\u0447\u0430\u043b\u0430 \u043c\u044b \u043f\u043e\u0448\u043b\u0438 \u043f\u043e \u043f\u0443\u0442\u0438 <code>unicorn\u200a<\/code>\u2014\u200a\u043f\u0440\u043e\u0446\u0435\u0441\u0441 <a href=\"https:\/\/github.com\/kzk\/unicorn-worker-killer\/blob\/bdec225f028d1bda01b5888578c479b0c705f1a8\/lib\/unicorn\/worker_killer.rb#L15\" rel=\"noopener noreferrer nofollow\">\u043f\u043e\u0441\u044b\u043b\u0430\u043b \u0441\u0435\u0431\u0435 SIGTERM<\/a>. \u041f\u0440\u0438 \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0435 \u0432\u0441\u0435 \u0431\u044b\u043b\u043e \u0445\u043e\u0440\u043e\u0448\u043e\u200a\u2014\u200a\u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u0437\u0430\u0432\u0435\u0440\u0448\u0430\u043b\u0441\u044f, \u0430 Passenger Master Process \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u043b \u043d\u043e\u0432\u044b\u0439 \u0435\u043c\u0443 \u043d\u0430 \u0437\u0430\u043c\u0435\u043d\u0443. \u041d\u043e \u043f\u0440\u0438 \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0438 \u0438 \u0431\u0435\u043d\u0447\u043c\u0430\u0440\u043a\u0438\u043d\u0433\u0435 <a href=\"https:\/\/github.com\/yandex\/yandex-tank\" rel=\"noopener noreferrer nofollow\">\u042f\u043d\u0434\u0435\u043a\u0441 \u0422\u0430\u043d\u043a\u043e\u043c<\/a> \u043e\u043a\u0430\u0437\u0430\u043b\u043e\u0441\u044c, \u0447\u0442\u043e \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u0442\u0435\u0440\u044f\u044e\u0442\u0441\u044f \u0437\u0430\u043f\u0440\u043e\u0441\u044b, \u043d\u0430\u0445\u043e\u0434\u044f\u0449\u0438\u0435\u0441\u044f \u201cinflight\u201d \u043c\u0435\u0436\u0434\u0443 \u043f\u0430\u0441\u0441\u0430\u0436\u0438\u0440\u043e\u043c \u0438 \u0437\u0430\u0432\u0435\u0440\u0448\u0451\u043d\u043d\u044b\u043c \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u043c. \u041d\u0435\u043c\u043d\u043e\u0433\u043e \u043f\u043e\u043a\u043e\u043f\u0430\u0432 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044e, \u0431\u044b\u043b \u043d\u0430\u0439\u0434\u0435\u043d \u0441\u043f\u043e\u0441\u043e\u0431 \u0437\u0430\u0432\u0435\u0440\u0448\u0430\u0442\u044c \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e:<\/p>\n<pre><code class=\"bash\">passenger-config detach-process &lt;PID&gt;<\/code><\/pre>\n<p>\u041f\u0440\u0438 \u044d\u0442\u043e\u043c \u043d\u0435\u0442 \u0430\u0431\u0441\u043e\u043b\u044e\u0442\u043d\u043e \u043d\u0438\u043a\u0430\u043a\u043e\u0439 \u043f\u0440\u043e\u0441\u0430\u0434\u043a\u0438 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438, \u0434\u0430\u0436\u0435 \u0435\u0441\u043b\u0438 \u043c\u044b \u0448\u043b\u0435\u043c 500 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u0432 \u0441\u0435\u043a\u0443\u043d\u0434\u0443, \u0430 \u0440\u0435\u0441\u0442\u0430\u0440\u0442\u0443\u0435\u043c \u0447\u0435\u0440\u0435\u0437 \u043a\u0430\u0436\u0434\u044b\u0435 100. \u042d\u0442\u043e \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e Passenger \u043e\u0447\u0435\u043d\u044c \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u0442 \u043f\u0435\u0440\u0435\u0437\u0430\u043f\u0443\u0441\u043a\u200a\u2014\u200a\u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u043e\u043d \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442 \u043d\u043e\u0432\u044b\u0439 \u043f\u0440\u043e\u0446\u0435\u0441\u0441-\u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a, \u043f\u043e\u0442\u043e\u043c \u043e\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u0442 \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u0441\u0442\u0430\u0440\u043e\u043c\u0443, \u0434\u043e\u0436\u0438\u0434\u0430\u0435\u0442\u0441\u044f \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0432\u0441\u0435\u0439 \u0435\u0433\u043e \u043e\u0447\u0435\u0440\u0435\u0434\u0438 \u0438 \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u043e\u0442\u043e\u043c \u0437\u0430\u0432\u0435\u0440\u0448\u0430\u0435\u0442 \u043f\u0440\u043e\u0446\u0435\u0441\u0441.<\/p>\n<p><iframe id=\"608668b229e351865d365482\" src=\"https:\/\/embedd.srv.habr.com\/iframe\/608668b229e351865d365482\" class=\"embed_video embed__content\" allowfullscreen=\"true\"><\/iframe><\/p>\n<p>\u0420\u0430\u0437\u0440\u044f\u0434!<\/p>\n<p><iframe id=\"608668cc563ace6d7a18d831\" src=\"https:\/\/embedd.srv.habr.com\/iframe\/608668cc563ace6d7a18d831\" class=\"embed_video embed__content\" allowfullscreen=\"true\"><\/iframe><\/p>\n<p>\u0421 \u0432\u0435\u0431-\u0441\u0435\u0440\u0432\u0435\u0440\u043e\u043c, \u043a\u0430\u0436\u0435\u0442\u0441\u044f, \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u043b\u0438\u0441\u044c, \u0434\u0430\u043b\u044c\u0448\u0435 &#8212; <code>DelayedJob<\/code>. \u0423 \u043d\u0435\u0433\u043e \u043f\u0440\u0438\u043c\u0438\u0442\u0438\u0432\u043d\u0430\u044f \u0441\u0438\u0441\u0442\u0435\u043c\u0430 \u043f\u043b\u0430\u0433\u0438\u043d\u043e\u0432, \u043e\u0441\u043d\u043e\u0432\u0430\u043d\u043d\u0430\u044f \u043d\u0430 \u0445\u0443\u043a\u0430\u0445, \u043d\u043e \u0432\u043e\u0442 \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0442\u044c \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u0432 \u043f\u043b\u0430\u0433\u0438\u043d\u044b \u043d\u0435 \u043e\u0447\u0435\u043d\u044c \u0443\u0434\u043e\u0431\u043d\u043e.<\/p>\n<p><iframe id=\"608668e393c5636d47c919d8\" src=\"https:\/\/embedd.srv.habr.com\/iframe\/608668e393c5636d47c919d8\" class=\"embed_video embed__content\" allowfullscreen=\"true\"><\/iframe><\/p>\n<p>\u0420\u0430\u0437\u0440\u044f\u0434!<\/p>\n<p><iframe id=\"608668f7388fa3867a8ff43c\" src=\"https:\/\/embedd.srv.habr.com\/iframe\/608668f7388fa3867a8ff43c\" class=\"embed_video embed__content\" allowfullscreen=\"true\"><\/iframe><\/p>\n<p><strong>\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442<\/strong><\/p>\n<p>\u0427\u0442\u043e \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u0438 \u0432 \u043a\u043e\u043d\u0446\u0435? \u041f\u0440\u0435\u0436\u0434\u0435 \u0432\u0441\u0435\u0433\u043e \u043c\u044b \u0437\u0430\u043f\u0438\u043b\u0438\u043b\u0438 \u0441\u0432\u043e\u0439 <a href=\"https:\/\/github.com\/RND-SOFT\/worker_killer\" rel=\"noopener noreferrer nofollow\">\u0433\u0435\u043c WorkerKiller<\/a> ? \u041a\u0440\u043e\u043c\u0435 \u0442\u043e\u0433\u043e, \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u0438 \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u0438 \u043d\u0430\u0434\u0451\u0436\u043d\u044b\u0439 \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u043f\u0440\u043e\u0431\u043b\u0435\u043c \u0441 \u043f\u0430\u043c\u044f\u0442\u044c\u044e \u0447\u0435\u0440\u0435\u0437 \u043f\u0435\u0440\u0435\u0437\u0430\u043f\u0443\u0441\u043a \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0432. \u0422\u0443\u0442 \u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u043e\u0433\u043e\u0432\u043e\u0440\u0438\u0442\u044c\u0441\u044f\u200a\u2014\u200a\u0435\u0441\u043b\u0438 \u0443 \u0432\u0430\u0441 \u0432 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0438 \u0435\u0441\u0442\u044c \u0443\u0442\u0435\u0447\u043a\u0438 \u043f\u0430\u043c\u044f\u0442\u0438, \u0442\u043e \u0442\u0430\u043a\u043e\u0439 \u043f\u043e\u0434\u0445\u043e\u0434 \u0437\u0430\u043c\u0430\u0441\u043a\u0438\u0440\u0443\u0435\u0442 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0443 \u043d\u0435 \u0440\u0435\u0448\u0438\u0432 \u0435\u0451 \u043e\u043a\u043e\u043d\u0447\u0430\u0442\u0435\u043b\u044c\u043d\u043e, \u0438 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u0432\u0441\u0451 \u0440\u0430\u0432\u043d\u043e \u0432\u0430\u0441 \u0434\u043e\u0433\u043e\u043d\u0438\u0442 \u0438 \u043d\u0430\u043f\u043e\u0434\u0434\u0430\u0441\u0442 \u0432\u0430\u043c \u0432 \u0432\u0438\u0434\u0435 \u043f\u0430\u0434\u0435\u043d\u0438\u044f \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438, \u0447\u0440\u0435\u0437\u043c\u0435\u0440\u043d\u043e\u0439 \u043f\u0440\u043e\u0436\u043e\u0440\u043b\u0438\u0432\u043e\u0441\u0442\u0438 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0438\u043b\u0438 \u0440\u0435\u0434\u043a\u0438\u0445 \u043f\u043b\u0430\u0432\u0430\u044e\u0449\u0438\u0445 \u0431\u0430\u0433\u043e\u0432. \u0422\u0430\u043a \u0447\u0442\u043e \u0435\u0441\u043b\u0438 \u0432\u044b \u0437\u043d\u0430\u0435\u0442\u0435 \u0447\u0442\u043e \u0443 \u0432\u0430\u0441 \u0435\u0441\u0442\u044c \u0441\u0435\u0440\u044c\u0451\u0437\u043d\u044b\u0435 \u0443\u0442\u0435\u0447\u043a\u0438\u200a\u2014\u200a\u0437\u0430\u0439\u043c\u0438\u0442\u0435\u0441\u044c \u043f\u0440\u043e\u0444\u0438\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435\u043c, \u0430 \u043d\u0435 \u0442\u0443\u0448\u0438\u0442\u0435 \u043e\u0433\u043e\u043d\u044c \u043f\u0438\u0440\u043e\u0433\u0430\u043c\u0438.<\/p>\n<figure class=\"full-width\"><figcaption>Band-Aid on a bullet&nbsp;wound<\/figcaption><\/figure>\n<p><strong>\u0421\u0441\u044b\u043b\u043a\u0438<\/strong><\/p>\n<p>\u041c\u043d\u043e\u0433\u043e \u0432\u0441\u044f\u043a\u0438\u0445 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u044b\u0445 \u0441\u0441\u044b\u043b\u043e\u043a, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0440\u0435\u0448\u0438\u043b \u043f\u0440\u0438\u0432\u0435\u0441\u0442\u0438 \u0438\u0445 \u0432 \u043a\u043e\u043d\u0446\u0435:<\/p>\n<ul>\n<li>\n<p><a href=\"https:\/\/about.gitlab.com\/blog\/2015\/06\/05\/how-gitlab-uses-unicorn-and-unicorn-worker-killer\/\" rel=\"noopener noreferrer nofollow\">\u041f\u0440\u043e Giltab \u0438 Unicorn killer<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/docs.gitlab.com\/ee\/administration\/operations\/sidekiq_memory_killer.html\" rel=\"noopener noreferrer nofollow\">\u041f\u0440\u043e Gitlab \u0438 Sidekiq killer<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/github.com\/schneems\/puma_worker_killer\" rel=\"noopener noreferrer nofollow\">Killer \u0434\u043b\u044f puma<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/utcc.utoronto.ca\/~cks\/space\/blog\/unix\/UnderstandingRSS\" rel=\"noopener noreferrer nofollow\">\u041f\u0440\u043e \u0442\u043e \u043a\u0430\u043a \u0441\u0447\u0438\u0442\u0430\u0442\u044c \u043f\u0430\u043c\u044f\u0442\u044c \u0432 Linux<\/a>\u200a\u2014\u200a\u0442\u043e\u043b\u044c\u043a\u043e \u0434\u043b\u044f \u043d\u0430\u0441\u0442\u043e\u044f\u0449\u0438\u0445 \u043c\u0443\u0436\u0438\u043a\u043e\u0432<\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/github.com\/kzk\/unicorn-worker-killer\" rel=\"noopener noreferrer nofollow\">Killer \u0434\u043b\u044f unicorn<\/a>\u200a\u2014\u200a\u043e\u043d \u0431\u044b\u043b \u043f\u0435\u0440\u0432\u044b\u043c!<\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/samsaffron.com\/archive\/2015\/03\/31\/debugging-memory-leaks-in-ruby?utm_source=rubyweekly&amp;utm_medium=email\" rel=\"noopener noreferrer nofollow\">\u041a\u0430\u043a \u0434\u0435\u0431\u0430\u0436\u0438\u0442\u044c \u0443\u0442\u0435\u0447\u043a\u0438 \u0432 Ruby<\/a><\/p>\n<\/li>\n<\/ul>\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\/post\/554366\/\"> https:\/\/habr.com\/ru\/post\/554366\/<\/a><br \/><\/br><\/br><\/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-322086","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/322086","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=322086"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/322086\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=322086"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=322086"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=322086"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}