{"id":315995,"date":"2021-01-05T15:01:11","date_gmt":"2021-01-05T15:01:11","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=315995"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=315995","title":{"rendered":"\u041f\u0440\u043e\u0444\u0438\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0432 \u043e\u0431\u043b\u0430\u043a\u0435 \u0438 \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e"},"content":{"rendered":"\n<div class=\"post__text post__text-html post__text_v1\" id=\"post-content-body\">\n<p>\u041f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435, \u043e\u043f\u0442\u0438\u043c\u0430\u043b\u044c\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0449\u0435\u0435 \u0432\u044b\u0447\u0438\u0441\u043b\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u0440\u0435\u0441\u0443\u0440\u0441\u044b, \u044d\u0442\u043e \u0432\u0441\u0435\u0433\u0434\u0430 \u0445\u043e\u0440\u043e\u0448\u043e \u0438 \u043f\u0440\u0438\u044f\u0442\u043d\u043e. \u0410 \u0435\u0441\u043b\u0438 \u0442\u0430\u043a\u043e\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0432 \u043e\u0431\u043b\u0430\u043a\u0435, \u0442\u043e \u0435\u0449\u0451 \u0438 \u0432\u044b\u0433\u043e\u0434\u043d\u043e. \u041f\u043e\u0440\u043e\u0439 \u043e\u0447\u0435\u043d\u044c \u0432\u044b\u0433\u043e\u0434\u043d\u043e. \u041f\u0440\u043e\u0441\u0442\u043e \u043f\u043e\u0442\u043e\u043c\u0443, \u0447\u0442\u043e \u0432 \u043e\u0434\u0438\u043d \u043a\u0432\u0430\u043d\u0442 \u043e\u043f\u043b\u0430\u0447\u0435\u043d\u043d\u043e\u0433\u043e \u043e\u0431\u043b\u0430\u0447\u043d\u043e\u0433\u043e \u0432\u044b\u0447\u0438\u0441\u043b\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0433\u043e \u0440\u0435\u0441\u0443\u0440\u0441\u0430 \u0432\u043b\u0435\u0437\u0430\u0435\u0442, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0431\u043e\u043b\u044c\u0448\u0435 \u043f\u043e\u043a\u0430\u0437\u0430\u043d\u043d\u044b\u0445 \u0432 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0435 \u043a\u043e\u0442\u0438\u043a\u043e\u0432 \u0432\u043c\u0435\u0441\u0442\u0435 \u0441 \u0440\u0435\u043a\u043b\u0430\u043c\u043e\u0439 \u0438\u043b\u0438 \u043f\u043b\u0430\u0442\u0451\u0436\u043d\u044b\u0445 \u0442\u0440\u0430\u043d\u0437\u0430\u043a\u0446\u0438\u0439 \u0437\u0430 \u043f\u043e\u0434\u043f\u0438\u0441\u043a\u0438 \u043d\u0430 \u0442\u0435\u0445 \u0436\u0435 \u043a\u043e\u0442\u0438\u043a\u043e\u0432. \u0418 \u0435\u0441\u043b\u0438 \u0441 \u043f\u0440\u043e\u0444\u0438\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435\u043c Go \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439 <a href=\"https:\/\/blog.golang.org\/pprof\" rel=\"nofollow\">\u0432\u0441\u0451 \u0431\u043e\u043b\u0435\u0435 \u0438\u043b\u0438 \u043c\u0435\u043d\u0435\u0435 \u043f\u043e\u043d\u044f\u0442\u043d\u043e<\/a>, \u0442\u043e \u0434\u043b\u044f \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439, \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u0445 \u043d\u0430 C \u0438\u043b\u0438 C++, \u0432\u0441\u0451 \u0433\u043e\u0440\u0430\u0437\u0434\u043e \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u0435\u0435.<\/p>\n<p>  <\/p>\n<p>\u0422\u0430\u043a \u043a\u0430\u043a \u0431\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u043e \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\u0430\u0442\u0435\u0440\u0438\u0430\u043b\u0438\u0437\u0443\u044e\u0442\u0441\u044f, \u043a\u0430\u043a \u043f\u0440\u0430\u0432\u0438\u043b\u043e, \u0432 \u043f\u0440\u043e\u0434\u0430\u043a\u0448\u0435\u043d\u0435, \u0442\u043e \u043d\u0430\u0441 \u0431\u0443\u0434\u0443\u0442 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043e\u0432\u0430\u0442\u044c \u0442\u0435 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0435 \u0442\u0440\u0435\u0431\u0443\u044e\u0442 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043a\u043e\u0434\u0430 \u0438, \u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e, \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 \u0438 \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. \u041a\u0440\u043e\u043c\u0435 \u0442\u043e\u0433\u043e, \u044f \u043d\u0435 \u0431\u0443\u0434\u0443 \u0443\u043f\u043e\u043c\u0438\u043d\u0430\u0442\u044c \u043f\u0440\u043e\u0444\u0438\u043b\u0438\u0440\u043e\u0432\u0449\u0438\u043a\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0430\u043d\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u044e\u0442 \u0440\u0430\u0431\u043e\u0442\u0443 \u043a\u043e\u0434\u0430 \u043d\u0430 \u0443\u0440\u043e\u0432\u043d\u0435 \u043c\u0438\u043a\u0440\u043e\u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u044b \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u0430 \u0442\u0438\u043f\u0430 vTune. \u0412\u043e-\u043f\u0435\u0440\u0432\u044b\u0445, \u043d\u0430 \u044d\u0442\u0443 \u0442\u0435\u043c\u0443 \u0441\u0442\u0430\u0442\u0435\u0439 \u0438 \u0442\u0430\u043a \u0445\u0432\u0430\u0442\u0430\u0435\u0442. \u0412\u043e-\u0432\u0442\u043e\u0440\u044b\u0445, \u044f \u043e\u0448\u0438\u0431\u043e\u0447\u043d\u043e \u043f\u043e\u043b\u0430\u0433\u0430\u044e, \u0447\u0442\u043e \u0432\u043e\u043f\u0440\u043e\u0441\u044b \u043c\u0438\u043a\u0440\u043e\u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u044b \u0431\u043e\u043b\u044c\u0448\u0435 \u0430\u043a\u0442\u0443\u0430\u043b\u044c\u043d\u044b \u0434\u043b\u044f \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u043e\u0432 middleware \u0442\u0438\u043f\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u043e\u0432 \u0431\u0430\u0437 \u0434\u0430\u043d\u043d\u044b\u0445 \u0438\u043b\u0438 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0430\u0441\u0442\u043e\u043b\u044c\u043a\u043e \u043a\u0440\u0443\u0442\u044b, \u0447\u0442\u043e \u0425\u0430\u0431\u0440 \u043d\u0435 \u0447\u0438\u0442\u0430\u044e\u0442. <a name=\"habracut\"><\/a>\u0418\u0442\u0430\u043a.<\/p>\n<p>  <\/p>\n<p>\u0414\u043e \u043d\u0435\u0434\u0430\u0432\u043d\u0435\u0433\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u043e\u0434\u043d\u0438\u043c \u0438\u0437 \u0442\u0430\u043a\u0438\u0445 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u043e\u0432 \u0431\u044b\u043b\u0438 <a href=\"https:\/\/github.com\/gperftools\/gperftools\" rel=\"nofollow\">Google perftools<\/a>. \u041e\u043d\u0438 \u0432\u043a\u043b\u044e\u0447\u0430\u044e\u0442 \u0434\u0432\u0430 \u043f\u0440\u043e\u0444\u0438\u043b\u0438\u0440\u043e\u0432\u0449\u0438\u043a\u0430: \u0434\u043b\u044f CPU \u0438 \u0434\u043b\u044f \u043e\u043f\u0435\u0440\u0430\u0442\u0438\u0432\u043d\u043e\u0439 \u043f\u0430\u043c\u044f\u0442\u0438. \u041d\u0430\u0447\u043d\u0451\u043c \u0441 \u043f\u0435\u0440\u0432\u043e\u0433\u043e.<\/p>\n<p>  <\/p>\n<p>\u0427\u0442\u043e\u0431\u044b \u0432\u0430\u0448\u0430 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430 \u0441\u0442\u0430\u043b\u0430 \u043f\u0440\u043e\u0444\u0438\u043b\u0438\u0440\u0443\u0435\u043c\u043e\u0439, \u0435\u0451 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0441\u043b\u0438\u043d\u043a\u043e\u0432\u0430\u0442\u044c \u0432\u043c\u0435\u0441\u0442\u0435 \u0441 \u043f\u0440\u043e\u0444\u0438\u043b\u0438\u0440\u043e\u0432\u0449\u0438\u043a\u043e\u043c. \u041c\u043e\u0436\u043d\u043e \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438, \u043c\u043e\u0436\u043d\u043e \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u0438 \u0438\u043b\u0438 \u0436\u0435 \u0432\u043e\u043e\u0431\u0449\u0435 \u043f\u043e\u0434\u0433\u0440\u0443\u0437\u0438\u0442\u044c \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 <code>LD_PRELOAD<\/code>. \u0415\u0433\u043e \u0440\u0430\u0437\u043c\u0435\u0440 \u0441\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u043e\u043a\u043e\u043b\u043e 60k, \u0438 \u043e\u043d \u0431\u043e\u043b\u0435\u0435 \u043d\u0438\u043a\u0430\u043a \u043d\u0435 \u043d\u0430\u0433\u0440\u0443\u0436\u0430\u0435\u0442 \u0441\u0438\u0441\u0442\u0435\u043c\u0443, \u043a\u043e\u0433\u0434\u0430 \u043d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f. \u0422\u0430\u043a \u0447\u0442\u043e \u0432\u0441\u0435\u0433\u0434\u0430 \u043b\u0438\u043d\u043a\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0441 \u043d\u0438\u043c \u043d\u0430 \u0431\u043e\u0435\u0432\u044b\u0445 \u0441\u0435\u0440\u0432\u0435\u0440\u0430\u0445 \u0431\u0443\u0434\u0435\u0442 \u043d\u0435 \u0441\u043b\u0438\u0448\u043a\u043e\u043c \u043d\u0430\u043a\u043b\u0430\u0434\u043d\u043e. \u0410\u043a\u0442\u0438\u0432\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u043e\u043d \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u043e\u0439 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f <code>CPUPROFILE<\/code>:<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">$ CPUPROFILE=\/tmp\/envoy.prof envoy --concurrency 1 -c \/path\/to\/config.yaml<\/code><\/pre>\n<p>  <\/p>\n<p>\u0412 \u044d\u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0430 \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u0442 \u0441\u043e\u0431\u0438\u0440\u0430\u0442\u044c\u0441\u044f \u0441 \u043c\u043e\u043c\u0435\u043d\u0442\u0430 \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u0438\u0441\u043f\u043e\u043b\u043d\u044f\u0435\u043c\u043e\u0433\u043e \u0444\u0430\u0439\u043b\u0430. \u0415\u0441\u043b\u0438 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c <code>CPUPROFILESIGNAL=12<\/code>, \u0442\u043e \u0430\u043a\u0442\u0438\u0432\u0430\u0446\u0438\u044f \u0431\u0443\u0434\u0435\u0442 \u0432\u043a\u043b\u044e\u0447\u0430\u0442\u044c\u0441\u044f \u0438 \u0432\u044b\u043a\u043b\u044e\u0447\u0430\u0442\u044c\u0441\u044f \u043f\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u043e\u043c\u0443 \u0441\u0438\u0433\u043d\u0430\u043b\u0443 12 (SIGUSR2).<\/p>\n<p>  <\/p>\n<p>\u041f\u0440\u0438\u043d\u0446\u0438\u043f \u0440\u0430\u0431\u043e\u0442\u044b CPU-\u043f\u0440\u043e\u0444\u0438\u043b\u0438\u0440\u043e\u0432\u0449\u0438\u043a\u0430 \u0437\u0430\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u043e\u043d \u043f\u0435\u0440\u0438\u043e\u0434\u0438\u0447\u0435\u0441\u043a\u0438 (\u043f\u0435\u0440\u0438\u043e\u0434 \u0442\u043e\u0436\u0435 \u043c\u043e\u0436\u043d\u043e \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c) \u0434\u0435\u043b\u0430\u0435\u0442 \u0441\u043d\u0438\u043c\u043e\u043a \u0442\u0435\u043a\u0443\u0449\u0438\u0445 \u0441\u0442\u0435\u043a\u043e\u0432 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430 \u0438 \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u0442 \u0438\u0445 \u0444\u0430\u0439\u043b, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u043e\u0430\u043d\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0443\u0442\u0438\u043b\u0438\u0442\u043e\u0439 pprof. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0447\u0442\u043e\u0431\u044b \u0431\u044b\u0441\u0442\u0440\u043e \u043e\u0446\u0435\u043d\u0438\u0442\u044c, \u043a\u0430\u043a\u0438\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0431\u043e\u043b\u044c\u0448\u0435 \u0434\u0440\u0443\u0433\u0438\u0445 \u2014 \u0438\u043b\u0438, \u0442\u043e\u0447\u043d\u0435\u0435 \u0441\u043a\u0430\u0437\u0430\u0442\u044c, \u0447\u0430\u0449\u0435 \u0434\u0440\u0443\u0433\u0438\u0445 \u2014 \u043d\u0430\u0433\u0440\u0443\u0436\u0430\u044e\u0442 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440, \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0432\u0432\u0435\u0441\u0442\u0438<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">$ pprof -text \/tmp\/envoy.prof File: envoy-static Type: cpu Showing nodes accounting for 17.74s, 86.75% of 20.45s total Dropped 900 nodes (cum &lt;= 0.10s)       flat  flat%   sum%        cum   cum%      5.19s 25.38% 25.38%     17.02s 83.23%  deflate_fast      4.04s 19.76% 45.13%      4.04s 19.76%  longest_match      3.92s 19.17% 64.30%      3.92s 19.17%  compress_block      3.04s 14.87% 79.17%      3.04s 14.87%  slide_hash      0.62s  3.03% 82.20%      0.63s  3.08%  crc32_z      0.18s  0.88% 83.08%      0.18s  0.88%  writev      0.12s  0.59% 83.67%      0.12s  0.59%  readv      0.11s  0.54% 84.21%      0.11s  0.54%  close      0.08s  0.39% 84.60%      0.17s  0.83%  std::__uniq_ptr_impl::_M_ptr      0.06s  0.29% 84.89%      0.16s  0.78%  std::get      0.06s  0.29% 85.18%      0.18s  0.88%  std::unique_ptr::get      0.04s   0.2% 85.38%     18.54s 90.66%  http_parser_execute      0.03s  0.15% 85.53%      0.33s  1.61%  Envoy::Router::Filter::decodeHeaders      0.03s  0.15% 85.67%      0.26s  1.27%  absl::container_internal::raw_hash_set::find      0.02s 0.098% 85.77%     17.16s 83.91%  Envoy::Http::Http1::ClientConnectionImpl::onBody      0.01s 0.049% 85.82%      0.12s  0.59%  Envoy::Event::DispatcherImpl::clearDeferredDeleteList      0.01s 0.049% 85.87%     20.03s 97.95%  Envoy::Event::FileEventImpl::mergeInjectedEventsAndRunCb      0.01s 0.049% 85.92%     17.06s 83.42%  Envoy::Extensions::Compression::Gzip::Compressor::ZlibCompressorImpl::process      0.01s 0.049% 85.97%      0.13s  0.64%  Envoy::Http::ConnectionManagerImpl::ActiveStream::encodeData      0.01s 0.049% 86.01%      0.11s  0.54%  Envoy::Http::HeaderString::HeaderString      0.01s 0.049% 86.06%      0.32s  1.56%  Envoy::Http::Http1::ClientConnectionImpl::onHeadersComplete      0.01s 0.049% 86.11%     17.18s 84.01%  Envoy::Http::Http1::ConnectionImpl::dispatchBufferedBody      0.01s 0.049% 86.16%     19.14s 93.59%  Envoy::Network::ConnectionImpl::onReadReady      0.01s 0.049% 86.21%      0.24s  1.17%  Envoy::Network::ConnectionImpl::onWriteReady      0.01s 0.049% 86.26%      0.20s  0.98%  Envoy::Network::IoSocketHandleImpl::read      0.01s 0.049% 86.31%      0.21s  1.03%  Envoy::Network::RawBufferSocket::doRead ...<\/code><\/pre>\n<p>  <\/p>\n<p>\u0414\u043b\u044f \u0431\u043e\u043b\u0435\u0435 \u0434\u0435\u0442\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0430\u043d\u0430\u043b\u0438\u0437\u0430 \u043c\u043e\u0436\u043d\u043e \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u0443\u0434\u043e\u0431\u043d\u044b\u043c web-\u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u043e\u043c, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0442\u043e\u0442 \u0436\u0435 pprof:<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">$ pprof -http=localhost:8080 \/tmp\/envoy.prof<\/code><\/pre>\n<p>  <\/p>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043f\u043e \u0430\u0434\u0440\u0435\u0441\u0443 <a href=\"http:\/\/localhost:8080\" rel=\"nofollow\">http:\/\/localhost:8080<\/a> \u043c\u043e\u0436\u043d\u043e \u0432\u0437\u0433\u043b\u044f\u043d\u0443\u0442\u044c \u043d\u0430 \u043a\u0440\u0430\u0441\u0438\u0432\u044b\u0439 \u0433\u0440\u0430\u0444 \u0432\u044b\u0437\u043e\u0432\u043e\u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 (callgraph)<\/p>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/yw\/um\/4a\/ywum4axtrxj10oadali0nxspuoc.png\" alt=\"callgraph\"><\/p>\n<p>  <\/p>\n<p>\u0438 \u043d\u0430 flamegraph<\/p>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/mi\/6q\/k0\/mi6qk0prveruu-nl2f2hwajck44.png\" alt=\"flamegraph\"><\/p>\n<p>  <\/p>\n<p>\u0421 \u0430\u043d\u0430\u043b\u0438\u0437\u043e\u043c \u0436\u0435 \u0440\u0430\u0441\u0445\u043e\u0434\u0430 \u043f\u0430\u043c\u044f\u0442\u0438 \u0432\u0441\u0451 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0441\u043b\u043e\u0436\u043d\u0435\u0435, \u043f\u043e\u043a\u0443\u0434\u0430 \u043f\u0440\u043e\u0444\u0438\u043b\u0438\u0440\u043e\u0432\u0449\u0438\u043a \u043a\u0443\u0447\u0438 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043e\u0440\u0433\u0430\u043d\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u0447\u0430\u0441\u0442\u044c\u044e tcmalloc (thread caching malloc) \u2014 \u0430\u043b\u044c\u0442\u0435\u0440\u043d\u0430\u0442\u0438\u0432\u043d\u043e\u0433\u043e \u043c\u0435\u043d\u0435\u0434\u0436\u0435\u0440\u0430 \u043f\u0430\u043c\u044f\u0442\u0438 \u043e\u0442 gperftools \u043c\u0438\u043d\u0438\u043c\u0438\u0437\u0438\u0440\u0443\u044e\u0449\u0435\u0433\u043e \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u044b\u0445 \u0432\u044b\u0437\u043e\u0432\u043e\u0432 \u0437\u0430 \u0441\u0447\u0435\u0442 \u043f\u0440\u0435\u0434\u0432\u0430\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0433\u043e \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u043f\u0430\u043c\u044f\u0442\u0438 \u0441\u0432\u0435\u0440\u0445 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0433\u043e. \u0422\u043e \u0435\u0441\u0442\u044c, \u0447\u0442\u043e\u0431\u044b \u0438\u043c\u0435\u0442\u044c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u043f\u0440\u043e\u0444\u0438\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043f\u0430\u043c\u044f\u0442\u044c \u043d\u0430 \u0431\u043e\u0435\u0432\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u0435, \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043e\u0442\u043a\u0430\u0437\u0430\u0442\u044c\u0441\u044f \u043e\u0442 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0445 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0439 malloc() \u0438 new \u0438 \u0432\u0441\u0435\u0433\u0434\u0430 \u043b\u0438\u043d\u043a\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0441 tcmalloc. \u0418 \u0445\u043e\u0442\u044c tcmalloc \u0441\u0447\u0438\u0442\u0430\u0435\u0442\u0441\u044f \u0431\u044b\u0441\u0442\u0440\u0435\u0435 \u0438 \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u0435\u0435 \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e \u0432 \u043c\u043d\u043e\u0433\u043e\u043f\u043e\u0442\u043e\u0447\u043d\u044b\u0445 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430\u0445, \u043d\u0435 \u0432\u0441\u0435 \u0433\u043e\u0442\u043e\u0432\u044b \u0435\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0445\u043e\u0442\u044f \u0431\u044b \u0438\u0437-\u0437\u0430 \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u0431\u043e\u043b\u044c\u0448\u0435\u0433\u043e \u0440\u0430\u0441\u0445\u043e\u0434\u0430 \u043f\u0430\u043c\u044f\u0442\u0438. \u0422\u0435\u043c \u043d\u0435 \u043c\u0435\u043d\u0435\u0435 \u043f\u0440\u043e\u0444\u0438\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043f\u0430\u043c\u044f\u0442\u044c \u0441 \u043d\u0438\u043c \u0442\u0430\u043a \u0436\u0435 \u043f\u0440\u043e\u0441\u0442\u043e \u043a\u0430\u043a \u0438 CPU:<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">$ HEAPPROFILE=\/tmp\/envoyhprof envoy --concurrency 1 -c \/path\/to\/config.yaml \u2026 Dumping heap profile to \/tmp\/envoyhprof.0001.heap (1024 MB allocated cumulatively, 6 MB currently in use) Dumping heap profile to \/tmp\/envoyhprof.0002.heap (2048 MB allocated cumulatively, 6 MB currently in use) Dumping heap profile to \/tmp\/envoyhprof.0003.heap (3072 MB allocated cumulatively, 6 MB currently in use) Dumping heap profile to \/tmp\/envoyhprof.0004.heap (4096 MB allocated cumulatively, 6 MB currently in use) Dumping heap profile to \/tmp\/envoyhprof.0005.heap (5120 MB allocated cumulatively, 6 MB currently in use) ^C Dumping heap profile to \/tmp\/envoyhprof.0006.heap (Exiting, 5 MB in use)<\/code><\/pre>\n<p>  <\/p>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c, \u0447\u0442\u043e\u0431\u044b \u0443\u0437\u043d\u0430\u0442\u044c \u043a\u0430\u043a\u0438\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0431\u043e\u043b\u044c\u0448\u0435 \u0432\u0441\u0435\u0433\u043e \u0432\u044b\u0434\u0435\u043b\u044f\u043b\u0438 \u043f\u0430\u043c\u044f\u0442\u044c \u043d\u0430 \u043a\u0443\u0447\u0435, \u043d\u0430\u0434\u043e \u0441\u043d\u043e\u0432\u0430 \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f pprof:<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">$ pprof -text -sample_index=alloc_space \/tmp\/envoyhprof.0005.heap File: envoy-static Type: alloc_space Showing nodes accounting for 1558.99MB, 98.71% of 1579.32MB total Dropped 1117 nodes (cum &lt;= 7.90MB)       flat  flat%   sum%        cum   cum%  1043.23MB 66.06% 66.06%  1043.23MB 66.06%  zcalloc   240.73MB 15.24% 81.30%   240.73MB 15.24%  Envoy::Zlib::Base::Base   150.71MB  9.54% 90.84%   406.68MB 25.75%  std::make_unique    79.15MB  5.01% 95.85%    79.15MB  5.01%  std::allocator_traits::allocate    18.68MB  1.18% 97.04%    26.62MB  1.69%  Envoy::Http::ConnectionManagerImpl::newStream    15.18MB  0.96% 98.00%    15.18MB  0.96%  Envoy::InlineStorage::operator new     8.39MB  0.53% 98.53%     8.39MB  0.53%  std::__cxx11::basic_string::basic_string     1.98MB  0.13% 98.65%    31.99MB  2.03%  Envoy::Http::Http1::allocateConnPool(Envoy::Event::Dispatcher&amp;, Envoy::Random::RandomGenerator&amp;, std::shared_ptr, Envoy::Upstream::ResourcePriority, std::shared_ptr const&amp;, std::shared_ptr const&amp;, Envoy::Upstream::ClusterConnectivityState&amp;)::$_1::operator()     0.93MB 0.059% 98.71%    38.29MB  2.42%  Envoy::Server::ConnectionHandlerImpl::ActiveTcpListener::newConnection          0     0% 98.71%    59.54MB  3.77%  Envoy::Buffer::WatermarkBufferFactory::create          0     0% 98.71%    73.55MB  4.66%  Envoy::ConnectionPool::ConnPoolImplBase::newStream ...<\/code><\/pre>\n<p>  <\/p>\n<p>\u041a\u0430\u043a \u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u0438\u0437 \u0442\u0430\u0431\u043b\u0438\u0446\u044b, \u0431\u043e\u043b\u044c\u0448\u0435 \u0432\u0441\u0435\u0433\u043e \u043f\u0430\u043c\u044f\u0442\u0438 \u0432\u044b\u0434\u0435\u043b\u044f\u043b\u0430 <code>zcalloc()<\/code> \u0438\u0437 zlib, \u0447\u0442\u043e \u0441\u043e\u0432\u0441\u0435\u043c \u043d\u0435 \u0443\u0434\u0438\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e, \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u043f\u0440\u043e\u0444\u0438\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0441\u0436\u0438\u043c\u0430\u043b\u043e \u043f\u0440\u043e\u043a\u0430\u0447\u0438\u0432\u0430\u0435\u043c\u044b\u0439 \u0447\u0435\u0440\u0435\u0437 \u0441\u0435\u0431\u044f \u0442\u0440\u0430\u0444\u0438\u043a.<\/p>\n<p>  <\/p>\n<p>\u0412\u043f\u0440\u043e\u0447\u0435\u043c, \u044d\u0442\u043e \u043d\u0435 \u0441\u0430\u043c\u0430\u044f \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u0430\u044f \u043c\u0435\u0442\u0440\u0438\u043a\u0430. \u041e\u0431\u044b\u0447\u043d\u043e \u0434\u043b\u044f \u043d\u0430\u0441 \u0432\u0430\u0436\u043d\u0435\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442 \u0431\u043e\u043b\u044c\u0448\u0435 \u0432\u0441\u0435\u0433\u043e \u043f\u0430\u043c\u044f\u0442\u0438 \u0432 \u043d\u0430\u0441\u0442\u043e\u044f\u0449\u0438\u0439 \u043c\u043e\u043c\u0435\u043d\u0442:<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">$ pprof -text -sample_index=inuse_space \/tmp\/envoyhprof.0005.heap File: envoy-static Type: inuse_space Showing nodes accounting for 6199.96kB, 96.84% of 6402.51kB total Dropped 1016 nodes (cum &lt;= 32.01kB)       flat  flat%   sum%        cum   cum%  2237.76kB 34.95% 34.95%  3232.51kB 50.49%  std::make_unique  2041.45kB 31.89% 66.84%  2041.45kB 31.89%  std::allocator_traits::allocate   375.03kB  5.86% 72.69%   753.26kB 11.77%  google::protobuf::DescriptorPool::Tables::AllocateString[abi:cxx11]   267.78kB  4.18% 76.88%   267.78kB  4.18%  std::__cxx11::basic_string::_M_mutate   201.61kB  3.15% 80.03%   201.61kB  3.15%  zalloc_with_calloc   160.43kB  2.51% 82.53%   160.43kB  2.51%  google::protobuf::Arena::CreateMessageInternal (inline)   146.74kB  2.29% 84.82%   146.74kB  2.29%  std::__cxx11::basic_string::_M_construct   141.38kB  2.21% 87.03%   157.38kB  2.46%  google::protobuf::DescriptorPool::Tables::AllocateMessage   139.88kB  2.18% 89.22%   139.88kB  2.18%  google::protobuf::DescriptorPool::Tables::AllocateEmptyString[abi:cxx11]    88.04kB  1.38% 90.59%   113.12kB  1.77%  google::protobuf::DescriptorPool::Tables::AllocateFileTables    72.52kB  1.13% 91.72%    72.90kB  1.14%  ares_init_options       71kB  1.11% 92.83%       71kB  1.11%  _GLOBAL__sub_I_eh_alloc.cc    69.81kB  1.09% 93.92%    69.81kB  1.09%  zcalloc    51.16kB   0.8% 94.72%    51.16kB   0.8%  google::protobuf::Arena::CreateArray (inline)    46.81kB  0.73% 95.45%    60.41kB  0.94%  google::protobuf::Arena::CreateInternal (inline)    37.23kB  0.58% 96.03%    37.23kB  0.58%  re2::PODArray::PODArray    33.53kB  0.52% 96.56%    33.53kB  0.52%  std::__cxx11::basic_string::_M_assign    11.50kB  0.18% 96.74%  2213.77kB 34.58%  Envoy::ConstSingleton::get     6.06kB 0.095% 96.83%    38.85kB  0.61%  google::protobuf::internal::ArenaStringPtr::Set     0.24kB 0.0038% 96.84%  2590.71kB 40.46%  Envoy::Server::InstanceImpl::InstanceImpl          0     0% 96.84%    79.56kB  1.24%  Envoy::(anonymous namespace)::jsonConvertInternal          0     0% 96.84%    84.48kB  1.32%  Envoy::(anonymous namespace)::tryWithApiBoosting          0     0% 96.84%   726.42kB 11.35%  Envoy::Config::ApiTypeOracle::getEarlierVersionDescriptor          0     0% 96.84%    77.22kB  1.21%  Envoy::Config::Utility::createTagProducer          0     0% 96.84%   706.72kB 11.04%  Envoy::Config::Utility::getAndCheckFactory          0     0% 96.84%   707.38kB 11.05%  Envoy::Config::Utility::getFactoryByType ...<\/code><\/pre>\n<p>  <\/p>\n<p>\u041e\u0436\u0438\u0434\u0430\u0435\u043c\u043e, \u0431\u043e\u043b\u044c\u0448\u0443\u044e \u0447\u0430\u0441\u0442\u044c \u043f\u0430\u043c\u044f\u0442\u0438 \u0434\u0435\u0440\u0436\u0438\u0442 <code>std::make_unique()<\/code>. \u0418 \u0432\u043e\u043e\u0431\u0449\u0435 \u0432\u043d\u0443\u0442\u0440\u0438 \u043a\u043e\u0434\u0430 Envoy \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043e\u0441\u043e\u0431\u043e \u043d\u0435\u0447\u0435\u0433\u043e \u2014 \u0433\u043b\u0430\u0432\u043d\u044b\u0435 \u043f\u043e\u0442\u0440\u0435\u0431\u0438\u0442\u0435\u043b\u0438 \u043d\u0430\u0445\u043e\u0434\u044f\u0442\u0441\u044f \u0432 \u0441\u0442\u043e\u0440\u043e\u043d\u043d\u0438\u0445 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430\u0445. \u041e\u0434\u043d\u0430\u043a\u043e \u0435\u0441\u043b\u0438 \u0432\u0437\u0433\u043b\u044f\u043d\u0443\u0442\u044c \u043d\u0430 callgraph \u0438\u043b\u0438 flamegraph, \u0442\u043e \u043c\u043e\u0436\u043d\u043e \u0443\u0437\u043d\u0430\u0442\u044c, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043d\u0430 \u043a\u0430\u043a\u0438\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043e\u0431\u0440\u0430\u0442\u0438\u0442\u044c \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435, \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u0440\u0435\u0436\u0435 \u0437\u0432\u0430\u0442\u044c <code>std::make_unique()<\/code>. Web-\u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u0432 \u044d\u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043d\u0430\u0438\u0431\u043e\u043b\u0435\u0435 \u0443\u0434\u043e\u0431\u0435\u043d<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">$ pprof -http=localhost:8080 \/tmp\/envoyhprof.0005.heap<\/code><\/pre>\n<p>  <\/p>\n<p>\u0412 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0435 \u0432\u044b \u0443\u0432\u0438\u0434\u0438\u0442\u0435 \u0447\u0442\u043e-\u0442\u043e \u0432\u0440\u043e\u0434\u0435<\/p>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/p_\/tu\/4m\/p_tu4mmzoj1webb_sv-0_bntixk.png\" alt=\"Heap callgraph\"><\/p>\n<p>  <\/p>\n<p>\u0438<\/p>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/gn\/5o\/gw\/gn5ogw3q6bng_tbgynybk2-3p1s.png\" alt=\"Heap flamegraph\"><\/p>\n<p>  <\/p>\n<p>\u041c\u043e\u0436\u043d\u043e \u0442\u0430\u043a\u0436\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c, \u043d\u0435 \u0442\u0435\u0447\u0435\u0442 \u043b\u0438 \u043f\u0430\u043c\u044f\u0442\u044c. \u0412\u044b\u0447\u0442\u0435\u043c \u0438\u0437 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430 \u0441\u0430\u043c\u0443\u044e \u043f\u0435\u0440\u0432\u0443\u044e \u0447\u0430\u0441\u0442\u044c \u0434\u0430\u043c\u043f\u0430, \u0433\u0434\u0435 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b:<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">$ pprof -text -sample_index=inuse_space --base=\/tmp\/envoyhprof.0001.heap \/tmp\/envoyhprof.0005.heap File: envoy-static Type: inuse_space Showing nodes accounting for 1460B, 10.38% of 14060B total       flat  flat%   sum%        cum   cum%      1460B 10.38% 10.38%      1460B 10.38%  hist_accumulate          0     0% 10.38%      1460B 10.38%  Envoy::Event::DispatcherImpl::DispatcherImpl(std::__cxx11::basic_string const&amp;, Envoy::Api::Api&amp;, Envoy::Event::TimeSystem&amp;, std::shared_ptr const&amp;)::$_1::operator()          0     0% 10.38%      1460B 10.38%  Envoy::Event::DispatcherImpl::run          0     0% 10.38%      1460B 10.38%  Envoy::Event::DispatcherImpl::runPostCallbacks          0     0% 10.38%      1460B 10.38%  Envoy::Event::LibeventScheduler::run          0     0% 10.38%      1460B 10.38%  Envoy::Event::SchedulableCallbackImpl::SchedulableCallbackImpl(Envoy::CSmartPtr&amp;, std::function)::$_0::__invoke          0     0% 10.38%      1460B 10.38%  Envoy::Event::SchedulableCallbackImpl::SchedulableCallbackImpl(Envoy::CSmartPtr&amp;, std::function)::$_0::operator()          0     0% 10.38%      1460B 10.38%  Envoy::MainCommon::main          0     0% 10.38%      1460B 10.38%  Envoy::MainCommon::run          0     0% 10.38%      1460B 10.38%  Envoy::MainCommonBase::run          0     0% 10.38%      1460B 10.38%  Envoy::Server::InstanceImpl::run          0     0% 10.38%      1460B 10.38%  Envoy::Stats::ParentHistogramImpl::merge          0     0% 10.38%       730B  5.19%  Envoy::Stats::ThreadLocalHistogramImpl::merge          0     0% 10.38%      1460B 10.38%  Envoy::Stats::ThreadLocalStoreImpl::mergeHistograms(std::function)::$_2::operator()          0     0% 10.38%      1460B 10.38%  Envoy::Stats::ThreadLocalStoreImpl::mergeInternal          0     0% 10.38%      1460B 10.38%  __libc_start_main          0     0% 10.38%      1460B 10.38%  event_base_loop          0     0% 10.38%      1460B 10.38%  event_process_active          0     0% 10.38%      1460B 10.38%  event_process_active_single_queue          0     0% 10.38%      1460B 10.38%  main          0     0% 10.38%      1460B 10.38%  std::_Function_handler::_M_invoke          0     0% 10.38%      1460B 10.38%  std::function::operator()<\/code><\/pre>\n<p>  <\/p>\n<p>\u0412\u0441\u0451 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u043d\u0435\u043f\u043b\u043e\u0445\u043e, \u043f\u0430\u043c\u044f\u0442\u044c \u0432\u0435\u0441\u044c\u043c\u0430 \u0443\u043c\u0435\u0440\u0435\u043d\u043d\u043e \u0442\u0440\u0430\u0442\u0438\u0442\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u043d\u0430 \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u0435 \u043d\u0430\u043a\u043e\u043f\u043b\u0435\u043d\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0438.<\/p>\n<p>  <\/p>\n<p>\u041f\u043e \u0437\u0430\u043a\u043e\u043d\u0443 \u0436\u0430\u043d\u0440\u0430 \u043d\u0430 \u044d\u0442\u043e\u043c \u043c\u0435\u0441\u0442\u0435 \u0434\u043e\u043b\u0436\u043d\u044b \u043d\u0430\u0447\u0430\u0442\u044c\u0441\u044f \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b. \u0417\u0430\u043a\u043b\u044e\u0447\u0430\u044e\u0442\u0441\u044f \u043e\u043d\u0438 \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u043d\u0435 \u0442\u0430\u043a \u0434\u0430\u0432\u043d\u043e Google \u0432\u044b\u043b\u043e\u0436\u0438\u043b \u0432 \u0441\u0432\u043e\u0451\u043c \u0430\u043a\u043a\u0430\u0443\u043d\u0442\u0435 \u043d\u0430 GitHub \u043d\u043e\u0432\u044b\u0439, \u0443\u043b\u0443\u0447\u0448\u0435\u043d\u043d\u044b\u0439 tcmalloc. \u0412 \u043a\u043e\u0442\u043e\u0440\u043e\u043c, \u043a\u044d\u0448\u0438 \u043f\u0430\u043c\u044f\u0442\u0438 \u0441\u043e\u0437\u0434\u0430\u044e\u0442\u0441\u044f \u043d\u0435 \u0434\u043b\u044f \u043f\u043e\u0442\u043e\u043a\u043e\u0432, \u043a\u0430\u043a \u0432 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b\u044c\u043d\u043e\u0439 \u0432\u0435\u0440\u0441\u0438\u0438, \u0430 \u0434\u043b\u044f \u044f\u0434\u0435\u0440 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u0430. \u0412 \u0437\u0430\u0434\u0430\u0447\u0430\u0445, \u0441\u043e\u0437\u0434\u0430\u044e\u0449\u0438\u0445 \u0431\u043e\u043b\u044c\u0448\u043e\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043f\u043e\u0442\u043e\u043a\u043e\u0432, \u044d\u0442\u043e \u043c\u043e\u0436\u0435\u0442 \u0437\u0430\u043c\u0435\u0442\u043d\u043e \u0443\u043b\u0443\u0447\u0448\u0438\u0442\u044c \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u0438 \u0441\u043d\u0438\u0437\u0438\u0442\u044c \u0440\u0430\u0441\u0445\u043e\u0434 \u043f\u0430\u043c\u044f\u0442\u0438.<\/p>\n<p>  <\/p>\n<p>\u041f\u043b\u043e\u0445\u0430\u044f \u0436\u0435 \u043d\u043e\u0432\u043e\u0441\u0442\u044c \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u0432 \u043d\u043e\u0432\u043e\u043c tcmalloc \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u043f\u0440\u043e\u0444\u0438\u043b\u0438\u0440\u043e\u0432\u0449\u0438\u043a. \u041e\u0434\u043d\u0430\u043a\u043e \u0436\u0435 \u043e\u043d \u0442\u0435\u043f\u0435\u0440\u044c \u043d\u0435 \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e-\u0442\u043e \u0438 \u043d\u0443\u0436\u0435\u043d. \u0412 \u0447\u0430\u0441\u0442\u043d\u043e\u0441\u0442\u0438 \u0434\u043b\u044f \u043f\u0440\u043e\u0444\u0438\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f CPU \u0442\u0435\u043f\u0435\u0440\u044c \u0432\u043f\u043e\u043b\u043d\u0435 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0443\u0442\u0438\u043b\u0438\u0442\u044b perf. \u0427\u0442\u043e\u0431\u044b \u0435\u044e \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0434\u0430\u0436\u0435 \u043d\u0435 \u043d\u0443\u0436\u043d\u043e \u043d\u0438 \u0441 \u0447\u0435\u043c \u043b\u0438\u043d\u043a\u043e\u0432\u0430\u0442\u044c\u0441\u044f. \u0412\u0441\u0451 \u043d\u0443\u0436\u043d\u043e\u0435 \u0443\u0436\u0435 \u0435\u0441\u0442\u044c \u0432 \u044f\u0434\u0440\u0435 Linux:<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">$ perf record -g -F 99 -p `pgrep envoy` ^C[ perf record: Woken up 1 times to write data ] [ perf record: Captured and wrote 0.694 MB perf.data (1532 samples) ]<\/code><\/pre>\n<p>  <\/p>\n<p>\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u0442\u0441\u044f \u0432 \u0444\u0430\u0439\u043b <code>perf.data<\/code>, \u0444\u043e\u0440\u043c\u0430\u0442 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u043f\u043e\u043d\u044f\u0442\u0435\u043d pprof (\u043d\u0430\u0447\u0438\u043d\u0430\u044f \u0441 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0432\u0435\u0440\u0441\u0438\u0438):<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">$ pprof -http=localhost:8080 perf.data<\/code><\/pre>\n<p>  <\/p>\n<p>\u0422\u043e \u0435\u0441\u0442\u044c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0441\u043e\u0432\u0435\u0440\u0448\u0435\u043d\u043d\u043e \u0438\u0434\u0435\u043d\u0442\u0438\u0447\u0435\u043d \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u0443 \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c gperftools.<\/p>\n<p>  <\/p>\n<p>\u041e\u0434\u043d\u0430\u043a\u043e \u0438\u043c\u0435\u044e\u0442\u0441\u044f \u043f\u043e\u0434\u043e\u0437\u0440\u0435\u043d\u0438\u044f, \u0447\u0442\u043e <code>perf.data<\/code> \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0434\u0430\u0436\u0435 \u0431\u043e\u043b\u044c\u0448\u0435 \u043f\u043e\u043b\u0435\u0437\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445, \u0447\u0435\u043c pprof \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043e\u0442\u043e\u0431\u0440\u0430\u0437\u0438\u0442\u044c. \u0412 \u0447\u0430\u0441\u0442\u043d\u043e\u0441\u0442\u0438 \u044f \u043d\u0435 \u0441\u043c\u043e\u0433 \u043d\u0430\u0439\u0442\u0438, \u043a\u0430\u043a \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0440\u0430\u0437\u0431\u0438\u0432\u043a\u0443 \u0441\u0442\u0435\u043a\u043e\u0432 \u043f\u043e \u043f\u043e\u0442\u043e\u043a\u0430\u043c. \u0415\u0441\u043b\u0438 \u043a\u0442\u043e-\u0442\u043e \u0437\u043d\u0430\u0435\u0442, \u043d\u0430\u043f\u0438\u0448\u0438\u0442\u0435, \u043f\u043e\u0436\u0430\u043b\u0443\u0439\u0441\u0442\u0430, \u0432 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u044f\u0445. \u0422\u0430\u043a\u0430\u044f \u0440\u0430\u0437\u0431\u0438\u0432\u043a\u0430 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043f\u043e\u043b\u0435\u0437\u043d\u0430 \u0434\u043b\u044f \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0435\u043d\u0438\u044f \u0443\u0437\u043a\u0438\u0445 \u043c\u0435\u0441\u0442, \u043a\u043e\u0433\u0434\u0430 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043f\u043e\u0442\u043e\u043a\u043e\u0432 \u0434\u0435\u043b\u0435\u0433\u0438\u0440\u0443\u044e\u0442 \u043a\u0430\u043a\u0443\u044e-\u0442\u043e \u0440\u0430\u0431\u043e\u0442\u0443 \u043e\u0434\u043d\u043e\u043c\u0443 \u0435\u0434\u0438\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u043c\u0443 \u043f\u043e\u0442\u043e\u043a\u0443 \u0438 \u043f\u0435\u0440\u0435\u0433\u0440\u0443\u0436\u0430\u044e\u0442 \u0435\u0433\u043e. \u041f\u043e\u043a\u0430 \u0447\u0442\u043e \u0434\u043b\u044f \u043c\u0435\u043d\u044f \u043d\u0435\u0437\u0430\u043c\u0435\u043d\u0438\u043c\u044b\u043c \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u043e\u043c \u0434\u043b\u044f \u0442\u0430\u043a\u0438\u0445 \u0441\u043b\u0443\u0447\u0430\u0435\u0432 \u0441\u043b\u0443\u0436\u0438\u0442 \u043d\u0430\u0431\u043e\u0440 \u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0432 \u0411\u0440\u0435\u043d\u0434\u0430\u043d\u0430 \u0413\u0440\u0435\u0433\u0433\u0430: <a href=\"https:\/\/github.com\/brendangregg\/FlameGraph\" rel=\"nofollow\">https:\/\/github.com\/brendangregg\/FlameGraph<\/a>. \u0415\u0441\u043b\u0438 \u0438\u0445 \u043f\u0440\u0438\u043c\u0435\u043d\u0438\u0442\u044c \u043a \u0438\u043c\u0435\u044e\u0449\u0435\u043c\u0443\u0441\u044f \u0444\u0430\u0439\u043b\u0443 <code>perf.data<\/code>, \u0442\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u043c flamegraph, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u043c\u043e\u0436\u043d\u043e \u0440\u0430\u0437\u043b\u0438\u0447\u0438\u0442\u044c \u0442\u0440\u0438 \u043f\u043e\u0442\u043e\u043a\u0430 \u2014 \u043e\u0434\u0438\u043d \u0433\u043b\u0430\u0432\u043d\u044b\u0439 \u0438 \u0434\u0432\u0430 \u0440\u0430\u0431\u043e\u0447\u0438\u0445.<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">$ perf script --input=perf.data | .\/FlameGraph\/stackcollapse-perf.pl &gt; out.perf-folded $ .\/FlameGraph\/flamegraph.pl out.perf-folded &gt; perf.svg<\/code><\/pre>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/vf\/tz\/u9\/vftzu9ip9-aqnjvmdoh5ic-47f8.png\"><\/p>\n<p>  <\/p>\n<p>\u0412\u043f\u0440\u043e\u0447\u0435\u043c, \u0433\u043b\u044f\u0434\u044f \u043d\u0430 \u0442\u0430\u043a\u043e\u0439 flamegraph, \u0434\u0430\u043b\u0435\u043a\u043e \u043d\u0435 \u0432\u0441\u0435\u0433\u0434\u0430 \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0434\u043e\u0433\u0430\u0434\u0430\u0442\u044c\u0441\u044f, \u0447\u0442\u043e \u0438\u043c\u0435\u0435\u043c \u0434\u0435\u043b\u043e \u0441 \u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u043a\u0430\u043c\u0438 \u043d\u0430 \u043f\u0435\u0440\u0435\u0433\u0440\u0443\u0436\u0435\u043d\u043d\u043e\u043c \u043f\u043e\u0442\u043e\u043a\u0435. \u041f\u043e\u043b\u0435\u0437\u043d\u0435\u0435 \u043c\u043e\u0436\u0435\u0442 \u043e\u043a\u0430\u0437\u0430\u0442\u044c\u0441\u044f \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0430 \u0441 \u043d\u0435\u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0449\u0438\u043c\u0438 \u043f\u043e\u0442\u043e\u043a\u0430\u043c\u0438, \u0442\u043e \u0435\u0441\u0442\u044c \u043e\u0436\u0438\u0434\u0430\u044e\u0449\u0438\u043c\u0438 \u0441\u043d\u044f\u0442\u0438\u044f \u043a\u0430\u043a\u043e\u0439-\u043d\u0438\u0431\u0443\u0434\u044c \u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u043a\u0438. \u041e\u043f\u044f\u0442\u044c \u0436\u0435, \u0432\u0441\u0451 \u043d\u0443\u0436\u043d\u043e\u0435 \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0435\u0441\u0442\u044c \u0432 \u044f\u0434\u0440\u0435 Linux \u2014 \u0440\u0435\u0447\u044c \u0438\u0434\u0451\u0442 \u043e eBPF. \u0418\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u043a\u043e\u0434\u0430 \u043d\u0435 \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f. \u0422\u043e\u043b\u044c\u043a\u043e \u0443\u0431\u0435\u0434\u0438\u0442\u0435\u0441\u044c, \u0447\u0442\u043e \u0432 \u0432\u0430\u0448\u0435\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u0435 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d \u043f\u0430\u043a\u0435\u0442 \u0441 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u0430\u043c\u0438 \u0434\u043b\u044f \u201cBPF Compiler Collection\u201d. \u0412 Fedora \u043e\u043d \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f bcc-tools.<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">$ \/usr\/share\/bcc\/tools\/offcputime -df -p `pgrep envoy` 30 &gt; out.stacks $ .\/FlameGraph\/flamegraph.pl --color=io --title='Off-CPU Time Flame Graph' &lt; out.stacks &gt; off-cpu.svg<\/code><\/pre>\n<p>  <\/p>\n<p>\u0414\u043b\u044f \u043f\u0440\u0438\u043c\u0435\u0440\u0430 \u043f\u0440\u0438\u0432\u0435\u0434\u0443 \u0434\u0432\u0430 \u0433\u0440\u0430\u0444\u0438\u043a\u0430 \u0434\u043b\u044f Envoy \u043f\u043e\u0434 \u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u043e\u0439 \u0437\u0430\u043f\u0443\u0449\u0435\u043d\u043d\u043e\u0433\u043e \u0441 \u0447\u0435\u0442\u044b\u0440\u044c\u043c\u044f \u0438 \u0434\u0435\u0432\u044f\u0442\u044c\u044e \u0440\u0430\u0431\u043e\u0447\u0438\u043c\u0438 \u043f\u043e\u0442\u043e\u043a\u0430\u043c\u0438.<\/p>\n<p>  <\/p>\n<p>\u042d\u0442\u043e 4 \u043f\u043e\u0442\u043e\u043a\u0430<br \/>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/t4\/lc\/7q\/t4lc7q39vl6askhucfshnbyyrbc.png\" alt=\"4 workers\"><\/p>\n<p>  <\/p>\n<p>\u042d\u0442\u043e 9 \u043f\u043e\u0442\u043e\u043a\u043e\u0432<br \/>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/ff\/bd\/og\/ffbdogayzowxt12kicsv27xyn9q.png\" alt=\"9 workers\"><\/p>\n<p>  <\/p>\n<p>\u041c\u043e\u0436\u043d\u043e \u0437\u0430\u043c\u0435\u0442\u0438\u0442\u044c, \u0447\u0442\u043e \u043f\u0440\u0438 \u0431\u043e\u043b\u044c\u0448\u0435\u043c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0435 \u0440\u0430\u0431\u043e\u0447\u0438\u0445 \u043f\u043e\u0442\u043e\u043a\u043e\u0432 \u043e\u043d\u044b\u0435 \u0432\u0441\u0451 \u0431\u043e\u043b\u044c\u0448\u0443\u044e \u0447\u0430\u0441\u0442\u044c \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u043d\u0438\u0447\u0435\u0433\u043e\u043d\u0435\u0434\u0435\u043b\u0430\u043d\u0438\u044f \u0431\u0435\u0441\u043f\u043e\u043b\u0435\u0437\u043d\u043e \u0436\u0434\u0443\u0442 \u0432 \u0446\u0438\u043a\u043b\u0435 \u0441\u043e\u0431\u044b\u0442\u0438\u0439 \u0432\u043c\u0435\u0441\u0442\u043e \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u0441 \u043f\u043e\u043b\u044c\u0437\u043e\u0439 \u0436\u0434\u0430\u0442\u044c, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0432\u043e\u0437\u0432\u0440\u0430\u0442\u0430 \u0438\u0437 \u0434\u0440\u0443\u0433\u0438\u0445 \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u044b\u0445 \u0432\u044b\u0437\u043e\u0432\u043e\u0432. \u041f\u0440\u0438 \u0442\u043e\u043c, \u0447\u0442\u043e \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u043a \u0441\u0435\u0440\u0432\u0435\u0440\u0443 \u043e\u0441\u0442\u0430\u044e\u0442\u0441\u044f \u043d\u0435\u043e\u0431\u0441\u043b\u0443\u0436\u0435\u043d\u043d\u044b\u043c\u0438. \u042d\u0442\u043e \u043a\u0430\u043a \u0440\u0430\u0437 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u0430 \u043f\u043e \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0435 \u0447\u0430\u0441\u0442\u0438 \u0440\u0430\u0431\u043e\u0442\u044b \u043e\u0442 \u0440\u0430\u0431\u043e\u0447\u0438\u0445 \u043f\u043e\u0442\u043e\u043a\u043e\u0432 \u043e\u0434\u043d\u043e\u043c\u0443 \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u043c\u0443 \u043f\u043e\u0442\u043e\u043a\u0443 \u2014 \u043f\u043b\u043e\u0445\u0430\u044f \u0438\u0434\u0435\u044f \u0432 \u043e\u0431\u0449\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435.<\/p>\n<p>  <\/p>\n<p>\u0410 \u0432\u043e\u0442 \u0441 \u043f\u0440\u043e\u0444\u0438\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u043f\u0430\u043c\u044f\u0442\u0438 \u043d\u0435 \u0432\u0441\u0451 \u0442\u0430\u043a \u0440\u0430\u0434\u0443\u0436\u043d\u043e, \u0445\u043e\u0442\u044f \u0438 \u0442\u0443\u0442 \u043c\u043e\u0436\u043d\u043e \u043a\u043e\u0435-\u0447\u0435\u0433\u043e \u0434\u043e\u0431\u0438\u0442\u044c\u0441\u044f \u043f\u043e\u043b\u0430\u0433\u0430\u044f\u0441\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u043d\u0430 eBPF \u0438 \u043d\u0430 \u0443\u0442\u0438\u043b\u0438\u0442\u0443 stackcount \u0438\u0437 bcc-tools. \u0414\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c flamegraph \u0432 \u0441\u0442\u0438\u043b\u0435 pprof, \u043d\u0430\u0434\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0435<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">$ sudo \/usr\/share\/bcc\/tools\/stackcount -p `pgrep envoy`  -U &quot;\/full\/path\/to\/envoy:_Znwm&quot; &gt; out.stack $ .\/FlameGraph\/stackcollapse.pl &lt; out.stacks | .\/FlameGraph\/flamegraph.pl --color=mem --title=&quot;operator new(std::size_t) Flame Graph&quot; --countname=&quot;calls&quot; &gt; out.svg<\/code><\/pre>\n<p>  <\/p>\n<p>stackcount \u0433\u0440\u0443\u043f\u043f\u0438\u0440\u0443\u0435\u0442 \u0432\u044b\u0437\u043e\u0432\u044b \u043a \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043f\u043e \u0438\u0434\u0435\u043d\u0442\u0438\u0447\u043d\u044b\u043c \u0441\u0442\u0435\u043a\u0430\u043c \u0432\u044b\u0437\u043e\u0432\u043e\u0432 \u043a \u043d\u0435\u0439 (stack traces) \u0438 \u0441\u0443\u043c\u043c\u0438\u0440\u0443\u0435\u0442 \u0438\u0445. \u041e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u043d\u0430 \u0441\u0442\u0440\u0430\u043d\u043d\u043e \u0432\u044b\u0433\u043b\u044f\u0434\u044f\u0449\u0438\u0439 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 <code>-U &quot;\/full\/path\/to\/envoy:_Znwm&quot;<\/code>. \u041e\u043d \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 \u043d\u0430 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u0443\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u0432 \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u0435 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f (\u0432 \u043f\u0440\u043e\u0442\u0438\u0432\u043e\u043f\u043e\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0443 -K, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u043e\u0436\u0435\u0442 \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u043d\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u0432 \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u0435 \u044f\u0434\u0440\u0430). \u0412 \u043e\u0431\u0449\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043e\u043d \u0437\u0430\u0434\u0430\u0451\u0442\u0441\u044f \u043a\u0430\u043a <code>-U lib:func<\/code>, \u0433\u0434\u0435 <code>lib<\/code> \u2014 \u044d\u0442\u043e \u0438\u043c\u044f \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438, \u0430 <code>func<\/code> \u2014 \u0438\u043c\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0432 \u0442\u043e\u043c \u0432\u0438\u0434\u0435, \u043a\u0430\u043a \u043e\u043d\u043e \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0432\u044b\u0432\u043e\u0434\u0435 <code>objdump -tT \/path\/to\/lib<\/code>. \u0412 \u043d\u0430\u0448\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 <code>_Znwm<\/code> \u2014 \u044d\u0442\u043e \u043d\u0435 \u0447\u0442\u043e \u0438\u043d\u043e\u0435 \u043a\u0430\u043a <code>void* operator new(std::size_t)<\/code>. \u0410 \u043f\u0443\u0442\u044c \u043a \u0438\u0441\u043f\u043e\u043b\u043d\u044f\u0435\u043c\u043e\u043c\u0443 \u0444\u0430\u0439\u043b\u0443 \u0432\u043c\u0435\u0441\u0442\u043e \u0438\u043c\u0435\u043d\u0438 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u0443\u043a\u0430\u0437\u0430\u043d \u043f\u043e\u0442\u043e\u043c\u0443, \u0447\u0442\u043e \u0435\u0441\u0442\u044c \u043d\u044e\u0430\u043d\u0441 \u2014 Envoy \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0441\u043b\u0438\u043d\u043a\u043e\u0432\u0430\u043d \u0441 tcmalloc. \u041a \u0441\u043e\u0436\u0430\u043b\u0435\u043d\u0438\u044e, \u0438\u0437 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438 \u0432\u044b \u043d\u0435 \u0443\u0437\u043d\u0430\u0435\u0442\u0435 \u043e \u0442\u0430\u043a\u0438\u0445 \u043c\u0435\u043b\u043e\u0447\u0430\u0445.<\/p>\n<p>  <\/p>\n<p>\u0427\u0442\u043e\u0431\u044b \u043f\u043e\u043d\u044f\u0442\u044c \u043a\u0430\u043a C++ \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 \u0432\u0438\u0434\u043e\u0438\u0437\u043c\u0435\u043d\u0438\u0442 (mangle) \u043d\u0443\u0436\u043d\u0443\u044e \u0432\u0430\u043c \u0444\u0443\u043d\u043a\u0446\u0438\u044e, \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0439\u0442\u0435\u0441\u044c \u0432\u043e\u0442 \u0442\u0430\u043a\u0438\u043c \u043e\u0434\u043d\u043e\u0441\u0442\u0440\u043e\u0447\u043d\u0438\u043a\u043e\u043c<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">$ echo -e &quot;#include &lt;new&gt;\\n void* operator new(std::size_t) {} &quot; | g++ -x c++ -S - -o- 2&gt; \/dev\/null         .file   &quot;&quot;         .text         .globl  _Znwm         .type   _Znwm, @function _Znwm: .LFB73:         .cfi_startproc         pushq   %rbp         .cfi_def_cfa_offset 16         .cfi_offset 6, -16         movq    %rsp, %rbp         .cfi_def_cfa_register 6         movq    %rdi, -8(%rbp)         nop         popq    %rbp         .cfi_def_cfa 7, 8         ret         .cfi_endproc .LFE73:         .size   _Znwm, .-_Znwm         .ident  &quot;GCC: (GNU) 10.2.1 20201016 (Red Hat 10.2.1-6)&quot;         .section        .note.GNU-stack,&quot;&quot;,@progbits<\/code><\/pre>\n<p>  <\/p>\n<p>\u041e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435, \u0447\u0442\u043e \u0438\u043c\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0437\u043d\u044b\u043c \u043d\u0430 32 \u0438 64 \u0440\u0430\u0437\u0440\u044f\u0434\u043d\u044b\u0445 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0430\u0445 \u0438\u0437-\u0437\u0430 \u0440\u0430\u0437\u043d\u043e\u0433\u043e \u0440\u0430\u0437\u043c\u0435\u0440\u0430 <code>size_t<\/code>. \u041a\u0440\u043e\u043c\u0435 \u0442\u043e\u0433\u043e <code>void* operator new[](std::size_t)<\/code> \u2014 \u044d\u0442\u043e \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u0430\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f. \u041a\u0430\u043a, \u0432\u043f\u0440\u043e\u0447\u0435\u043c, \u0438 <code>malloc()<\/code> \u0441 <code>calloc()<\/code>, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0431\u0443\u0434\u0443\u0447\u0438 C-\u0444\u0443\u043d\u043a\u0446\u0438\u044f\u043c\u0438 \u0441\u0432\u043e\u0438 \u0438\u043c\u0435\u043d\u0430 \u043d\u0435 \u043c\u0435\u043d\u044f\u044e\u0442.<\/p>\n<p>  <\/p>\n<p>\u0421\u043d\u043e\u0432\u0430 \u0434\u043e\u043b\u0436\u0435\u043d \u0441 \u0441\u043e\u0436\u0430\u043b\u0435\u043d\u0438\u0435\u043c \u043a\u043e\u043d\u0441\u0442\u0430\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c, \u0447\u0442\u043e stackcount \u043f\u043e\u043a\u0430\u0436\u0435\u0442 \u043d\u0435 \u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0438\u043c\u0435\u043d\u043d\u043e \u043f\u0430\u043c\u044f\u0442\u0438 \u0432\u044b\u0434\u0435\u043b\u044f\u043b\u043e\u0441\u044c \u0432 \u0442\u043e\u0439 \u0438\u043b\u0438 \u0438\u043d\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438, \u0430 \u043a\u0430\u043a \u0447\u0430\u0441\u0442\u043e. \u041d\u043e \u0437\u0430\u0442\u043e \u044d\u0442\u043e\u0442 \u043c\u0435\u0442\u043e\u0434 \u0430\u043d\u0430\u043b\u0438\u0437\u0430 \u043f\u0440\u0438\u043c\u0435\u043d\u0438\u043c \u0434\u0430\u0436\u0435 \u0432 \u0442\u0435\u0445 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430\u0445, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0435 \u043f\u043e\u043b\u0430\u0433\u0430\u044e\u0442\u0441\u044f \u043d\u0430 \u0433\u043e\u0442\u043e\u0432\u044b\u0435 \u043c\u0435\u043d\u0435\u0434\u0436\u0435\u0440\u044b \u043f\u0430\u043c\u044f\u0442\u0438, \u0430 \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u044e\u0442 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u043a\u0443\u0447\u0435\u0439 \u0441\u0432\u043e\u0439, \u0440\u043e\u0434\u043d\u043e\u0439 \u0438 \u043d\u0438 \u043d\u0430 \u0447\u0442\u043e \u043d\u0435 \u043f\u043e\u0445\u043e\u0436\u0438\u0439, \u0431\u0435\u0441\u043a\u043e\u043d\u0435\u0447\u043d\u043e \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u201c\u0432\u0435\u043b\u043e\u0441\u0438\u043f\u0435\u0434\u201d (\u043a\u043e\u043d\u0435\u0447\u043d\u043e \u0436\u0435, \u0441 \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u043c\u0438 \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0430\u043c\u0438 \u0430\u043d\u0430\u043b\u0438\u0437\u0430 \u0440\u0430\u0441\u0445\u043e\u0434\u0430 \u043f\u0430\u043c\u044f\u0442\u0438).<\/p>\n<p>  <\/p>\n<p>\u0427\u0442\u043e\u0431\u044b \u043e\u0442\u0432\u0435\u0442\u0438\u0442\u044c \u043d\u0430 \u0432\u043e\u043f\u0440\u043e\u0441 \u201c\u0441\u043a\u043e\u043b\u044c\u043a\u043e\u201d, \u043d\u0443\u0436\u0435\u043d \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u0441\u0443\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u044b \u0432\u044b\u0437\u043e\u0432\u043e\u0432 malloc() \u0438\u043b\u0438 new, \u0430 \u043b\u0443\u0447\u0448\u0435 \u0432\u0441\u0435 \u0441\u0440\u0430\u0437\u0443. \u0422\u043e \u0435\u0441\u0442\u044c \u0447\u0442\u043e-\u0442\u043e \u0432\u0440\u043e\u0434\u0435 <a href=\"https:\/\/github.com\/brendangregg\/BPF-tools\/blob\/master\/old\/2017-12-23\/mallocstacks.py\" rel=\"nofollow\">\u044d\u0442\u043e\u0433\u043e<\/a>. \u0412 \u0438\u0434\u0435\u0430\u043b\u0435 \u0445\u043e\u0442\u0435\u043b\u043e\u0441\u044c \u0431\u044b, \u0447\u0442\u043e\u0431\u044b \u0432\u043e \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u043b\u0438\u0441\u044c \u0435\u0449\u0451 free() \u0438 delete, \u043d\u043e \u044d\u0442\u043e \u0443\u0436\u0435 \u0438\u0437 \u043e\u0431\u043b\u0430\u0441\u0442\u0438 \u043c\u0430\u0433\u0438\u0438. \u0415\u0441\u043b\u0438 \u043a\u0442\u043e-\u0442\u043e \u0443\u0436\u0435 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043b \u0442\u0430\u043a\u043e\u0435 \u043d\u0430 eBPF, \u043e\u0442\u043f\u0438\u0448\u0438\u0442\u0435\u0441\u044c, \u043f\u043e\u0436\u0430\u043b\u0443\u0439\u0441\u0442\u0430, \u0432 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u044f\u0445.<\/p>\n<p>  <\/p>\n<p>\u0412 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0437\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u0445\u043e\u0447\u0443 \u043f\u043e\u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u043e\u0432\u0430\u0442\u044c \u0432\u0441\u0435\u043c, \u043a\u043e\u0433\u043e \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u0443\u0435\u0442 \u0442\u0435\u043c\u0430 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u0438 \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0438 \u0432\u043d\u0438\u043c\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u0438\u0437\u0443\u0447\u0438\u0442\u044c <a href=\"http:\/\/www.brendangregg.com\/\" rel=\"nofollow\">\u0431\u043b\u043e\u0433 \u0411\u0440\u0435\u043d\u0434\u0430\u043d\u0430 \u0413\u0440\u0435\u0433\u0433\u0430<\/a>. \u0422\u0430\u043c \u0431\u0435\u0437\u0434\u043d\u0430 \u043f\u043e\u043b\u0435\u0437\u043d\u043e\u0439 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438.<\/p>\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\/536100\/\"> https:\/\/habr.com\/ru\/post\/536100\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"\n<div class=\"post__text post__text-html post__text_v1\" id=\"post-content-body\">\n<p>\u041f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435, \u043e\u043f\u0442\u0438\u043c\u0430\u043b\u044c\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0449\u0435\u0435 \u0432\u044b\u0447\u0438\u0441\u043b\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u0440\u0435\u0441\u0443\u0440\u0441\u044b, \u044d\u0442\u043e \u0432\u0441\u0435\u0433\u0434\u0430 \u0445\u043e\u0440\u043e\u0448\u043e \u0438 \u043f\u0440\u0438\u044f\u0442\u043d\u043e. \u0410 \u0435\u0441\u043b\u0438 \u0442\u0430\u043a\u043e\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0432 \u043e\u0431\u043b\u0430\u043a\u0435, \u0442\u043e \u0435\u0449\u0451 \u0438 \u0432\u044b\u0433\u043e\u0434\u043d\u043e. \u041f\u043e\u0440\u043e\u0439 \u043e\u0447\u0435\u043d\u044c \u0432\u044b\u0433\u043e\u0434\u043d\u043e. \u041f\u0440\u043e\u0441\u0442\u043e \u043f\u043e\u0442\u043e\u043c\u0443, \u0447\u0442\u043e \u0432 \u043e\u0434\u0438\u043d \u043a\u0432\u0430\u043d\u0442 \u043e\u043f\u043b\u0430\u0447\u0435\u043d\u043d\u043e\u0433\u043e \u043e\u0431\u043b\u0430\u0447\u043d\u043e\u0433\u043e \u0432\u044b\u0447\u0438\u0441\u043b\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0433\u043e \u0440\u0435\u0441\u0443\u0440\u0441\u0430 \u0432\u043b\u0435\u0437\u0430\u0435\u0442, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0431\u043e\u043b\u044c\u0448\u0435 \u043f\u043e\u043a\u0430\u0437\u0430\u043d\u043d\u044b\u0445 \u0432 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0435 \u043a\u043e\u0442\u0438\u043a\u043e\u0432 \u0432\u043c\u0435\u0441\u0442\u0435 \u0441 \u0440\u0435\u043a\u043b\u0430\u043c\u043e\u0439 \u0438\u043b\u0438 \u043f\u043b\u0430\u0442\u0451\u0436\u043d\u044b\u0445 \u0442\u0440\u0430\u043d\u0437\u0430\u043a\u0446\u0438\u0439 \u0437\u0430 \u043f\u043e\u0434\u043f\u0438\u0441\u043a\u0438 \u043d\u0430 \u0442\u0435\u0445 \u0436\u0435 \u043a\u043e\u0442\u0438\u043a\u043e\u0432. \u0418 \u0435\u0441\u043b\u0438 \u0441 \u043f\u0440\u043e\u0444\u0438\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435\u043c Go \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439 <a href=\"https:\/\/blog.golang.org\/pprof\" rel=\"nofollow\">\u0432\u0441\u0451 \u0431\u043e\u043b\u0435\u0435 \u0438\u043b\u0438 \u043c\u0435\u043d\u0435\u0435 \u043f\u043e\u043d\u044f\u0442\u043d\u043e<\/a>, \u0442\u043e \u0434\u043b\u044f \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439, \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u0445 \u043d\u0430 C \u0438\u043b\u0438 C++, \u0432\u0441\u0451 \u0433\u043e\u0440\u0430\u0437\u0434\u043e \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u0435\u0435.<\/p>\n<p>  <\/p>\n<p>\u0422\u0430\u043a \u043a\u0430\u043a \u0431\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u043e \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\u0430\u0442\u0435\u0440\u0438\u0430\u043b\u0438\u0437\u0443\u044e\u0442\u0441\u044f, \u043a\u0430\u043a \u043f\u0440\u0430\u0432\u0438\u043b\u043e, \u0432 \u043f\u0440\u043e\u0434\u0430\u043a\u0448\u0435\u043d\u0435, \u0442\u043e \u043d\u0430\u0441 \u0431\u0443\u0434\u0443\u0442 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043e\u0432\u0430\u0442\u044c \u0442\u0435 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0435 \u0442\u0440\u0435\u0431\u0443\u044e\u0442 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043a\u043e\u0434\u0430 \u0438, \u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e, \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 \u0438 \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. \u041a\u0440\u043e\u043c\u0435 \u0442\u043e\u0433\u043e, \u044f \u043d\u0435 \u0431\u0443\u0434\u0443 \u0443\u043f\u043e\u043c\u0438\u043d\u0430\u0442\u044c \u043f\u0440\u043e\u0444\u0438\u043b\u0438\u0440\u043e\u0432\u0449\u0438\u043a\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0430\u043d\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u044e\u0442 \u0440\u0430\u0431\u043e\u0442\u0443 \u043a\u043e\u0434\u0430 \u043d\u0430 \u0443\u0440\u043e\u0432\u043d\u0435 \u043c\u0438\u043a\u0440\u043e\u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u044b \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u0430 \u0442\u0438\u043f\u0430 vTune. \u0412\u043e-\u043f\u0435\u0440\u0432\u044b\u0445, \u043d\u0430 \u044d\u0442\u0443 \u0442\u0435\u043c\u0443 \u0441\u0442\u0430\u0442\u0435\u0439 \u0438 \u0442\u0430\u043a \u0445\u0432\u0430\u0442\u0430\u0435\u0442. \u0412\u043e-\u0432\u0442\u043e\u0440\u044b\u0445, \u044f \u043e\u0448\u0438\u0431\u043e\u0447\u043d\u043e \u043f\u043e\u043b\u0430\u0433\u0430\u044e, \u0447\u0442\u043e \u0432\u043e\u043f\u0440\u043e\u0441\u044b \u043c\u0438\u043a\u0440\u043e\u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u044b \u0431\u043e\u043b\u044c\u0448\u0435 \u0430\u043a\u0442\u0443\u0430\u043b\u044c\u043d\u044b \u0434\u043b\u044f \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u043e\u0432 middleware \u0442\u0438\u043f\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u043e\u0432 \u0431\u0430\u0437 \u0434\u0430\u043d\u043d\u044b\u0445 \u0438\u043b\u0438 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0430\u0441\u0442\u043e\u043b\u044c\u043a\u043e \u043a\u0440\u0443\u0442\u044b, \u0447\u0442\u043e \u0425\u0430\u0431\u0440 \u043d\u0435 \u0447\u0438\u0442\u0430\u044e\u0442. <\/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-315995","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/315995","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=315995"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/315995\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=315995"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=315995"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=315995"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}