{"id":380995,"date":"2024-06-29T03:24:49","date_gmt":"2024-06-29T03:24:49","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=380995"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=380995","title":{"rendered":"<span>\u0417\u0430\u0445\u0432\u0430\u0442\u044b\u0432\u0430\u044e\u0449\u0430\u044f \u043b\u043e\u0432\u043b\u044f \u0431\u0430\u0433\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u043e\u0440\u0442\u0438\u043b\u0438 \u0440\u0430\u0431\u043e\u0442\u0443 Unbound<\/span>"},"content":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<figure class=\"\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/237\/b5d\/f3a\/237b5df3a588ad2d0b7ff6144073562d.png\" alt=\"\" title=\"\" width=\"790\" height=\"362\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/237\/b5d\/f3a\/237b5df3a588ad2d0b7ff6144073562d.png\"\/><\/figure>\n<p>\u041f\u0440\u0438\u0432\u0435\u0442, \u043c\u0435\u043d\u044f \u0437\u043e\u0432\u0443\u0442 \u0421\u0435\u0440\u0433\u0435\u0439 \u041a\u0430\u0447\u0435\u0435\u0432, \u044f \u0441\u0442\u0430\u0440\u0448\u0438\u0439 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u0432 \u043e\u0442\u0434\u0435\u043b\u0435 \u0441\u0435\u0442\u0435\u0432\u043e\u0439 \u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b \u042f\u043d\u0434\u0435\u043a\u0441\u0430. \u0421\u0435\u0433\u043e\u0434\u043d\u044f \u044f \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0443 \u0446\u0435\u043b\u044b\u0439 \u0441\u0435\u0442\u0435\u0432\u043e\u0439 \u0434\u0435\u0442\u0435\u043a\u0442\u0438\u0432 \u043e \u0442\u043e\u043c, \u043a\u0430\u043a \u043c\u044b \u0438\u0441\u043a\u0430\u043b\u0438 \u0431\u0430\u0433, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0443\u0431\u0438\u0432\u0430\u043b DNS \u0441\u0435\u0440\u0432\u0435\u0440 Unbound. \u041f\u0440\u0438\u0433\u043e\u0442\u043e\u0432\u044c\u0442\u0435\u0441\u044c, \u043e\u043d \u0431\u0443\u0434\u0435\u0442 \u0434\u043e\u043b\u0433\u0438\u043c.<\/p>\n<p>\u0412\u0441\u0451 \u043d\u0430\u0447\u0430\u043b\u043e\u0441\u044c \u0441 \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u043c\u043d\u0435 \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0438\u043b\u0438 \u043f\u043e\u043c\u043e\u0447\u044c \u0440\u0435\u0431\u044f\u0442\u0430\u043c \u0438\u0437 \u043a\u043e\u043c\u0430\u043d\u0434\u044b DNS \u043d\u0430\u0439\u0442\u0438 \u0442\u0430\u043a\u0438\u0435 \u043c\u0435\u0442\u0440\u0438\u043a\u0438 \u0438 \u043d\u0430\u0431\u043e\u0440\u044b \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432, \u043f\u043e \u043a\u043e\u0442\u043e\u0440\u044b\u043c \u0431\u0443\u0434\u0435\u0442 \u043e\u0434\u043d\u043e\u0437\u043d\u0430\u0447\u043d\u043e \u043f\u043e\u043d\u044f\u0442\u043d\u043e, \u043a\u0430\u043a\u0438\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u0432\u043b\u0438\u044f\u044e\u0442 \u043d\u0430 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c Unbound \u0438 \u043a\u0430\u043a\u0438\u0435 \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u0432\u044b\u0437\u044b\u0432\u0430\u044e\u0442 \u0443 \u043d\u0435\u0433\u043e \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b.<\/p>\n<p>\u0412 \u0441\u0430\u043c\u043e\u043c \u043d\u0430\u0447\u0430\u043b\u0435 \u043d\u0430 \u0433\u0440\u0430\u0444\u0438\u043a\u0430\u0445 \u043d\u0430\u0433\u0440\u0443\u0437\u043e\u0447\u043d\u043e\u0433\u043e \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u044f \u0443\u0432\u0438\u0434\u0435\u043b \u043e\u0447\u0435\u043d\u044c \u043f\u043b\u043e\u0445\u0438\u0435 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b: \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u044b\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u0430\u0431\u0441\u043e\u043b\u044e\u0442\u043d\u043e \u0432\u0441\u0435 \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u043d\u0430\u0433\u0440\u0443\u0437\u043e\u0447\u043d\u043e\u0433\u043e \u0442\u0435\u0441\u0442\u0430 \u0442\u0430\u0439\u043c\u0430\u0443\u0442\u0438\u043b\u0438\u0441\u044c, \u043d\u043e \u0441\u0435\u0440\u0432\u0435\u0440, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u044b\u043b \u043f\u043e\u0434 \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u043e\u0439, \u043d\u0438\u043a\u0430\u043a \u043d\u0435 \u0440\u0435\u0430\u0433\u0438\u0440\u043e\u0432\u0430\u043b \u043d\u0430 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0443. \u041a\u0430\u043a \u0432\u044b\u044f\u0441\u043d\u0438\u043b\u043e\u0441\u044c \u043f\u043e\u0437\u0436\u0435, \u043f\u043e \u0447\u0438\u0441\u0442\u043e\u0439 \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u043e\u0441\u0442\u0438 \u044f \u0434\u043e\u043f\u0443\u0441\u0442\u0438\u043b \u043e\u0448\u0438\u0431\u043a\u0443 \u0432 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 \u043d\u0430\u0448\u0435\u0433\u043e \u043f\u043b\u0430\u0433\u0438\u043d\u0430 <a href=\"https:\/\/github.com\/yandex\/pandora\"><u>Pandora<\/u><\/a>, \u0438 \u0432 \u0438\u0442\u043e\u0433\u0435 \u043e\u043d \u0441\u0430\u043c \u0445\u043e\u0434\u0438\u043b \u0432 DNS \u043d\u0430 \u043a\u0430\u0436\u0434\u044b\u0439 \u0437\u0430\u043f\u0440\u043e\u0441, \u0447\u0442\u043e\u0431\u044b \u0443\u0437\u043d\u0430\u0442\u044c ip \u0430\u0434\u0440\u0435\u0441 \u0442\u0435\u0441\u0442\u0438\u0440\u0443\u0435\u043c\u043e\u0433\u043e \u0441\u0435\u0440\u0432\u0435\u0440\u0430. \u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u044d\u0442\u043e \u0441\u044b\u0433\u0440\u0430\u043b\u043e \u043c\u043d\u0435 \u043d\u0430 \u0440\u0443\u043a\u0443 \u0438 \u043f\u043e\u043c\u043e\u0433\u043b\u043e \u043d\u0430\u0439\u0442\u0438 \u043f\u0435\u0440\u0432\u0443\u044e \u0438\u0437 \u043f\u0440\u043e\u0431\u043b\u0435\u043c, \u0430 \u043f\u043e\u0442\u043e\u043c \u0438 \u0432\u043e\u0432\u0441\u0435 \u0437\u0430\u0434\u0430\u043b\u043e \u0432\u0435\u043a\u0442\u043e\u0440 \u043f\u043e\u0438\u0441\u043a\u043e\u0432 \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u0445 \u0431\u0430\u0433\u043e\u0432. \u0410 \u0432 Unbound \u0438\u0445 \u043d\u0430\u043a\u043e\u043f\u0438\u043b\u043e\u0441\u044c \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e.<\/p>\n<p>\u0423\u0442\u043e\u0447\u043d\u044e, \u0447\u0442\u043e \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u043f\u0440\u043e\u0432\u043e\u0434\u0438\u043b\u043e\u0441\u044c \u0432 LXC-\u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0435, \u043a\u043e\u0442\u043e\u0440\u043e\u043c\u0443 \u0431\u044b\u043b\u043e \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u043e 48 \u044f\u0434\u0435\u0440 \u0438 128 \u0413\u0431 \u043f\u0430\u043c\u044f\u0442\u0438. \u0423 \u0441\u0435\u0440\u0432\u0435\u0440\u0430, \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0437\u0430\u043f\u0443\u0449\u0435\u043d \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440, \u0431\u044b\u043b\u0438 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u0445\u0430\u0440\u0430\u043a\u0442\u0435\u0440\u0438\u0441\u0442\u0438\u043a\u0438:\u00a0<\/p>\n<pre><code>CPU: x2 Intel(R) E5-2660 v4 @ 2.00GHz - total Cores: 28 Threads: 56\u00a0 MEM: x4 Samsung 32GiB 2933MHz - total 128GiB NET: Intel 82599 10Gbit\/s<\/code><\/pre>\n<p>\u041d\u0430\u0433\u0440\u0443\u0437\u043a\u0430 \u043f\u043e\u0434\u0430\u0432\u0430\u043b\u0430\u0441\u044c \u043f\u043e \u0441\u0435\u0442\u0438 \u0441 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u043e\u0432, \u0440\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u043d\u044b\u0445 \u043d\u0430 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0445 \u0444\u0438\u0437\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u0441\u0435\u0440\u0432\u0435\u0440\u0430\u0445.<\/p>\n<h2>\u0410\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0430 worker \u0432 Unbound<\/h2>\n<p>\u041d\u0430\u0447\u043d\u0451\u043c \u0441 \u0442\u043e\u0433\u043e, \u043a\u0430\u043a \u0443\u0441\u0442\u0440\u043e\u0435\u043d Unbound. \u041f\u043e \u0441\u0443\u0442\u0438, \u044d\u0442\u043e \u0434\u0435\u043c\u043e\u043d, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e <a href=\"https:\/\/github.com\/NLnetLabs\/unbound\/blob\/0682d4371edda418ab5bea35554925574fa8c0d1\/daemon\/daemon.c#L637\"><u>\u0442\u0440\u0435\u0434\u043e\u0432<\/u><\/a>. \u041a\u0430\u0436\u0434\u044b\u0439 \u0442\u0440\u0435\u0434 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442 \u0441\u0432\u043e\u0439 <a href=\"https:\/\/github.com\/NLnetLabs\/unbound\/blob\/0682d4371edda418ab5bea35554925574fa8c0d1\/daemon\/worker.c#L1952\"><u>event loop<\/u><\/a>. \u0412 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0441\u043e\u0431\u044b\u0442\u0438\u0439 Unbound \u043f\u0435\u0440\u0435\u0434\u0430\u0451\u0442 \u043d\u0430\u0431\u043e\u0440 callback-\u0444\u0443\u043d\u043a\u0446\u0438\u0439, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0440\u0435\u0430\u0433\u0438\u0440\u0443\u044e\u0442 \u043d\u0430 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0435 \u0441\u0435\u0442\u0435\u0432\u044b\u0435 \u0441\u043e\u0431\u044b\u0442\u0438\u044f: \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0437\u0430\u043f\u0440\u043e\u0441 \u043e\u0442 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f, \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0430 \u0444\u0430\u0439\u043b\u043e\u0432\u044b\u0445 \u0437\u043e\u043d, \u043e\u0442\u0432\u0435\u0442 \u043d\u0430 \u0440\u0435\u043a\u0443\u0440\u0441\u0438\u0432\u043d\u044b\u0439 \u0437\u0430\u043f\u0440\u043e\u0441 \u0438 \u0434\u0440\u0443\u0433\u0438\u0435.<\/p>\n<figure class=\"\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w780q1\/getpro\/habr\/upload_files\/3d8\/344\/6d8\/3d83446d822b05f83b5ec89a94d763fe.jpeg\" alt=\"\u0412\u043e\u0442 \u0442\u0430\u043a \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 Unbound\" title=\"\u0412\u043e\u0442 \u0442\u0430\u043a \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 Unbound\" width=\"660\" height=\"447\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/3d8\/344\/6d8\/3d83446d822b05f83b5ec89a94d763fe.jpeg\" data-blurred=\"true\"\/><\/p>\n<div><figcaption>\u0412\u043e\u0442 \u0442\u0430\u043a \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 Unbound<\/figcaption><\/div>\n<\/figure>\n<p>\u0414\u043b\u044f \u0431\u0430\u043b\u0430\u043d\u0441\u0438\u0440\u043e\u0432\u043a\u0438 \u043c\u0435\u0436\u0434\u0443 \u0442\u0440\u0435\u0434\u0430\u043c\u0438 Unbound \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u043e\u043f\u0446\u0438\u044e \u043f\u0440\u0438 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0438 \u043f\u0440\u043e\u0441\u043b\u0443\u0448\u0438\u0432\u0430\u044e\u0449\u0435\u0433\u043e \u0441\u043e\u043a\u0435\u0442\u0430 <code>SO_REUSEPORT<\/code>. \u0421 \u043d\u0435\u0439 \u044f\u0434\u0440\u043e Linux \u0441\u0430\u043c\u043e \u0440\u0435\u0448\u0430\u0435\u0442, \u0432 \u043a\u0430\u043a\u043e\u0439 \u0442\u0440\u0435\u0434 \u043d\u0430\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u0442\u043e\u0442 \u0438\u043b\u0438 \u0438\u043d\u043e\u0439 \u0437\u0430\u043f\u0440\u043e\u0441 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f. \u041e\u0431 \u044d\u0442\u043e\u043c \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043e \u0432 \u0441\u0442\u0430\u0442\u044c\u0435 <a href=\"https:\/\/blog.flipkart.tech\/linux-tcp-so-reuseport-usage-and-implementation-6bfbf642885a\"><u>Linux TCP SO_REUSEPORT \u2014 Usage and implementation<\/u><\/a>.<\/p>\n<p>\u0414\u0430\u043b\u0435\u0435 event loop \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442 \u043e\u0442 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u0443\u0432\u0435\u0434\u043e\u043c\u043b\u0435\u043d\u0438\u044f \u043e \u043f\u0440\u0438\u0448\u0435\u0434\u0448\u0438\u0445 \u043f\u0430\u043a\u0435\u0442\u0430\u0445 \u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442 callback-\u0444\u0443\u043d\u043a\u0446\u0438\u0438. \u0412\u0441\u0451 \u043f\u0440\u043e\u0441\u0442\u043e.<\/p>\n<p>\u0415\u0449\u0451 \u043e\u0434\u043d\u0430 \u0432\u0430\u0436\u043d\u0430\u044f \u0434\u0435\u0442\u0430\u043b\u044c. \u0414\u043b\u044f \u0443\u0441\u043a\u043e\u0440\u0435\u043d\u0438\u044f \u043e\u0442\u0432\u0435\u0442\u043e\u0432 \u0438\u0437 \u043a\u044d\u0448\u0438\u0440\u0443\u044e\u0449\u0438\u0445 \u0441\u0435\u0440\u0432\u0435\u0440\u043e\u0432 \u043c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044e hyperlocal zone. \u041e\u043d\u0430 \u043f\u043e\u0434\u0440\u0430\u0437\u0443\u043c\u0435\u0432\u0430\u0435\u0442, \u0447\u0442\u043e \u043d\u0430 DNS \u0441\u0435\u0440\u0432\u0435\u0440\u0430\u0445 \u0445\u0440\u0430\u043d\u0438\u0442\u0441\u044f \u043a\u043e\u043f\u0438\u044f auth-zone \u2014 \u0442\u043e \u0435\u0441\u0442\u044c \u0444\u0430\u0439\u043b\u0430, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0445\u0440\u0430\u043d\u044f\u0442\u0441\u044f DNS-\u0437\u0430\u043f\u0438\u0441\u0438. \u0417\u0430 \u0441\u0447\u0451\u0442 \u044d\u0442\u043e\u0433\u043e \u043e\u0442\u0432\u0435\u0442\u044b \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f\u043c \u043e\u0442\u0434\u0430\u044e\u0442\u0441\u044f \u0431\u044b\u0441\u0442\u0440\u0435\u0435, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u0434\u0430\u043d\u043d\u044b\u0435 \u0441\u0447\u0438\u0442\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u043d\u0430 \u043c\u0435\u0441\u0442\u0435, \u0430 \u043d\u0435 \u0441\u043e\u0437\u0434\u0430\u0451\u0442\u0441\u044f \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439 \u0437\u0430\u043f\u0440\u043e\u0441 \u0432 authority-\u0441\u0435\u0440\u0432\u0435\u0440. \u041f\u0435\u0440\u0435\u0434\u0430\u044e\u0442\u0441\u044f \u044d\u0442\u0438 \u0444\u0430\u0439\u043b\u044b \u0441 \u043c\u0430\u0441\u0442\u0435\u0440\u0430 \u043d\u0430 \u0440\u0435\u043f\u043b\u0438\u043a\u0438 \u0447\u0435\u0440\u0435\u0437 \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c\u044b, \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u0435 \u0432 Unbound.<\/p>\n<h2>\u0412\u0437\u0434\u0440\u044b\u0436\u043d\u0438. \u0418 \u043f\u0440\u0438\u0447\u0451\u043c \u0442\u0443\u0442 \u0444\u0430\u0439\u043b\u043e\u0432\u044b\u0435 Authority Zone<\/h2>\n<p>\u0412 \u0441\u0430\u043c\u043e\u043c \u043d\u0430\u0447\u0430\u043b\u0435 \u044f \u0443\u043f\u043e\u043c\u044f\u043d\u0443\u043b \u043f\u0440\u043e \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u044b\u0439 \u0441\u043b\u0443\u0447\u0430\u0439. \u0418\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442 \u0434\u043b\u044f \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f\u00a0 \u043f\u0435\u0440\u0435\u0434 \u043a\u0430\u0436\u0434\u044b\u043c \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u043c \u0440\u0435\u0437\u043e\u043b\u0432\u0438\u043b \u0430\u0434\u0440\u0435\u0441 \u0442\u0435\u0441\u0442\u0438\u0440\u0443\u0435\u043c\u043e\u0433\u043e \u0441\u0435\u0440\u0432\u0435\u0440\u0430. \u0418\u043d\u043e\u0433\u0434\u0430 \u0442\u0430\u043a\u0438\u0435 \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u0432 DNS \u0442\u0430\u0439\u043c\u0430\u0443\u0442\u0438\u043b\u0438\u0441\u044c.<\/p>\n<p>\u041f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u0431\u044b\u043b\u0430 \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u044f \u043d\u0435 \u0437\u043d\u0430\u043b \u0438\u0441\u0442\u0438\u043d\u043d\u0443\u044e \u043f\u0440\u0438\u0447\u0438\u043d\u0443 \u0442\u0430\u0439\u043c\u0430\u0443\u0442\u043e\u0432. \u042f \u043d\u0435 \u043c\u043e\u0433 \u043f\u043e\u043d\u044f\u0442\u044c, \u0447\u0442\u043e \u043d\u0435 \u0442\u0430\u043a \u0438\u043c\u0435\u043d\u043d\u043e \u0441 \u043c\u043e\u0438\u043c \u0441\u0442\u0435\u043d\u0434\u043e\u043c: \u043f\u043e\u0447\u0435\u043c\u0443 \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0443 \u0434\u0440\u0443\u0433\u0438\u0445 \u043a\u043e\u043b\u043b\u0435\u0433 \u043f\u0440\u043e\u0445\u043e\u0434\u0438\u0442 \u0431\u0435\u0437 \u0442\u0430\u043a\u0438\u0445 \u0432\u0441\u043f\u043b\u0435\u0441\u043a\u043e\u0432 100% \u0442\u0430\u0439\u043c\u0430\u0443\u0442\u043e\u0432. \u041a\u0430\u043a\u0430\u044f \u0436\u0435 \u0431\u044b\u043b\u0430 \u0432\u0437\u0430\u0438\u043c\u043e\u0441\u0432\u044f\u0437\u044c \u043c\u0435\u0436\u0434\u0443 \u044d\u0442\u0438\u043c\u0438 \u0442\u0430\u0439\u043c\u0430\u0443\u0442\u0430\u043c\u0438 \u0438 \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435\u043c load-\u0441\u0442\u0435\u043d\u0434\u0430?<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/10b\/f95\/049\/10bf9504971f32084d20e70d4479783d.png\" alt=\"\u041f\u0440\u0438\u043c\u0435\u0440 \u043f\u043b\u043e\u0445\u043e\u0433\u043e \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430 \u043d\u0430\u0433\u0440\u0443\u0437\u043e\u0447\u043d\u043e\u0433\u043e \u0442\u0435\u0441\u0442\u0430\" title=\"\u041f\u0440\u0438\u043c\u0435\u0440 \u043f\u043b\u043e\u0445\u043e\u0433\u043e \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430 \u043d\u0430\u0433\u0440\u0443\u0437\u043e\u0447\u043d\u043e\u0433\u043e \u0442\u0435\u0441\u0442\u0430\" width=\"1600\" height=\"808\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/10b\/f95\/049\/10bf9504971f32084d20e70d4479783d.png\"\/><\/p>\n<div><figcaption>\u041f\u0440\u0438\u043c\u0435\u0440 \u043f\u043b\u043e\u0445\u043e\u0433\u043e \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430 \u043d\u0430\u0433\u0440\u0443\u0437\u043e\u0447\u043d\u043e\u0433\u043e \u0442\u0435\u0441\u0442\u0430<\/figcaption><\/div>\n<\/figure>\n<p>\u041f\u043e\u044f\u0441\u043d\u044e, \u0447\u0442\u043e \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u043d\u0430 \u0433\u0440\u0430\u0444\u0438\u043a\u0430\u0445. \u0422\u0430\u0439\u043c\u0438\u043d\u0433\u0438 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u0438\u043d\u043e\u0433\u0434\u0430 \u043e\u0447\u0435\u043d\u044c \u0431\u043e\u043b\u044c\u0448\u0438\u0435 \u0438 \u0432 \u044d\u0442\u043e \u0436\u0435 \u0432\u0440\u0435\u043c\u044f \u043f\u043e\u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f 502 \u043e\u0448\u0438\u0431\u043a\u0438. \u0423\u0442\u043e\u0447\u043d\u044e, \u0447\u0442\u043e \u0438\u0437\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e <a href=\"http:\/\/overload.yandex.net\">overload.yandex.net<\/a> \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043b\u0441\u044f \u043d\u0430 \u043f\u043e\u043a\u0430\u0437\u0435 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u0432 \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f http-\u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432, \u0438 \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043a\u043e\u0434\u044b \u043e\u0442\u0432\u0435\u0442\u0430 \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u043a\u0430\u043a HTTP. \u041d\u043e \u043d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435 \u0432 \u043f\u043b\u0430\u0433\u0438\u043d\u0435 Pandora \u043c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u0442\u0430\u043a\u0443\u044e \u0442\u0440\u0430\u043d\u0441\u043b\u044f\u0446\u0438\u044e \u043e\u0448\u0438\u0431\u043e\u043a:<\/p>\n<pre><code class=\"go\">DnsServerTimeout:   502, DnsAmmoNotSupported:503, dns.RcodeSuccess:   200, dns.RcodeFormatError:   400, dns.RcodeServerFailure: 401, \/\/ NXDOMAIN dns.RcodeNameError:  402, dns.RcodeNotImplemented: 403, dns.RcodeRefused:    404, dns.RcodeYXDomain:   405, dns.RcodeYXRrset:    406, dns.RcodeNXRrset:    407, dns.RcodeNotAuth:    408, dns.RcodeNotZone:    409, dns.RcodeBadSig:     410, dns.RcodeBadKey:     411, dns.RcodeBadTime:    412, dns.RcodeBadMode:    413, dns.RcodeBadName:    414, dns.RcodeBadAlg:     415, dns.RcodeBadTrunc:   416, dns.RcodeBadCookie:  417,<\/code><\/pre>\n<p>\u042f \u043a\u0440\u0443\u0442\u0438\u043b \u0432\u0441\u0451, \u0447\u0442\u043e \u0442\u043e\u043b\u044c\u043a\u043e \u043c\u043e\u0433 \u0432 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430\u0445 LXD-\u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u043a\u0440\u0443\u0442\u0438\u043b\u0441\u044f \u0441\u0442\u0435\u043d\u0434. \u042f \u043f\u0435\u0440\u0435\u043d\u043e\u0441\u0438\u043b \u0441\u0442\u0435\u043d\u0434 \u043d\u0430 \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0435 \u044f\u0434\u0440\u0430 \u0438 \u043f\u0435\u0440\u0435\u043c\u0435\u0449\u0430\u043b \u0434\u0430\u043d\u043d\u044b\u0435 Unbound \u0432 tmpfs. \u041d\u0435 \u043f\u043e\u043c\u043e\u0433\u0430\u043b\u043e. \u0411\u043e\u043b\u044c\u0448\u0435 \u0432\u0441\u0435\u0433\u043e \u0441\u043c\u0443\u0449\u0430\u043b\u043e \u0442\u043e, \u0447\u0442\u043e \u044d\u0444\u0444\u0435\u043a\u0442 \u0441\u043e\u0432\u0435\u0440\u0448\u0435\u043d\u043d\u043e \u043d\u0435 \u0437\u0430\u0432\u0438\u0441\u0435\u043b \u043e\u0442 \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u0438: 1rps, 1Krps, 5Krps \u2014 \u043d\u0435\u0432\u0430\u0436\u043d\u043e! \u0412\u0441\u0451 \u0442\u0430\u043a \u0436\u0435 \u043f\u043e\u044f\u0432\u043b\u044f\u043b\u0438\u0441\u044c 100% \u0442\u0430\u0439\u043c\u0430\u0443\u0442\u043e\u0432.<\/p>\n<p>\u042f \u0438\u0437\u0443\u0447\u0438\u043b \u0432\u0441\u0435 \u0441\u043e\u043c\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u043c\u0435\u0441\u0442\u0430 \u0432 \u043a\u043e\u0434\u0435 Unbound: \u0441\u043c\u043e\u0442\u0440\u0435\u043b \u043d\u0430 \u0432\u0441\u0451, \u0447\u0442\u043e \u0442\u043e\u043b\u044c\u043a\u043e \u043c\u043e\u0433 \u0442\u0443\u043b\u0430\u043c\u0438 \u0438\u0437 bcc-tools, bpf-tools \u0438 atop. \u0418 \u0432\u0435\u0434\u044c \u043d\u0430\u0448\u0451\u043b \u0447\u0442\u043e-\u0442\u043e \u043f\u043e\u0434\u043e\u0437\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0435! \u0418\u043d\u043e\u0433\u0434\u0430 \u043c\u043e\u043c\u0435\u043d\u0442\u044b \u0432\u0437\u0434\u0440\u044b\u0436\u043d\u0435\u0439 (\u0442\u0430\u043a \u043c\u044b \u043d\u0430\u0437\u0432\u0430\u043b\u0438 \u044d\u0442\u043e\u0442 \u044d\u0444\u0444\u0435\u043a\u0442 \u0432 \u043a\u043e\u043c\u0430\u043d\u0434\u0435 DNS) \u0441\u043e\u0432\u043f\u0430\u0434\u0430\u043b\u0438 \u0441 \u043c\u043e\u043c\u0435\u043d\u0442\u043e\u043c \u0437\u0430\u043f\u0438\u0441\u0438 \u0444\u0430\u0439\u043b\u043e\u0432\u044b\u0445 \u0437\u043e\u043d.<\/p>\n<p>\u0412 <a href=\"https:\/\/unbound.docs.nlnetlabs.nl\/en\/latest\/manpages\/unbound.conf.html?highlight=forward-no-cache#authority-zone-options\"><u>\u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438<\/u><\/a> \u043e\u0431 \u044d\u0442\u043e\u043c \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043e \u0442\u0430\u043a:<\/p>\n<blockquote>\n<p><em>Authority zones can be read from zonefile. And can be kept updated via AXFR\u00a0 and\u00a0 IXFR. After\u00a0 update the zonefile is rewritten.<\/em><\/p>\n<\/blockquote>\n<p>\u042f \u043d\u0430\u0447\u0430\u043b \u043a\u043e\u043f\u0430\u0442\u044c \u0432 \u044d\u0442\u043e\u043c \u043c\u0435\u0441\u0442\u0435. \u041e\u0447\u0435\u0440\u0435\u0434\u043d\u0430\u044f \u043f\u043e\u043f\u044b\u0442\u043a\u0430: atop \u0438 bpftrace \u0437\u0430\u043f\u0443\u0449\u0435\u043d\u044b, netdata \u043e\u0442\u043a\u0440\u044b\u0442\u0430. \u0421\u043c\u043e\u0442\u0440\u0438\u043c, \u0436\u0434\u0451\u043c.<\/p>\n<pre><code class=\"bash\">ns-load.name:~$ sudo bpftrace -e 'tracepoint:syscalls:sys_enter_openat                    \/\/              |,---------------^                    \/\/  \u043a\u0430\u043a\u043e\u0435 \u0441\u043e\u0431\u044b\u0442\u0438\u0435 \u0432 \u0441\u0438\u0441\u0442\u0435\u043c\u0435 \u043c\u044b \u0441\u043e\u0431\u0438\u0440\u0430\u0435\u043c\u0441\u044f \u043c\u043e\u043d\u0438\u0442\u043e\u0440\u0438\u0442\u044c.                    \/\/  \u041f\u0440\u043e \u044d\u0442\u043e \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0447\u0438\u0442\u0430\u0442\u044c \u0432 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438 man bpftrace,   \/\/  \u0438 \u0442\u0430\u043c \u0436\u0435 \u043f\u0440\u043e kprobe \u0438 uprobe. \/\/  \/\/ - \u044d\u0442\u043e \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0439 \u0432 \u043a\u043e\u0434\u0435 bpftrace-\u0441\u043a\u0440\u0438\u043f\u0442\u0430. \/\/  ,- filter, \u043b\u043e\u0432\u0438\u0442\u044c \u0441\u043e\u0431\u044b\u0442\u0438\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0442 Unbound, \/\/  |  \u0437\u0430\u043f\u0443\u0449\u0435\u043d\u043d\u043e\u0433\u043e \u0432 \u044d\u0442\u043e\u043c lxc-\u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0435, \/\/  |  \u0430 \u0435\u0441\u043b\u0438 \u0442\u043e\u0447\u043d\u0435\u0435 \u2014 \u0442\u043e\u043b\u044c\u043a\u043e \u0432 cgroup,  \/\/  |  \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u043e\u0439 \u044d\u0442\u0438\u043c systemd-\u0441\u0435\u0440\u0432\u0438\u0441\u043e\u043c. \/cgroup == cgroupid(\"\/sys\/fs\/cgroup\/unified\/system.slice\/unbound.service\")\/ \/\/ \u041e\u0434\u043d\u043e\u0441\u0442\u0440\u043e\u0447\u043d\u0438\u043a, \u0441\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u044e\u0449\u0438\u0439 \u043d\u0430 \u043a\u0430\u0436\u0434\u043e\u0435 \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u043e\u0435 \u0441\u043e\u0431\u044b\u0442\u0438\u0435 \u2014 \u0432 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 tracepoint { printf(\"%s %s %s\\n\", strftime(\"%H:%M:%S\", nsecs), comm, str(args->filename)); }' | grep slave  # \u043d\u0430\u043c \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u044b \u0442\u043e\u043b\u044c\u043a\u043e \u0437\u043e\u043d\u044b 14:03:22 unbound \/etc\/unbound\/slave\/db.yandex.net.tmp2136807 14:03:29 unbound \/etc\/unbound\/slave\/cloud.yandex.net.tmp2136807 14:03:33 unbound \/etc\/unbound\/slave\/db.yandex.net.tmp2136807 14:03:41 unbound \/etc\/unbound\/slave\/cloud-preprod.yandex.net.tmp2136807 14:03:45 unbound \/etc\/unbound\/slave\/db.yandex.net.tmp2136807 14:03:53 unbound \/etc\/unbound\/slave\/db.yandex.net.tmp2136807 14:03:59 unbound \/etc\/unbound\/slave\/yandexcloud.net.tmp2136807<\/code><\/pre>\n<p>\u0425\u043e\u0440\u043e\u0448\u043e, \u043a\u0430\u043a\u0443\u044e-\u0442\u043e \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u0443\u044e \u043a\u043e\u0440\u0440\u0435\u043b\u044f\u0446\u0438\u044e \u044f \u043f\u043e\u0439\u043c\u0430\u043b. \u041f\u0443\u0441\u0442\u044c \u043e\u043d\u0430 \u043d\u0435 \u0441\u0442\u0430\u0431\u0438\u043b\u044c\u043d\u0430, \u043d\u043e \u044d\u0442\u043e \u0445\u043e\u0442\u044c \u043a\u0430\u043a\u043e\u0439-\u0442\u043e \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442.<\/p>\n<p>\u0412 atop\/htop \u0432\u0438\u0434\u043d\u043e, \u0447\u0442\u043e \u043f\u0440\u0438 \u0437\u0430\u043f\u0438\u0441\u0438 \u0444\u0430\u0439\u043b\u043e\u0432\u043e\u0439 \u0437\u043e\u043d\u044b \u0442\u0440\u0435\u0434, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u044d\u0442\u0438\u043c \u0437\u0430\u043d\u0438\u043c\u0430\u0435\u0442\u0441\u044f, \u043d\u0430 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0441\u0435\u043a\u0443\u043d\u0434 \u0441\u044a\u0435\u0434\u0430\u043b \u0432\u0441\u0451 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u043d\u043e\u0435 \u044f\u0434\u0440\u043e \u043f\u043e\u0434 100%. \u0410 \u0441\u0430\u043c\u0430\u044f \u0431\u043e\u043b\u044c\u0448\u0430\u044f \u0438\u0437 \u044d\u0442\u0438\u0445 \u0437\u043e\u043d \u0437\u0430\u043d\u0438\u043c\u0430\u0435\u0442 \u043f\u0440\u0438\u0431\u043b\u0438\u0437\u0438\u0442\u0435\u043b\u044c\u043d\u043e 70 \u041c\u0411 \u043d\u0430 \u0434\u0438\u0441\u043a\u0435 \u2014 \u043d\u0430 \u043d\u0435\u0439 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u043f\u0440\u043e\u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u044f\u0440\u0447\u0435 \u0432\u0441\u0435\u0433\u043e.<\/p>\n<p>\u0414\u043b\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u044f \u0440\u0435\u0448\u0438\u043b \u043e\u0442\u043a\u043b\u044e\u0447\u0438\u0442\u044c auth-zone \u0438 \u0437\u0430\u043c\u0435\u043d\u0438\u0442\u044c \u043e\u0434\u043d\u0443 \u0438\u0437 \u043d\u0438\u0445 \u043d\u0430 local-zone, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0435 \u043f\u0438\u0448\u0443\u0442\u0441\u044f \u043d\u0430 \u0434\u0438\u0441\u043a. \u041f\u043e\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u043b \u043f\u0440\u043e\u0432\u0435\u0441\u0442\u0438 \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u0443 \u0437\u0430\u043f\u0440\u043e\u0441\u0430\u043c\u0438, \u0445\u043e\u0434\u044f\u0449\u0438\u043c\u0438 \u0442\u043e\u043b\u044c\u043a\u043e \u0432 \u044d\u0442\u0443 local-zone. \u0418 \u043a\u0430\u043a\u043e\u0432\u043e \u0431\u044b\u043b\u043e \u043c\u043e\u0451 \u0443\u0434\u0438\u0432\u043b\u0435\u043d\u0438\u0435, \u043a\u043e\u0433\u0434\u0430 \u043f\u0435\u0440\u0432\u044b\u0439 \u0442\u0435\u0441\u0442 \u0432\u044b\u0434\u0430\u043b \u043c\u043d\u0435 \u0436\u0435\u043b\u0430\u0435\u043c\u044b\u0439 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442, \u0430 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u0431\u044b\u043b \u0434\u0430\u0436\u0435 \u0445\u0443\u0436\u0435 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0438\u0445 \u2014 \u0432\u0437\u0434\u0440\u044b\u0436\u043d\u0438 \u043d\u0435 \u043f\u0440\u043e\u0448\u043b\u0438.<\/p>\n<p>\u0412 \u044d\u0442\u043e\u0442 \u043c\u043e\u043c\u0435\u043d\u0442 \u044f \u043d\u0430\u0447\u0430\u043b \u0441\u043e\u043c\u043d\u0435\u0432\u0430\u0442\u044c\u0441\u044f \u0432\u043e \u0432\u0441\u0435\u0445 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u0430\u0445, \u0438 \u0432\u043e \u0432\u0441\u0435\u0445 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0438\u0445 \u0434\u043e\u0433\u0430\u0434\u043a\u0430\u0445. \u041f\u043e\u0441\u0442\u0435\u043f\u0435\u043d\u043d\u043e \u044f \u043f\u0435\u0440\u0435\u0448\u0451\u043b \u043a \u0434\u0435\u0431\u0430\u0433\u0443 Pandora. \u0421\u043f\u0443\u0441\u0442\u044f \u0432\u0440\u0435\u043c\u044f \u044f \u043d\u0430\u0448\u0451\u043b \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0443 \u0432 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 \u0438 \u043f\u043e\u043f\u0440\u0430\u0432\u0438\u043b \u043f\u043b\u0430\u0433\u0438\u043d, \u0447\u0442\u043e\u0431\u044b \u043e\u043d \u043d\u0435 \u0440\u0430\u0437\u0440\u0435\u0448\u0430\u043b \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c DNS \u0438\u043c\u044f \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 target. \u041f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0441\u044f, \u0447\u0442\u043e \u044f \u043b\u043e\u0432\u0438\u043b \u0442\u0435 \u0441\u0430\u043c\u044b\u0435 \u0432\u0437\u0434\u0440\u044b\u0436\u043d\u0438, \u043d\u043e \u0441\u043e \u0441\u0442\u043e\u0440\u043e\u043d\u044b \u043f\u043b\u0430\u0433\u0438\u043d\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0445\u043e\u0434\u0438\u043b \u0432 DNS. \u041d\u0430\u0433\u0440\u0443\u0437\u043e\u0447\u043d\u043e\u0435 \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0432 local-zone \u0438 auth-zone \u0442\u043e\u0436\u0435 \u043f\u043e\u043a\u0430\u0437\u0430\u043b\u043e \u0436\u0435\u043b\u0430\u0435\u043c\u043e\u0435 \u2014 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b \u0432 local-zone \u043d\u0435\u0442, \u0430 \u0432 auth-zone \u0435\u0441\u0442\u044c.<\/p>\n<p>\u0412\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u043c\u0441\u044f \u043a \u0434\u0435\u0431\u0430\u0433\u0443 auth-zone. \u0423 \u043c\u0435\u043d\u044f \u0431\u044b\u043b\u043e \u0447\u0451\u0442\u043a\u043e\u0435 \u0441\u043e\u0432\u043f\u0430\u0434\u0435\u043d\u0438\u0435 \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0433\u043e \u0444\u043e\u043d\u0430 \u0442\u0430\u0439\u043c\u0430\u0443\u0442\u043e\u0432 \u0441 \u043c\u043e\u043c\u0435\u043d\u0442\u043e\u043c \u043f\u0435\u0440\u0435\u0437\u0430\u043f\u0438\u0441\u0438 \u0444\u0430\u0439\u043b\u0430 \u0444\u0430\u0439\u043b\u043e\u0432\u043e\u0439 \u0437\u043e\u043d\u044b.<\/p>\n<pre><code class=\"lua\">         15:38:59: open path: slave\/db.yandex.net.tmp926625 # &lt;&lt; \u0441\u0431\u0440\u043e\u0441 \u0444\u0430\u0439\u043b\u043e\u0432\u043e\u0439                                                             # \u0437\u043e\u043d\u044b \u0432\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0439 \u0444\u0430\u0439\u043b,                                                             # \u0442\u0443\u0442 \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u0442 \u0433\u043e\u0440\u0435\u0442\u044c CPU \u0443 \u0442\u0440\u0435\u0434\u0430        7 2022-11-18T15:38:59   # &lt;&lt; \u043a\u043e\u043b-\u0432\u043e \u043e\u0448\u0438\u0431\u043e\u043a       32 2022-11-18T15:39:00     15:39:03: open path: slave\/cloud.yandex.net.tmp926625     15:39:12: open path: slave\/cloud.yandex.net.tmp926625     15:39:15: open path: slave\/yandexcloud.net.tmp926625     15:39:19: open path: slave\/cloud.yandex.net.tmp926625     15:39:21: open path: slave\/db.yandex.net.tmp926625        2 2022-11-18T15:39:21       22 2022-11-18T15:39:22        3 2022-11-18T15:39:23     15:39:28: open path: slave\/cloud.yandex.net.tmp926625     15:39:33: open path: slave\/yandexcloud.net.tmp926625     15:39:37: open path: slave\/db.yandex.net.tmp926625       29 2022-11-18T15:39:37       13 2022-11-18T15:39:38 <\/code><\/pre>\n<p>\u0418\u0437 \u043a\u043e\u0434\u0430 \u044f \u043f\u043e\u043d\u044f\u043b, \u043a\u0430\u043a\u043e\u0439 callback-\u0444\u0443\u043d\u043a\u0446\u0438\u0435\u0439 Unbound \u043e\u0442\u0432\u0435\u0447\u0430\u0435\u0442 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044e: <code>comm_point_udp_callback<\/code>. \u0427\u0442\u043e\u0431\u044b \u0443\u0432\u0438\u0434\u0435\u0442\u044c \u043c\u0435\u0434\u043b\u0435\u043d\u043d\u044b\u0435 \u043e\u0442\u0432\u0435\u0442\u044b \u043d\u0430 \u0437\u0430\u043f\u0440\u043e\u0441\u044b, \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0437\u0430\u043c\u0435\u0440\u0438\u0442\u044c \u0432\u0440\u0435\u043c\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0435\u0451 \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0435\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 <code>worker_handle_request<\/code><em>.<\/em><\/p>\n<p>\u0421\u043c\u043e\u0442\u0440\u0438\u043c \u043d\u0430 \u0435\u0451 \u0442\u0430\u0439\u043c\u0438\u043d\u0433\u0438:<\/p>\n<pre><code class=\"bash\">srv58:~$ sudo funclatency-bpfcc -u  \/usr\/sbin\/unbound-1.17.0-release:worker_handle_request -p 1953108 Tracing 1 functions for \"\/usr\/sbin\/unbound-1.17.0-release:worker_handle_request\"... Hit Ctrl-C to end. ^C      usecs               : count     distribution          0 -> 1          : 3        |                                        |          2 -> 3          : 304      |                                        |          4 -> 7          : 5630     |******                                  |          8 -> 15         : 35734    |****************************************|         16 -> 31         : 12844    |**************                          |         32 -> 63         : 1281     |*                                       |         64 -> 127        : 215      |                                        |        128 -> 255        : 53       |                                        |        256 -> 511        : 46       |                                        |        512 -> 1023       : 26       |                                        |       1024 -> 2047       : 0        |                                        |       2048 -> 4095       : 1        |                                        | Detaching...<\/code><\/pre>\n<p>\u0412\u0441\u0435 \u043e\u0442\u0432\u0435\u0442\u044b \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u044e\u0442\u0441\u044f \u0432 \u043f\u0440\u0435\u0434\u0435\u043b\u0430\u0445 \u043e\u0434\u043d\u043e\u0439 \u043c\u0438\u043b\u043b\u0438\u0441\u0435\u043a\u0443\u043d\u0434\u044b \u2014 \u0433\u0434\u0435 \u0436\u0435 \u0442\u0430\u0439\u043c\u0430\u0443\u0442\u044b?<\/p>\n<p>\u0412\u0441\u043f\u043e\u043c\u0438\u043d\u0430\u0435\u043c, \u0447\u0442\u043e Unbound \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u0440\u0430\u0437\u043d\u044b\u0435 \u0432\u0438\u0434\u044b callback-\u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u0438 \u0434\u043b\u044f \u0437\u0430\u043f\u0438\u0441\u0438 \u0444\u0430\u0439\u043b\u043e\u0432\u044b\u0445 \u0437\u043e\u043d \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f <code>auth_xfer_transfer_tcp_callback<\/code>:<\/p>\n<pre><code class=\"bash\">ns-load.name:~$ sudo bpftrace -e ' uprobe:\/usr\/sbin\/unbound-1.17.0-release:auth_xfer_transfer_tcp_callback { @start[tid] = nsecs; } uretprobe:\/usr\/sbin\/unbound-1.17.0-release:auth_xfer_transfer_tcp_callback \/@start[tid]\/ { @ns[comm,pid] = hist((nsecs - @start[tid]) \/ 1e3); delete(@start[tid]); }' Attaching 2 probes... ^C  @ns[unbound, 2020368]: [64K, 128K)            4 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@                  | [128K, 256K)           6 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@| [256K, 512K)           3 |@@@@@@@@@@@@@@@@@@@@@@@@@@                          | [512K, 1M)             0 |                                                    | [1M, 2M)               0 |                                                    | [2M, 4M)               2 |@@@@@@@@@@@@@@@@@                                   | # K \u2014 \u043c\u0438\u043b\u043b\u0438\u0441\u0435\u043a\u0443\u043d\u0434\u044b, M \u2014 \u0441\u0435\u043a\u0443\u043d\u0434\u044b<\/code><\/pre>\n<p>\u0412 \u0432\u044b\u0432\u043e\u0434\u0435 \u0432\u0438\u0434\u043d\u043e, \u0447\u0442\u043e \u0431\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u043e \u0432\u044b\u0437\u043e\u0432\u043e\u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 <code>auth_xfer_transfer_tcp_callback<\/code><em> <\/em>\u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u0437\u0430 256 \u043c\u0438\u043b\u043b\u0438\u0441\u0435\u043a\u0443\u043d\u0434 \u2014 \u044d\u0442\u043e \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0431\u044b\u0441\u0442\u0440\u043e. \u041d\u043e \u0435\u0441\u0442\u044c \u0438 \u0442\u0430\u043a\u0438\u0435, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0437\u0430\u043d\u0438\u043c\u0430\u044e\u0442 \u043f\u043e 4 \u0441\u0435\u043a\u0443\u043d\u0434\u044b, \u0438 \u044d\u0442\u043e \u043e\u0447\u0435\u043d\u044c \u0434\u043e\u043b\u0433\u043e.<\/p>\n<p>\u041a\u043e\u0433\u0434\u0430 \u044f \u0441\u043d\u043e\u0432\u0430 \u0432\u0435\u0440\u043d\u0443\u043b\u0441\u044f \u043a \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0435 \u0438 \u043a\u043e\u0434\u0443 Unbound, \u0432\u044b\u044f\u0441\u043d\u0438\u043b\u043e\u0441\u044c, \u0447\u0442\u043e \u043e\u0442\u0432\u0435\u0442 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044e <a href=\"https:\/\/github.com\/NLnetLabs\/unbound\/blob\/6f7da59b7744c345be580db2bd9b37380cab5a42\/util\/netevent.c#L934\"><u>comm_point_udp_callback<\/u><\/a> \u0441 <a href=\"https:\/\/github.com\/NLnetLabs\/unbound\/blob\/0682d4371edda418ab5bea35554925574fa8c0d1\/daemon\/worker.c#L1266\"><u>worker_handle_request<\/u><\/a> \u0432\u043d\u0443\u0442\u0440\u0438 \u0438 <a href=\"https:\/\/github.com\/NLnetLabs\/unbound\/blob\/0419b06ca45a18632cbb848ea97f7cd9e6abe913\/services\/authzone.c#L6140\"><u>auth_xfer_transfer_tcp_callback<\/u><\/a> \u0441 <a href=\"https:\/\/github.com\/NLnetLabs\/unbound\/blob\/0419b06ca45a18632cbb848ea97f7cd9e6abe913\/services\/authzone.c#L1729\"><u>auth_zone_write_file<\/u><\/a> \u2014 \u044d\u0442\u043e \u0434\u0432\u0430 \u0440\u0430\u0437\u043d\u044b\u0445 callback, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0435 \u043c\u043e\u0433\u0443\u0442 \u043e\u0434\u043d\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0432 \u0442\u0440\u0435\u0434\u0435.<\/p>\n<p>\u0412\u043e\u0442 \u043a\u0430\u043a \u044d\u0442\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442. \u041a\u043e\u0433\u0434\u0430 \u042f\u0434\u0440\u043e Linux \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 udp\/tcp-\u043f\u0430\u043a\u0435\u0442, \u043e\u043d\u043e \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442 \u0435\u0433\u043e \u0432 \u043e\u0447\u0435\u0440\u0435\u0434\u044c \u043d\u0430 \u043f\u0440\u0438\u0451\u043c \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u043e\u0433\u043e \u0442\u0440\u0435\u0434\u0430 \u0438\u0437-\u0437\u0430 \u0432\u043a\u043b\u044e\u0447\u0435\u043d\u043d\u043e\u0439 \u043e\u043f\u0446\u0438\u0438 SO_REUSEPORT. \u0417\u0430\u0442\u0435\u043c libevent \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442 \u043d\u043e\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044e \u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442 callback, \u0430 \u0434\u0440\u0443\u0433\u0438\u0435 udp\/tcp \u043f\u0430\u043a\u0435\u0442\u044b \u0432 \u043e\u0447\u0435\u0440\u0435\u0434\u0438 \u044d\u0442\u043e\u0433\u043e \u0442\u0440\u0435\u0434\u0430 \u0436\u0434\u0443\u0442 \u0435\u0433\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u0432\u0430\u0436\u043d\u043e, \u0447\u0442\u043e\u0431\u044b callback \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u043b\u0441\u044f \u0431\u044b\u0441\u0442\u0440\u043e.<\/p>\n<p>\u042f \u0432\u044b\u044f\u0441\u043d\u0438\u043b, \u0447\u0442\u043e \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 <code>auth_xfer_transfer_tcp_callback<\/code> \u0435\u0433\u043e \u0442\u043e\u0440\u043c\u043e\u0437\u0438\u0442 <code>auth_zone_write_file<\/code>. \u041f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0441\u044f, \u0447\u0442\u043e \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u0436\u0434\u0443\u0442 \u0437\u0430\u043f\u0438\u0441\u0438 \u0444\u0430\u0439\u043b\u043e\u0432\u043e\u0439 \u0437\u043e\u043d\u044b. \u041f\u0440\u0438 \u044d\u0442\u043e\u043c \u043f\u0435\u0440\u0435\u043c\u0435\u0449\u0435\u043d\u0438\u0435 \u0444\u0430\u0439\u043b\u043e\u0432\u044b\u0445 \u0437\u043e\u043d \u0432 <code>tmpfs<\/code> \u043d\u0435 \u0434\u0430\u0451\u0442 \u0436\u0435\u043b\u0430\u0435\u043c\u043e\u0433\u043e \u044d\u0444\u0444\u0435\u043a\u0442\u0430, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0435 \u0432\u0440\u0435\u043c\u044f \u0443\u0445\u043e\u0434\u0438\u0442 \u043d\u0430 \u0441\u0435\u0440\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e \u0438 \u0431\u0435\u0441\u043a\u043e\u043d\u0435\u0447\u043d\u043e\u0435 \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e \u0432\u044b\u0437\u043e\u0432\u043e\u0432 <code>write<\/code>.<\/p>\n<p>\u041f\u043e\u0441\u043e\u0432\u0435\u0442\u043e\u0432\u0430\u0432\u0448\u0438\u0441\u044c, \u043c\u044b \u0432\u044b\u043d\u0435\u0441\u043b\u0438 \u0437\u0430\u043f\u0438\u0441\u044c \u0444\u0430\u0439\u043b\u043e\u0432\u044b\u0445 \u0437\u043e\u043d \u0432 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439 \u0442\u0440\u0435\u0434, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043d\u0438\u0447\u0435\u043c \u0434\u0440\u0443\u0433\u0438\u043c \u043d\u0435 \u0431\u0443\u0434\u0435\u0442 \u0437\u0430\u043d\u0438\u043c\u0430\u0442\u044c\u0441\u044f. \u041c\u044b \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u0438\u043b\u0438 \u043f\u0430\u0442\u0447\u0438 \u0432 \u043d\u0430\u0448 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u044b\u0439 \u0444\u043e\u0440\u043a \u0438 \u0432 upstream <a href=\"https:\/\/github.com\/NLnetLabs\/unbound\/pull\/794\"><u>PR#794<\/u><\/a> (\u043f\u0440\u0430\u0432\u0434\u0430, \u043f\u043e\u043a\u0430 \u043e\u043d \u0442\u0440\u0435\u0431\u0443\u0435\u0442 \u0434\u043e\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u043f\u043e\u0434 \u0432\u0441\u0435 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u043c\u044b\u0435 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u044b). <\/p>\n<h2>\u041f\u0440\u043e\u0434\u043e\u043b\u0436\u0430\u0435\u043c \u043f\u043e\u0438\u0441\u043a\u0438 \u043e\u0448\u0438\u0431\u043e\u043a<\/h2>\n<p>\u041a\u0430\u043a \u043c\u044b \u0437\u043d\u0430\u0435\u043c, \u0431\u0430\u0433\u0438 \u043d\u0435 \u043f\u0440\u0438\u0445\u043e\u0434\u044f\u0442 \u043f\u043e\u043e\u0434\u0438\u043d\u043e\u0447\u043a\u0435, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u044f \u043f\u0440\u0438\u0441\u0442\u0443\u043f\u0438\u043b \u043a \u043f\u043e\u0438\u0441\u043a\u0430\u043c \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u0445. \u041f\u043e\u0441\u043b\u0435 \u043e\u0447\u0435\u0440\u0435\u0434\u043d\u043e\u0433\u043e \u0440\u0430\u0437\u0431\u043e\u0440\u0430 \u0438\u043d\u0446\u0438\u0434\u0435\u043d\u0442\u0430 c Unbound \u0440\u0435\u0431\u044f\u0442\u0430 \u0438\u0437 \u043a\u043e\u043c\u0430\u043d\u0434\u044b DNS \u0434\u043e\u0431\u0430\u0432\u0438\u043b\u0438 \u0432\u043e \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0438\u0439 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0430\u0446\u0438\u0438 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u0439:<\/p>\n<ul>\n<li>\n<p>\u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0435 \u0441\u043d\u044f\u0442\u0438\u0435 \u0434\u0430\u043c\u043f\u0430 \u043f\u0430\u043c\u044f\u0442\u0438 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430 Unbound;<\/p>\n<\/li>\n<li>\n<p>\u0441\u043d\u044f\u0442\u0438\u0435 \u0441\u0442\u0435\u043a \u0442\u0440\u0435\u0439\u0441\u043e\u0432 \u043f\u043e \u0432\u0441\u0435\u043c \u0442\u0440\u0435\u0434\u0430\u043c (\u043d\u0435 \u0447\u0435\u0440\u0435\u0437 <code>thread apply all bt<\/code>, \u0430 \u0438\u043d\u0434\u0438\u0432\u0438\u0434\u0443\u0430\u043b\u044c\u043d\u043e \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0442\u0440\u0435\u0434\u0430);<\/p>\n<\/li>\n<li>\n<p>\u0437\u0430\u043c\u0435\u0440 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 perf \u0443\u0442\u0438\u043b\u0438\u0442\u043e\u0439;<\/p>\n<\/li>\n<li>\n<p>\u0441\u0431\u043e\u0440 \u043b\u043e\u0433\u043e\u0432.<\/p>\n<\/li>\n<\/ul>\n<p>\u0412\u0441\u0451, \u0447\u0442\u043e \u043e\u0441\u0442\u0430\u0432\u0430\u043b\u043e\u0441\u044c \u2014 \u0434\u043e\u0436\u0434\u0430\u0442\u044c\u0441\u044f \u043c\u043e\u043c\u0435\u043d\u0442\u0430 \u0430\u043a\u0442\u0438\u0432\u0430\u0446\u0438\u0438 \u0442\u0440\u0438\u0433\u0433\u0435\u0440\u0430 \u043d\u0430 \u0430\u043d\u043e\u043c\u0430\u043b\u044c\u043d\u043e\u0435 \u043f\u043e\u0432\u044b\u0448\u0435\u043d\u0438\u0435 Load Average \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u0438 \u0438\u0437\u0443\u0447\u0438\u0442\u044c \u0432\u0441\u0451 \u0441\u043e\u0431\u0440\u0430\u043d\u043d\u043e\u0435. \u0410 \u044f \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0438\u043b \u0437\u0430\u043d\u0438\u043c\u0430\u0442\u044c\u0441\u044f \u043b\u043e\u0430\u0434-\u0441\u0442\u0435\u043d\u0434\u043e\u043c.<\/p>\n<p>\u041d\u0435\u043c\u043d\u043e\u0433\u043e \u0441\u043f\u0443\u0441\u0442\u044f \u0443 \u043d\u0430\u0441 \u043f\u043e\u044f\u0432\u0438\u043b\u0441\u044f\u00a0 \u0434\u0430\u043c\u043f \u043f\u0430\u043c\u044f\u0442\u0438, \u0441\u043e\u0431\u0440\u0430\u043d\u043d\u044b\u0439 \u043f\u0440\u0438 \u0430\u043d\u043e\u043c\u0430\u043b\u044c\u043d\u043e\u043c \u043f\u043e\u0432\u044b\u0448\u0435\u043d\u0438\u0438 Load Average, \u0438 \u0442\u0443\u0442 \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u0442\u0441\u044f \u0441\u0430\u043c\u043e\u0435 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e\u0435. \u041f\u0435\u0440\u0432\u043e\u0435, \u0447\u0442\u043e \u0431\u0440\u043e\u0441\u0438\u043b\u043e\u0441\u044c \u0432 \u0433\u043b\u0430\u0437\u0430 \u043f\u0440\u0438 \u043e\u0441\u043c\u043e\u0442\u0440\u0435 \u0441\u043d\u044f\u0442\u044b\u0445 stack trace \u2014 \u043f\u043e\u0447\u0442\u0438 \u0432\u0441\u0435 \u0442\u0440\u0435\u0434\u044b \u0432\u0438\u0441\u0435\u043b\u0438 \u043d\u0430 <code>pthread_spin_lock<\/code>. Unbound \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u0438\u0445 \u0432 \u043c\u0435\u0441\u0442\u0430\u0445, \u0433\u0434\u0435, \u043f\u043e \u0435\u0433\u043e \u043c\u043d\u0435\u043d\u0438\u044e, \u0431\u0443\u0434\u0435\u0442 \u043e\u0447\u0435\u043d\u044c \u0431\u044b\u0441\u0442\u0440\u044b\u0439 \u0434\u043e\u0441\u0442\u0443\u043f.\u00a0<\/p>\n<details class=\"spoiler\">\n<summary>\u0414\u043b\u044f \u043d\u0430\u0433\u043b\u044f\u0434\u043d\u043e\u0441\u0442\u0438 \u043f\u043e\u043a\u0430\u0436\u0443, \u043a\u0430\u043a \u044d\u0442\u043e \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u043b\u043e \u0432 coredump<\/summary>\n<div class=\"spoiler__content\">\n<pre><code class=\"cpp\">gdb \/usr\/sbin\/unbound (gdb) core-file core_534009.gdb warning: core file may not match specified executable file. [New LWP 534009] ... #0  0x00007f8fa0d22d15 in pthread_spin_lock () from \/lib\/x86_64-linux-gnu\/libpthread.so.0 [Current thread is 1 (Thread 0x7f8fa1557dc0 (LWP 534009))] (gdb) info threads   Id   Target Id                           Frame * 1    Thread 0x7f8fa1557dc0 (LWP 534009)  0x00007f8fa0d22d15 in pthread_spin_lock () from \/lib\/x86_64-linux-gnu\/libpthread.so.0 \/\/ \u0442\u0443\u0442 \u043c\u043d\u043e\u0433\u043e \u0442\u0440\u0435\u0434\u043e\u0432 \u043e\u0442\u043d\u043e\u0441\u044f\u0449\u0438\u0435\u0441\u044f \u043a yp_dns, \u043d\u0430\u043c \u043e\u043d\u0438 \u043d\u0435\u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u044b ...   87   Thread 0x7f8f68f74700 (LWP 535239)  0x00007f8fa0d22d12 in pthread_spin_lock () from \/lib\/x86_64-linux-gnu\/libpthread.so.0   88   Thread 0x7f8f68773700 (LWP 535240)  0x00007f8fa0d22d15 in pthread_spin_lock () from \/lib\/x86_64-linux-gnu\/libpthread.so.0   89   Thread 0x7f8f6715f700 (LWP 535241)  0x00007f8fa0d22d15 in pthread_spin_lock () from \/lib\/x86_64-linux-gnu\/libpthread.so.0   90   Thread 0x7f8f6695e700 (LWP 535242)  0x00007f8fa0d22d15 in pthread_spin_lock () from \/lib\/x86_64-linux-gnu\/libpthread.so.0   91   Thread 0x7f8f6615d700 (LWP 535243)  0x00007f8fa0d22d15 in pthread_spin_lock () from \/lib\/x86_64-linux-gnu\/libpthread.so.0   92   Thread 0x7f8f650f3700 (LWP 535244)  0x0000000002fef501 in bin_find_entry (table=0x75b7fb42c80, bin=&lt;optimized out>, hash=2852359060, key=0x75f1ab5cdd0) at \/-S\/contrib\/tools\/unbound\/util\/storage\/lruhash.c:223   93   Thread 0x7f8f648f2700 (LWP 535245)  0x00007f8fa0d22d12 in pthread_spin_lock () from \/lib\/x86_64-linux-gnu\/libpthread.so.0 ... \/\/ \u0412\u0441\u0435 \u0442\u0440\u0435\u0434\u044b, \u0432\u0438\u0441\u044f\u0449\u0438\u0435 \u043d\u0430 pthread_spin_lock   104  Thread 0x7f8f5db8d700 (LWP 535256)  0x00007f8fa0d22d15 in pthread_spin_lock () from \/lib\/x86_64-linux-gnu\/libpthread.so.0   105  Thread 0x7f8f5d38c700 (LWP 535257)  0x00007f8fa0d22d15 in pthread_spin_lock () from \/lib\/x86_64-linux-gnu\/libpthread.so.0 ... \/\/ \u0412\u0441\u0435 \u0442\u0440\u0435\u0434\u044b, \u0432\u0438\u0441\u044f\u0449\u0438\u0435 \u043d\u0430 pthread_spin_lock   117  Thread 0x7f8f18385700 (LWP 535269)  0x00007f8fa0d22d15 in pthread_spin_lock () from \/lib\/x86_64-linux-gnu\/libpthread.so.0 (gdb) bt #0  0x00007f8fa0d22d15 in pthread_spin_lock () from \/lib\/x86_64-linux-gnu\/libpthread.so.0 #1  0x0000000002fef852 in lruhash_lookup (table=0x75b7fb42c80, hash=2948070628, key=key@entry=0x7fff134b2ae8, wr=wr@entry=0) at \/-S\/contrib\/tools\/unbound\/util\/storage\/lruhash.c:362 #2  0x0000000002ff0dae in slabhash_lookup (sl=sl@entry=0x75b7f1a68c0, hash=2948070628, key=0x7fff134b2a01, key@entry=0x7fff134b2ae8, wr=wr@entry=0) at \/-S\/contrib\/tools\/unbound\/util\/storage\/slabhash.c:125 #3  0x0000000002f849e6 in rrset_cache_lookup (r=0x75b7f1a68c0, qname=&lt;optimized out>, qnamelen=&lt;optimized out>, qtype=qtype@entry=1, qclass=qclass@entry=0, flags=flags@entry=0, timenow=1670937529, wr=0) at \/-S\/contrib\/tools\/unbound\/services\/cache\/rrset.c:293 ... \/\/ \u041e\u0441\u0442\u0430\u043b\u044c\u043d\u043e\u0435 \u043d\u0430\u043c \u043f\u043e\u043a\u0430 \u043d\u0435\u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e. (gdb) thread 92 [Switching to thread 92 (Thread 0x7f8f650f3700 (LWP 535244))] #0  0x0000000002fef501 in bin_find_entry (table=0x75b7fb42c80, bin=&lt;optimized out>, hash=2852359060, key=0x75f1ab5cdd0) at \/-S\/contrib\/tools\/unbound\/util\/storage\/lruhash.c:223 223\/-S\/contrib\/tools\/unbound\/util\/storage\/lruhash.c: No such file or directory. (gdb) bt #0  0x0000000002fef501 in bin_find_entry (table=0x75b7fb42c80, bin=&lt;optimized out>, hash=2852359060, key=0x75f1ab5cdd0) at \/-S\/contrib\/tools\/unbound\/util\/storage\/lruhash.c:223 #1  lruhash_insert (table=0x75b7fb42c80, hash=hash@entry=2852359060, entry=entry@entry=0x75f1ab5cdd0, data=0x75f31a7f4e0, cb_arg=cb_arg@entry=0x75b60f3c088) at \/-S\/contrib\/tools\/unbound\/util\/storage\/lruhash.c:320 #2  0x0000000002ff0d8e in slabhash_insert (sl=sl@entry=0x75b7f1a68c0, hash=448122320, hash@entry=2852359060, entry=0x75f30e5e366, entry@entry=0x75f1ab5cdd0, data=0x75f31a7f4e0, arg=arg@entry=0x75b60f3c088) at \/-S\/contrib\/tools\/unbound\/util\/storage\/slabhash.c:119 #3  0x0000000002f84685 in rrset_cache_update (r=0x75b7f1a68c0, ref=ref@entry=0x7f8f650f0d60, alloc=0x75b60f3c088, timenow=1670937529) at \/-S\/contrib\/tools\/unbound\/services\/cache\/rrset.c:227 ...<\/code><\/pre>\n<\/p>\n<\/div>\n<\/details>\n<p>\u0418\u0442\u0430\u043a, \u044f \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0438\u043b \u0434\u0432\u0430 \u0443\u0437\u043a\u0438\u0445 \u043c\u0435\u0441\u0442\u0430: \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 <code>bin_find_entry<\/code> \u0438 \u043e\u0436\u0438\u0434\u0430\u043d\u0438\u0435 \u043b\u043e\u043a\u0430 \u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 <code>lruhash_lookup<\/code>.<\/p>\n<h3>\u0421\u043d\u043e\u0432\u0430 \u043f\u0440\u043e \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0443 \u2014 \u043a\u044d\u0448\u0438<\/h3>\n<p>\u042f \u0432\u043d\u043e\u0432\u044c \u043f\u043e\u0433\u0440\u0443\u0437\u0438\u043b\u0441\u044f \u0432 \u0438\u0437\u0443\u0447\u0435\u043d\u0438\u0435 \u043a\u043e\u0434\u0430 \u2014 \u043d\u0430 \u044d\u0442\u043e\u0442 \u0440\u0430\u0437 \u0432 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0443 \u043a\u044d\u0448\u0435\u0439. \u0412 Unbound \u0435\u0441\u0442\u044c \u0441\u0430\u043c\u043e\u043f\u0438\u0441\u043d\u0430\u044f <code>concurrent hash map<\/code> \u0434\u043b\u044f \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u043a\u044d\u0448\u0435\u0439 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432. \u042d\u0442\u043e \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 \u0432 <a href=\"https:\/\/github.com\/NLnetLabs\/unbound\/blob\/e11d206a825349ca447ee27b35aeee4f00271483\/util\/storage\/lruhash.h#L147\"><u>lruhash.h#L147<\/u><\/a>, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0432\u043e\u0442 \u0442\u0430\u043a:<\/p>\n<pre><code class=\"cpp\"> struct lruhash { lock_quick_type lock;       \/** lock for exclusive access, to the lookup array *\/ struct lruhash_bin* array;  \/** lookup array of bins *\/  size_t num;             \/** the number of entries in the hash table. *\/ size_t size;                \/** the size of the lookup array *\/ size_t space_used;     \/** the amount of space used, roughly the number of bytes in use. *\/ size_t space_max;     \/** the amount of space the hash table is maximally allowed to use. *\/         \/\/ ... \u044f \u043e\u0441\u0442\u0430\u0432\u0438\u043b \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u043e\u043b\u0435\u0437\u043d\u044b\u0435 \u043d\u0430\u043c \u043f\u043e\u043b\u044f };<\/code><\/pre>\n<p>\u0412\u043d\u0443\u0442\u0440\u0438 <code>lruhash<\/code> \u0445\u0440\u0430\u043d\u0438\u0442\u0441\u044f \u043c\u0430\u0441\u0441\u0438\u0432 \u0431\u0438\u043d\u043e\u0432, \u0432 \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0438 \u043f\u043e\u043c\u0435\u0449\u0430\u044e\u0442\u0441\u044f \u0437\u0430\u043f\u0438\u0441\u0438 \u043a\u044d\u0448 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u2014 \u043a\u043b\u0430\u0441\u0441\u0438\u0447\u0435\u0441\u043a\u0430\u044f \u0445\u044d\u0448-\u0442\u0430\u0431\u043b\u0438\u0446\u0430 \u0441 <code>linked list<\/code>. \u041e\u0434\u0438\u043d <code>lruhash_bin<\/code> (\u0434\u043b\u044f \u043a\u0440\u0430\u0442\u043a\u043e\u0441\u0442\u0438 \u043f\u0440\u043e\u0441\u0442\u043e BIN) \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0442\u0430\u043a:<\/p>\n<pre><code class=\"cpp\">struct lruhash_bin { lock_quick_type lock;                   \/* Lock for exclusive access to the linked list *\/ struct lruhash_entry* overflow_list; \/* linked list of overflow entries *\/ };<\/code><\/pre>\n<p><code>lruhash_entry<\/code> (\u0434\u043b\u044f \u043a\u0440\u0430\u0442\u043a\u043e\u0441\u0442\u0438 \u043f\u0440\u043e\u0441\u0442\u043e ENTRY) \u2014 \u044d\u0442\u043e \u0437\u0430\u043f\u0438\u0441\u044c \u043d\u0430\u0448\u0435\u0433\u043e \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u0432 \u043a\u044d\u0448\u0435. \u0412 \u0434\u0435\u0442\u0430\u043b\u0438 \u0442\u0443\u0442 \u043c\u043e\u0436\u043d\u043e \u043d\u0435 \u0432\u0434\u0430\u0432\u0430\u0442\u044c\u0441\u044f.<\/p>\n<p>\u0414\u043e\u0441\u0442\u0443\u043f \u043a \u0440\u0430\u0437\u043d\u044b\u043c <code>lruhash<\/code> \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u0431\u0435\u0437 \u043b\u043e\u043a\u043e\u0432. \u0412\u0441\u0435 <code>lruhash<\/code> \u0441\u043f\u0440\u044f\u0442\u0430\u043d\u044b \u0432\u043d\u0443\u0442\u0440\u0438 <code>slabhash<\/code>. \u0425\u044d\u0448 \u043c\u0430\u043f \u2014 \u0444\u0438\u043a\u0441\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0433\u043e \u0440\u0430\u0437\u043c\u0435\u0440\u0430 \u0438 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u043d\u0430 \u0447\u0442\u0435\u043d\u0438\u0435. slabhash-\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 \u0432 <a href=\"https:\/\/github.com\/NLnetLabs\/unbound\/blob\/e11d206a825349ca447ee27b35aeee4f00271483\/util\/storage\/slabhash.h#L57\"><u>slabhash.h#L57<\/u><\/a> \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0432\u043e\u0442 \u0442\u0430\u043a:<\/p>\n<pre><code class=\"cpp\">struct slabhash {     \/\/ \u041f\u0440\u043e\u0441\u0442\u043e \u043f\u0440\u0435\u0434\u0430\u043b\u043b\u043e\u0446\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u043c\u0430\u0441\u0441\u0438\u0432 lruhash,     \/\/ \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u043a\u043e\u0442\u043e\u0440\u044b\u043c \u0438\u0434\u0451\u0442 \u043f\u043e \u043a\u0443\u0441\u043e\u0447\u043a\u0443 \u043e\u0442 \u0445\u044d\u0448\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 \u0438\u0437 \u0437\u0430\u043f\u0440\u043e\u0441\u0430\/\u043e\u0442\u0432\u0435\u0442\u0430     struct lruhash** array;  \/** lookup array of hash tables *\/       \/\/ \u044d\u0442\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0434\u043b\u044f \u0430\u0434\u0440\u0435\u0441\u0430\u0446\u0438\u0438     size_t size;       \/** the size of the array - must be power of 2 *\/     uint32_t mask;   \/** size bitmask - uses high bits. *\/     unsigned int shift;    \/** shift right this many bits to get index into array. *\/ };<\/code><\/pre>\n<p>\u041b\u044e\u0431\u0438\u043c\u044b\u0435 \u0441\u0430\u043c\u043e\u043f\u0438\u0441\u043d\u044b\u0435 \u0445\u044d\u0448 \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u0441 \u0442\u0430\u043a\u0438\u043c\u0438 \u043b\u044e\u0431\u0438\u043c\u044b\u043c\u0438 \u0431\u0430\u0433\u0430\u043c\u0438 \u0438 \u0444\u0438\u0447\u0430\u043c\u0438! \u041d\u0438\u0436\u0435 \u044f \u043f\u043e\u043f\u044b\u0442\u0430\u043b\u0441\u044f \u0441\u0445\u0435\u043c\u0430\u0442\u0438\u0447\u043d\u043e \u0438\u0437\u043e\u0431\u0440\u0430\u0437\u0438\u0442\u044c \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443 <code>slabhash<\/code>:<\/p>\n<pre><code>                       ,- \u0414\u043e\u0441\u0442\u0443\u043f \u043f\u043e \u044d\u0442\u043e\u043c\u0443 \u0438\u043d\u0434\u0435\u043a\u0441\u0443 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u0431\u0435\u0437 \u043b\u043e\u043a\u043e\u0432,                               \/   \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u044d\u0442\u043e\u0442 \u043c\u0430\u0441\u0441\u0438\u0432 \u0444\u0438\u043a\u0441\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0433\u043e \u0440\u0430\u0437\u043c\u0435\u0440\u0430, \u0437\u0430\u0434\u0430\u043d\u043d\u043e\u0433\u043e \u043d\u0430 \u0441\u0442\u0430\u0440\u0442\u0435,                      \/    \u0430 \u0438\u043d\u0434\u0435\u043a\u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u0434\u043b\u044f \u0447\u0442\u0435\u043d\u0438\u044f \u043c\u0430\u0441\u0441\u0438\u0432\u0430.                     \/ slabhash->array[&lt;slab_type>-size]                          ,------  \u0414\u043b\u044f \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u043f\u043e \u044d\u0442\u043e\u043c\u0443 \u0438\u043d\u0434\u0435\u043a\u0441\u0443 \u0443\u0436\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f spin_lock(*1), \u043f\u043e\u0442\u043e\u043c\u0443-\u0447\u0442\u043e                        \/         \u044d\u0442\u043e\u0442 \u043c\u0430\u0441\u0441\u0438\u0432 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0440\u0435\u0430\u043b\u043b\u043e\u0446\u0438\u0440\u043e\u0432\u0430\u043d \u0438 \u044d\u0442\u043e \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u044f \u043d\u0430 \u0437\u0430\u043f\u0438\u0441\u044c. \u0414\u043b\u044f \u044d\u043a\u043e\u043d\u043e\u043c\u0438\u0438    [0]lruhash->array [...]       \u043c\u0435\u0441\u0442\u0430 \u043d\u0430 \u0441\u0442\u0430\u0440\u0442\u0435 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430 \u044d\u0442\u043e\u0442 \u043c\u0430\u0441\u0441\u0438\u0432 \u043c\u0430\u043b\u0435\u043d\u044c\u043a\u043e\u0433\u043e \u0440\u0430\u0437\u043c\u0435\u0440\u0430 \u2014 \u0432\u0441\u0435\u0433\u043e 1024.                                  \u041a\u043e\u0433\u0434\u0430 \u043c\u0430\u0441\u0441\u0438\u0432 \u0437\u0430\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f (lruhash->num >= lruhash->size) \u043e\u043d \u0440\u0435\u0430\u043b\u043b\u043e\u0446\u0438\u0440\u0443\u0435\u0442\u0441\u044f                                  \u043f\u043e \u043c\u0435\u0440\u0435 \u0437\u0430\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u043a\u044d\u0448\u0430. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0434\u043b\u044f 10G, \u044d\u0442\u043e\u0442 \u0440\u0430\u0437\u043c\u0435\u0440 \u043c\u043e\u0436\u0435\u0442 \u0432\u044b\u0440\u0430\u0441\u0442\u0438 \u0434\u043e                                  1048576. \u0410 \u044d\u0442\u043e \u0437\u043d\u0430\u0447\u0438\u0442, \u0447\u0442\u043e \u043f\u043e\u0441\u043b\u0435 \u043e\u0447\u0435\u0440\u0435\u0434\u043d\u043e\u0439 \u0440\u0435\u0430\u043b\u043b\u043e\u043a\u0430\u0446\u0438\u0438 \u043f\u0440\u0438\u0434\u0451\u0442\u0441\u044f                                  \u0441\u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043f\u043e \u043d\u043e\u0432\u043e\u043c\u0443 \u043c\u0430\u0441\u0441\u0438\u0432\u0443 1048576\/2 BIN-\u043e\u0432 \u0438\u0437 \u0441\u0442\u0430\u0440\u043e\u0433\u043e.                                  \u042d\u0442\u0430 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u044f \u043d\u0435 \u0442\u0440\u0435\u0431\u0443\u0435\u0442 \u043f\u0435\u0440\u0435\u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f \u0445\u044d\u0448\u0430 \u0438\u043b\u0438 \u0432\u044b\u0437\u043e\u0432\u0430 `strcmp`.                                  \u0415\u0451 \u0441\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u041e(N) \u043e\u0442 \u0440\u0430\u0437\u043c\u0435\u0440\u0430 \u043c\u0430\u0441\u0441\u0438\u0432\u0430, \u043d\u043e \u0434\u0435\u043b\u0430\u0435\u0442\u0441\u044f \u043e\u043d\u0430 \u043f\u043e\u0434 \u043b\u043e\u043a\u043e\u043c!        [1]lruhash->array [BIN, BIN, BIN, BIN, _, ...] - \u043c\u0430\u0441\u0441\u0438\u0432, \u0440\u0435\u0430\u043b\u043b\u043e\u0446\u0438\u0440\u0443\u0435\u043c\u044b\u0439 \u043f\u0440\u0438 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438.    [2]...              8    8    8     \\                             8    8      ` - \u043d\u0430 BIN \u0442\u043e\u0436\u0435 \u0431\u0435\u0440\u0451\u0442\u0441\u044f  spin_lock (*2)                             8    [3]...                    `- linked-list \u0438\u0437 ENTRY, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0434\u043b\u044f \u0440\u0430\u0437\u0440\u0435\u0448\u0435\u043d\u0438\u044f \u043a\u043e\u043b\u043b\u0438\u0437\u0438\u0439 \u0432 \u043d\u0438\u0436\u043d\u0435\u0439 \u0447\u0430\u0441\u0442\u0438 \u0445\u044d\u0448\u0430,    [4]...                       \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043d\u0443\u0436\u043d\u0430 \u0434\u043b\u044f \u0430\u0434\u0440\u0435\u0441\u0430\u0446\u0438\u0438 \u0432\u043d\u0443\u0442\u0440\u0438 `lruhash->array`.                                 Unbound, \u043a\u0430\u043a \u0438 \u0432\u0441\u0435 \u0445\u044d\u0448 \u0442\u0430\u0431\u043b\u0438\u0446\u044b, \u0441\u0442\u0430\u0440\u0430\u0435\u0442\u0441\u044f \u0434\u0435\u0440\u0436\u0430\u0442\u044c \u043f\u043e \u043e\u0434\u043d\u043e\u043c\u0443 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0443 \u0432 \u0431\u0438\u043d\u0435,                                  \u043d\u043e \u0445\u044d\u0448 \u0444\u0443\u043d\u043a\u0446\u0438\u044f, \u043a\u0430\u043a \u043f\u0440\u0430\u0432\u0438\u043b\u043e, \u0434\u0430\u0451\u0442 \u043a\u043e\u043b\u043b\u0438\u0437\u0438\u0438,                                  \u0438 \u0432 \u0431\u0438\u043d\u0435 \u0445\u0440\u0430\u043d\u0438\u0442\u0441\u044f \u043e\u0442 0 \u0434\u043e 13 entry (\u0432\u044b\u044f\u0441\u043d\u0435\u043d\u043e \u043d\u0430 \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0435).                                 \u0414\u043b\u044f \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f ENTRY \u0437\u0430\u0449\u0438\u0449\u0435\u043d\u044b (*3)mutex-\u043e\u043c.                                 \u0420\u0430\u0437\u043c\u0435\u0440 linked-list \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d \u043f\u043e \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439 \u0444\u043e\u0440\u043c\u0443\u043b\u0435:                                 CACHE-SIZE \/ &lt;type>-SLABS \/ len(LRUHASH->ARRAY.)                                 \u0412\u0438\u0434\u043d\u043e, \u0447\u0442\u043e \u044d\u0442\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u043d\u0430 \u0441\u0442\u0430\u0440\u0442\u0435 \u0447\u0435\u0440\u0435\u0437 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e                                 &lt;type>-SLABS(\u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 \u0432 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438), \u0430 \u0434\u0430\u043b\u044c\u0448\u0435 \u2014 \u0432 runtime \u0447\u0435\u0440\u0435\u0437 \u0434\u043b\u0438\u043d\u0443                                 len(LRUHASH-ARRAY) \u043f\u043e\u0441\u043b\u0435 \u043a\u0430\u0436\u0434\u043e\u0439 \u0440\u0435\u0430\u043b\u043b\u043e\u043a\u0430\u0446\u0438\u0438.    [5]...    [6]lruhash->array    [7]lruhash->array [...]<\/code><\/pre>\n<p>\u0414\u043b\u044f \u0443\u043c\u0435\u043d\u044c\u0448\u0435\u043d\u0438\u044f <code>lock contention<\/code> (\u0442\u043e \u0435\u0441\u0442\u044c \u043f\u043e\u043f\u044b\u0442\u043e\u043a \u0437\u0430\u0445\u0432\u0430\u0442\u0438\u0442\u044c \u0443\u0436\u0435 \u0437\u0430\u0445\u0432\u0430\u0447\u0435\u043d\u043d\u044b\u0439 \u0434\u0440\u0443\u0433\u0438\u043c \u0442\u0440\u0435\u0434\u043e\u043c \u043b\u043e\u043a) \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f <code>slabhash->array<\/code> \u2014 \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u044b\u0439 lock-free \u043e\u0431\u044a\u0435\u043a\u0442. \u041a\u0430\u0436\u0434\u044b\u0439 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439 <code>lruhash->array<\/code> \u2014 \u044d\u0442\u043e \u0442\u043e\u0436\u0435 \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u044b\u0439 \u043e\u0431\u044a\u0435\u043a\u0442 \u0438 \u0432\u0441\u0435 \u0442\u0440\u0435\u0434\u044b \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0442 \u0441 \u043d\u0438\u043c \u043a\u043e\u043d\u043a\u0443\u0440\u0435\u043d\u0442\u043d\u043e. \u041d\u043e \u043a\u0430\u0436\u0434\u044b\u0439 <code>lruhash<\/code> \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0441\u043e \u0441\u0432\u043e\u0438\u043c \u043d\u0430\u0431\u043e\u0440\u043e\u043c \u043b\u043e\u043a\u043e\u0432. \u0422\u043e \u0435\u0441\u0442\u044c \u0434\u0432\u0430 <code>lruhash<\/code> \u043c\u043e\u0433\u0443\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u043e \u043d\u0430 \u0434\u0432\u0443\u0445 \u0442\u0440\u0435\u0434\u0430\u0445, \u043d\u0435 \u0431\u043b\u043e\u043a\u0438\u0440\u0443\u044f \u0434\u0440\u0443\u0433 \u0434\u0440\u0443\u0433\u0430.<\/p>\n<p>\u041d\u0435\u043c\u043d\u043e\u0433\u043e \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e\u0441\u0442\u0435\u0439 \u043f\u0440\u043e \u0441\u043f\u043e\u0441\u043e\u0431 \u0430\u0434\u0440\u0435\u0441\u0430\u0446\u0438\u0438 \u0432 \u044d\u0442\u0438\u0445 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430\u0445. \u0414\u043e\u043f\u0443\u0441\u0442\u0438\u043c, \u0435\u0441\u0442\u044c \u043d\u0435\u043a\u0438\u0439 \u0445\u044d\u0448 1234567890. \u0412 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0430 \u0432\u044b\u0431\u0440\u0430\u043d\u043d\u044b\u0445 \u0441\u043b\u0430\u0431\u043e\u0432 Unbound \u0432\u044b\u0431\u0438\u0440\u0430\u0435\u0442 <code>mask<\/code> \u0438 <code>shift<\/code>. \u042d\u0442\u043e \u043d\u0443\u0436\u043d\u043e, \u0447\u0442\u043e\u0431\u044b \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0442\u044c, \u0432 \u043a\u0430\u043a\u043e\u0439 <code>lruhash<\/code> \u0438 <code>bin<\/code> \u043f\u043e\u043f\u0430\u0434\u0430\u0435\u0442 \u0437\u0430\u043f\u0438\u0441\u044c. \u0423\u0441\u043b\u043e\u0432\u043d\u043e, \u0434\u043b\u044f \u0440\u0430\u0437\u043c\u0435\u0440\u0430 32 Unbound \u0434\u0435\u043b\u0438\u0442 \u0445\u044d\u0448 \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u0442\u0430\u043a:<\/p>\n<pre><code>   , - \u0412\u0435\u0440\u0445\u043d\u044f\u044f \u0447\u0430\u0441\u0442\u044c \u0445\u044d\u0448\u0430 \u0431\u0435\u0440\u0451\u0442\u0441\u044f \u0434\u043b\u044f \u0430\u0434\u0440\u0435\u0441\u0430\u0446\u0438\u0438 \u0432\u043d\u0443\u0442\u0440\u0438 slabhash->array[N] \u2014 \u0442\u043e \u0435\u0441\u0442\u044c, \u043c\u0435\u0436\u0434\u0443 \u0441\u043b\u0430\u0431\u0430\u043c\u0438.   \/     ,- \u041d\u0438\u0436\u043d\u044f\u044f \u0447\u0430\u0441\u0442\u044c \u0445\u044d\u0448\u0430 \u0443\u0440\u0435\u0437\u0430\u0435\u0442\u0441\u044f \u043f\u043e \u0442\u0435\u043a\u0443\u0449\u0435\u043c\u0443 \u0440\u0430\u0437\u043c\u0435\u0440\u0443 LRU \u0438 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442   \/     \/   \u0438\u043d\u0434\u0435\u043a\u0441 \u0432 lruhash->array, \u0432 \u043a\u0430\u043a\u043e\u0439 bin \u043f\u043e\u043f\u0430\u0434\u0451\u0442 entry. 12 | 34567890   \\    ` - \u0424\u043e\u0440\u043c\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0442\u0430\u043a: \u0431\u0438\u0442\u043e\u0432\u0430\u044f \u043c\u0430\u0441\u043a\u0430, \u0440\u0430\u0441\u0441\u0447\u0438\u0442\u0430\u043d\u043d\u0430\u044f \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u0440\u0430\u0437\u043c\u0435\u0440\u0430 slabhash->array                         (hash &amp; 0b11111000000000000000000000000000) >> shift (\u043d\u0430 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043d\u0443\u043b\u0435\u0439 \u0432 \u043c\u0430\u0441\u043a\u0435)<\/code><\/pre>\n<p>\u0421\u043b\u0430\u0431\u044b \u0437\u0430\u0449\u0438\u0449\u0435\u043d\u044b \u043d\u0430\u0431\u043e\u0440\u043e\u043c \u043b\u043e\u043a\u043e\u0432: <code>pthread_spin_lock<\/code> \u0434\u043b\u044f <code>slab->array->lock \/ bin->lock<\/code> \u0438 <code>pthread rw lock<\/code><em> <\/em>\u043d\u0430 <code>entry->lock<\/code><em>.<\/em><\/p>\n<p>\u0418\u0442\u0430\u043a, \u043f\u0440\u0438 \u0431\u043e\u043b\u044c\u0448\u043e\u043c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0435 SLABS (lruhash-\u0442\u0430\u0431\u043b\u0438\u0446 \u0432\u043d\u0443\u0442\u0440\u0438 <code>slabhash->array<\/code>) \u043f\u043e\u0442\u043e\u043a \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u0431\u0443\u0434\u0435\u0442 \u043c\u0435\u043d\u044c\u0448\u0435 \u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u0430\u0442\u044c\u0441\u044f, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u0432 \u0440\u0430\u0437\u043d\u044b\u0435 <code>lruhash<\/code> \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u043f\u0440\u043e\u0439\u0434\u0443\u0442 \u0431\u0435\u0437 \u043b\u043e\u043a\u0430. \u0410 \u044d\u0442\u043e \u0437\u043d\u0430\u0447\u0438\u0442, \u0447\u0442\u043e \u043d\u0430 \u043a\u0430\u0436\u0434\u044b\u0439 <code>lruhash<\/code> \u043f\u0440\u0438\u0434\u0451\u0442\u0441\u044f \u043c\u0435\u043d\u044c\u0448\u0435 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u0432 \u0435\u0434\u0438\u043d\u0438\u0446\u0443 \u0432\u0440\u0435\u043c\u0435\u043d\u0438, \u0438 <code>lock contention<\/code> \u043d\u0430 *1-spin -> *2-spin -> *3-mutex \u0432 <code>lruhash->array<\/code> \u0431\u0443\u0434\u0435\u0442 \u043c\u0435\u043d\u044c\u0448\u0435.<\/p>\n<pre><code>               | | | | | | | | | | | | | | | | slabhash       [    &lt;slab_type>-size         ]                | | | | | | | | | | | | | | | |                | | | | | | | | | | | | ...                 \\\/ | | | | | | | | | | [1]lruhash->array   \\\/ | | | | | |     [2]lruhash->array   \\\/ | | | |         [3]lruhash->array  | | ...                       ...<\/code><\/pre>\n<p>\u0410 \u0434\u043b\u044f \u043c\u0430\u043b\u043e\u0433\u043e \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0430 SLABS \u0431\u043e\u043b\u044c\u0448\u0435 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u0431\u0443\u0434\u0443\u0442 \u0443\u0442\u0435\u043a\u0430\u0442\u044c \u0432 \u043e\u0434\u0438\u043d <code>lruhash<\/code>, \u0443\u0432\u0435\u043b\u0438\u0447\u0438\u0432\u0430\u044f <code>lock contention<\/code> \u043d\u0430 \u0435\u0433\u043e spinlock.<\/p>\n<pre><code>         | | | | | | | | | | | | | | | |           \\| | | | | | | | | | | | | |\/             \\| | | | | | | | | | | |\/               \\| | | | | | | | | |\/                 \\| | | | | | | |\/                   \\| | | | | |\/                     \\| | | |\/ slabhash             [size]                      ||| |||        [1]lruhash->array |||             [2]lruhash->array ...                           `- \u043d\u0430\u043f\u043e\u043c\u043d\u044e, \u0447\u0442\u043e \u0442\u0443\u0442 spin_lock<\/code><\/pre>\n<p>\u041a\u043e\u043d\u0435\u0447\u043d\u043e, \u043c\u0438\u043d\u0443\u0441\u044b \u0443 \u0431\u043e\u043b\u044c\u0448\u0438\u0445 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 SLABS \u0442\u043e\u0436\u0435 \u0435\u0441\u0442\u044c. \u041e\u043d\u0438 \u0437\u0430\u043a\u043b\u044e\u0447\u0430\u044e\u0442\u0441\u044f \u0432 \u0440\u0430\u0437\u043c\u0435\u0440\u0435 \u043a\u044d\u0448\u0430 \u043d\u0430 \u0441\u0442\u0430\u0440\u0442\u0435, \u0438, \u043a\u0430\u043a \u043f\u043e\u043a\u0430\u0437\u0430\u043b\u0430 \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0430, \u0432 \u043d\u0430\u043a\u043b\u0430\u0434\u043d\u044b\u0445 \u0440\u0430\u0441\u0445\u043e\u0434\u0430\u0445 \u043d\u0430 \u0441\u0431\u043e\u0440 \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0438 \u0441\u043b\u0430\u0431\u043e\u0432. \u041f\u0440\u0438 \u0431\u043e\u043b\u044c\u0448\u043e\u043c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0438 SLABS Unbound \u0434\u043e\u043b\u0436\u0435\u043d \u043d\u0430 \u0441\u0442\u0430\u0440\u0442\u0435 \u0430\u043b\u043b\u043e\u0446\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043e\u0433\u0440\u043e\u043c\u043d\u044b\u0439 \u043c\u0430\u0441\u0441\u0438\u0432 <code>slabhash->array<\/code> \u0438 \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043a\u0443\u0447\u0443 <code>lruhash->array<\/code>, \u0443 \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0438\u0437 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0435\u0441\u0442\u044c \u0441\u0442\u0430\u0440\u0442\u043e\u0432\u044b\u0439 \u0440\u0430\u0437\u043c\u0435\u0440 1024. \u041d\u043e \u044d\u0442\u043e\u0442 \u043c\u0438\u043d\u0443\u0441 \u0434\u0430\u0451\u0442 \u0438 \u043f\u043b\u044e\u0441: \u0438\u0437-\u0437\u0430 \u0431\u043e\u043b\u044c\u0448\u043e\u0433\u043e \u0440\u0430\u0437\u043c\u0435\u0440\u0430 <code>slabhash->array<\/code> \u043a\u0430\u0436\u0434\u044b\u0439 <code>linked-list<\/code> \u0432\u043d\u0443\u0442\u0440\u0438 <code>lruhash->array[BIN]<\/code> \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d \u0444\u043e\u0440\u043c\u0443\u043b\u043e\u0439, \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u044f \u043f\u0440\u0438\u0432\u0451\u043b \u043d\u0430 \u0434\u0438\u0430\u0433\u0440\u0430\u043c\u043c\u0435. \u0422\u043e \u0435\u0441\u0442\u044c, \u0432\u043e\u0442 \u0442\u0430\u043a\u043e\u0433\u043e \u043d\u0435 \u043f\u0440\u043e\u0438\u0437\u043e\u0439\u0434\u0451\u0442:<\/p>\n<pre><code>entry->entry->entry->entry-> x278555 entry->entry->entry->entry->entry->...<\/code><\/pre>\n<p>\u041f\u043e\u0438\u0441\u043a \u043f\u043e \u0442\u0430\u043a\u043e\u043c\u0443 <code>linked-list<\/code> \u0442\u0440\u0435\u0431\u0443\u0435\u0442 \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e <code>entry->dname<\/code> \u0432\u044b\u0437\u044b\u0432\u0430\u0442\u044c strcmp.<\/p>\n<p>\u041a\u0430\u0436\u0434\u044b\u0439 \u0437\u0430\u043f\u0440\u043e\u0441 \u043f\u0440\u043e\u0445\u043e\u0434\u0438\u0442 \u0447\u0435\u0440\u0435\u0437 \u043a\u044d\u0448 \u043a\u0430\u043a \u043c\u0438\u043d\u0438\u043c\u0443\u043c \u043e\u0434\u0438\u043d \u0440\u0430\u0437, \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u043b\u043e\u043a\u0438 \u043d\u0430 \u043a\u044d\u0448 \u0431\u0435\u0440\u0443\u0442\u0441\u044f \u043c\u043d\u043e\u0433\u043e\u043a\u0440\u0430\u0442\u043d\u043e. Unbound \u043c\u0435\u0441\u0442\u0430\u043c\u0438 \u0441\u043b\u0438\u0448\u043a\u043e\u043c \u043e\u043f\u0442\u0438\u043c\u0438\u0441\u0442\u0438\u0447\u043d\u043e \u0431\u0435\u0440\u0451\u0442 <a href=\"https:\/\/github.com\/NLnetLabs\/unbound\/blob\/e11d206a825349ca447ee27b35aeee4f00271483\/util\/storage\/lruhash.c#L370\"><u>\u043b\u043e\u043a \u043d\u0430 lruhash->array<\/u><\/a> \u043d\u0430 \u0432\u0441\u044e \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u044e c ENTRY \u0432\u043d\u0443\u0442\u0440\u0438 BIN \u0438 \u043f\u043e\u0440\u043e\u0439 <a href=\"https:\/\/github.com\/NLnetLabs\/unbound\/blob\/e11d206a825349ca447ee27b35aeee4f00271483\/util\/storage\/lruhash.c#L350\"><u>\u043d\u0435 \u043e\u0442\u043f\u0443\u0441\u043a\u0430\u0435\u0442 \u0435\u0433\u043e \u043e\u0447\u0435\u043d\u044c \u0434\u043e\u043b\u0433\u043e<\/u><\/a>. \u0414\u0440\u0443\u0433\u0438\u043c\u0438 \u0441\u043b\u043e\u0432\u0430\u043c\u0438: \u043f\u043e\u043b\u0435 \u0434\u043b\u044f \u0443\u0441\u043a\u043e\u0440\u0435\u043d\u0438\u044f Unbound \u0432\u0441\u0451 \u0435\u0449\u0451 \u0435\u0441\u0442\u044c!<\/p>\n<p>\u041f\u043e\u0447\u0435\u043c\u0443 \u0432\u0430\u0436\u043d\u043e \u0447\u0430\u0449\u0435 \u043e\u0442\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u043b\u043e\u043a? \u0414\u0435\u043b\u043e \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u0445\u043e\u0442\u044c Unbound \u0438 \u0441\u0442\u0430\u0440\u0430\u0435\u0442\u0441\u044f \u0434\u0435\u0440\u0436\u0430\u0442\u044c \u0432 \u0431\u0438\u043d\u0430\u0445 \u043f\u043e \u043e\u0434\u043d\u043e\u043c\u0443 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0443, \u0438\u043d\u043e\u0433\u0434\u0430 \u0441\u043b\u0443\u0447\u0430\u0435\u0442\u0441\u044f \u043a\u043e\u043b\u043b\u0438\u0437\u0438\u044f \u0445\u044d\u0448-\u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0438 \u0432 \u0431\u0438\u043d \u043c\u043e\u0436\u0435\u0442 \u043f\u043e\u043f\u0430\u0441\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432. \u0414\u043b\u044f \u043f\u043e\u0438\u0441\u043a\u0430 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430 \u0432 \u0431\u0438\u043d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0441\u0430\u043c\u043e\u043f\u0438\u0441\u043d\u044b\u0439 strcmp <a href=\"https:\/\/github.com\/NLnetLabs\/unbound\/blob\/13e445d50b6e2a9441d9364d4213a57781d9e6f1\/util\/storage\/slabhash.c#L50\"><u>[slabhash.c#L50]<\/u><\/a>-><a href=\"https:\/\/github.com\/NLnetLabs\/unbound\/blob\/0682d4371edda418ab5bea35554925574fa8c0d1\/daemon\/daemon.c#L991\"><u>[daemon.c#L991]<\/u><\/a>-><a href=\"https:\/\/github.com\/NLnetLabs\/unbound\/blob\/769639823108bb6837a1c43897fa86e9460d5f2a\/util\/data\/msgreply.c#L623\"><u>[msgreply.c#L623]<\/u><\/a>-><a href=\"https:\/\/github.com\/NLnetLabs\/unbound\/blob\/13e445d50b6e2a9441d9364d4213a57781d9e6f1\/util\/data\/dname.c#L100\"><u>[dname.c#L100]<\/u><\/a>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u043e\u0447\u0435\u043d\u044c \u0434\u0430\u043b\u0435\u043a\u043e \u0432 \u043f\u043b\u0430\u043d\u0435 \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u0438 \u043e\u0442 spinlock.<\/p>\n<p>\u0412 \u043a\u0430\u043a\u043e\u0439-\u0442\u043e \u0438\u0437 \u043a\u043d\u0438\u0436\u0435\u043a \u043f\u043e Linux \u044f \u0447\u0438\u0442\u0430\u043b, \u0447\u0442\u043e \u043d\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u043e\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0441\u043f\u0438\u043d\u043b\u043e\u043a\u0430 \u2014 \u044d\u0442\u043e \u0437\u0430\u0449\u0438\u0442\u0438\u0442\u044c\u0441\u044f \u0434\u043b\u044f \u0432\u0437\u044f\u0442\u0438\u044f \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044f, \u0438 \u043d\u0435 \u0431\u043e\u043b\u0435\u0435. \u041f\u043e\u0442\u043e\u043c \u044f \u043d\u0430\u0448\u0451\u043b \u0437\u0430\u043c\u0435\u0447\u0430\u0442\u0435\u043b\u044c\u043d\u0443\u044e \u0441\u0442\u0430\u0442\u044c\u044e <a href=\"https:\/\/mmomtchev.medium.com\/spinlock-vs-mutex-performance-3f73de53a460\"><u>spinlock vs mutex performance<\/u><\/a>, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043f\u043e\u0434\u0442\u0432\u0435\u0440\u0434\u0438\u043b\u0430 \u043c\u043e\u0438 \u0434\u043e\u0433\u0430\u0434\u043a\u0438, \u043e\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u0435 \u043d\u0438\u0436\u0435.<\/p>\n<p>\u0418\u0442\u0430\u043a, \u043f\u043e\u043a\u0430 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0435 \u0441\u0442\u0440\u043e\u043a DNS \u0437\u0430\u043f\u0438\u0441\u0435\u0439 \u0434\u043b\u044f \u043f\u043e\u0438\u0441\u043a\u0430 \u043d\u0443\u0436\u043d\u043e\u0433\u043e \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430, \u0432 BIN \u0432\u0441\u0435 \u0442\u0440\u0435\u0434\u044b \u0436\u0434\u0443\u0442 \u043d\u0430 <code>spin_lock lruhash->array<\/code>, \u0433\u0434\u0435 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0434\u0430\u043d\u043d\u044b\u0439 BIN. \u0415\u0441\u043b\u0438 \u0432\u0434\u0440\u0443\u0433 <code>linked-list<\/code> \u0438\u0437 ENTRY \u0432 \u043d\u0451\u043c \u0434\u043b\u0438\u043d\u043d\u0435\u0435 \u0434\u0435\u0441\u044f\u0442\u0438 \u0437\u0430\u043f\u0438\u0441\u0435\u0439, \u0432\u0441\u0435 \u0442\u0440\u0435\u0434\u044b \u0436\u0434\u0443\u0442 \u043e\u0449\u0443\u0442\u0438\u043c\u044b\u0439 \u043f\u0440\u043e\u043c\u0435\u0436\u0443\u0442\u043e\u043a \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0438 \u0437\u0434\u043e\u0440\u043e\u0432\u043e \u0433\u0440\u0435\u044e\u0442 \u0432\u043e\u0437\u0434\u0443\u0445. \u041d\u0430 \u044d\u0442\u043e\u043c \u044d\u0442\u0430\u043f\u0435 \u0434\u043e\u043b\u0436\u043d\u043e \u0431\u044b\u0442\u044c \u043e\u0447\u0435\u0432\u0438\u0434\u043d\u043e, \u0447\u0442\u043e \u0431\u043e\u043b\u044c\u0448\u0435 \u0441\u043b\u0430\u0431\u043e\u0432 \u2014 \u0445\u043e\u0440\u043e\u0448\u0435\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u0435.<\/p>\n<p>\u041d\u0430 \u044d\u0442\u043e\u043c \u0436\u0435 \u044d\u0442\u0430\u043f\u0435 \u043c\u043e\u0436\u043d\u043e \u0432\u043e\u0437\u0440\u0430\u0437\u0438\u0442\u044c: \u00ab\u0414\u0430 \u043b\u0430\u0434\u043d\u043e, \u043e\u0431\u0445\u043e\u0434 \u043a\u043e\u043b\u043b\u0438\u0437\u0438\u0438 \u0434\u0430\u0436\u0435 \u0432 1000 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 \u043d\u0435 \u0434\u043e\u043b\u0436\u0435\u043d \u0432\u0437\u0440\u044b\u0432\u0430\u0442\u044c Unbound \u0442\u0430\u043a, \u0447\u0442\u043e\u0431\u044b \u0432\u044b\u0437\u0432\u0430\u0442\u044c \u043e\u0442\u043a\u0430\u0437 \u0432 \u043e\u0431\u0441\u043b\u0443\u0436\u0438\u0432\u0430\u043d\u0438\u0438. \u0413\u0440\u0435\u0442\u044c \u0432\u043e\u0437\u0434\u0443\u0445 \u0431\u0443\u0434\u0435\u0442 \u0437\u0434\u043e\u0440\u043e\u0432\u043e, \u043d\u043e \u043d\u0435 \u0432\u0437\u0440\u044b\u0432\u0430\u0442\u044c\u00bb.<\/p>\n<p>\u0418 \u0442\u0443\u0442 \u044f \u0441\u043f\u0435\u0448\u0443 \u043d\u0430\u043f\u043e\u043c\u043d\u0438\u0442\u044c \u043f\u0440\u043e \u0440\u0435\u0430\u043b\u043b\u043e\u043a\u0430\u0446\u0438\u044e <a href=\"https:\/\/github.com\/NLnetLabs\/unbound\/blob\/13e445d50b6e2a9441d9364d4213a57781d9e6f1\/util\/storage\/lruhash.c#L338\"><u>[lruhash.c#L338]<\/u><\/a>-><a href=\"https:\/\/github.com\/NLnetLabs\/unbound\/blob\/13e445d50b6e2a9441d9364d4213a57781d9e6f1\/util\/storage\/lruhash.c#L231\"><u>[lruhash.c#L231]<\/u><\/a>-><a href=\"https:\/\/github.com\/NLnetLabs\/unbound\/blob\/13e445d50b6e2a9441d9364d4213a57781d9e6f1\/util\/storage\/lruhash.c#L117\"><u>[lruhash.c#L117]<\/u><\/a>. \u041e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u044c \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 <code>lruhash->array<\/code> \u0442\u0430\u043a\u043e\u0432\u0430, \u0447\u0442\u043e \u043a\u0430\u043a\u043e\u0439 \u0431\u044b \u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u043a\u044d\u0448 \u043c\u044b \u043d\u0435 \u0432\u044b\u0431\u0440\u0430\u043b\u0438, \u043d\u0430 \u0441\u0442\u0430\u0440\u0442\u0435 \u0443 \u043d\u0435\u0433\u043e \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0437\u043c\u0435\u0440 1024 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 <code>HASH_DEFAULT_STARTARRAY<\/code>. \u041a\u043e\u0433\u0434\u0430 \u044d\u0442\u043e\u0442 \u043c\u0430\u0441\u0441\u0438\u0432 \u0437\u0430\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f, Unbound \u0430\u043b\u043b\u043e\u0446\u0438\u0440\u0443\u0435\u0442 \u043d\u043e\u0432\u044b\u0439 \u043c\u0430\u0441\u0441\u0438\u0432 \u0432 \u0434\u0432\u0430 \u0440\u0430\u0437\u0430 \u0431\u043e\u043b\u044c\u0448\u0435\u0433\u043e \u0440\u0430\u0437\u043c\u0435\u0440\u0430 \u0438 \u043a\u043e\u043f\u0438\u0440\u0443\u0435\u0442 \u043f\u043e\u0434 spinlock \u0441\u0442\u0430\u0440\u044b\u0439 \u043c\u0430\u0441\u0441\u0438\u0432 \u0432 \u043d\u043e\u0432\u044b\u0439. \u0422\u0435\u043f\u0435\u0440\u044c \u0442\u043e\u0447\u043d\u043e \u043d\u0435 \u0434\u043e\u043b\u0436\u043d\u043e \u0431\u044b\u0442\u044c \u0432\u043e\u0437\u0440\u0430\u0436\u0435\u043d\u0438\u0439 \ud83d\ude42<\/p>\n<h3>\u041a\u0430\u043a \u0434\u0435\u0439\u0441\u0442\u0432\u0443\u044e\u0442 SLABS<\/h3>\n<p>\u041f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0430\u044f \u0447\u0430\u0441\u0442\u044c \u0431\u044b\u043b\u0430 \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u0443\u0442\u043e\u043c\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0439 \u2014 \u043d\u0430\u0441\u0442\u0430\u043b\u043e \u0432\u0440\u0435\u043c\u044f \u0440\u0430\u0437\u043c\u044f\u0442\u044c\u0441\u044f. \u0411\u0435\u0440\u0451\u043c \u043d\u0430\u0448\u0438 \u0442\u0435\u043a\u0443\u0449\u0438\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438:<\/p>\n<pre><code class=\"yaml\">     msg-cache-size: 4G   # \u0412 \u043f\u0440\u043e\u0434\u0435 \u0437\u0430\u043c\u0435\u0447\u0435\u043d\u043e 14 - 16 \u041c \u0437\u0430\u043f\u0438\u0441\u0435\u0439      msg-cache-slabs: 32  # \u041f\u043e \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0430\u0446\u0438\u0438 \u0438\u0437 \u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u0439 \u0434\u043e\u043a\u0438<\/code><\/pre>\n<p>\u041f\u043e\u043b\u0443\u0447\u0430\u0435\u043c, \u0447\u0442\u043e \u0443 \u043d\u0430\u0441 \u0432 \u043e\u0434\u043d\u043e\u043c <code>lruhash->array<\/code> \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c 14\u041c \/ 32 = 437500 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432. \u0414\u043e\u0441\u0442\u0443\u043f \u0434\u043e \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430 <code>slabhash->array[hash(\u043b\u0435\u0432\u0430\u044f \u0447\u0430\u0441\u0442\u044c \u0445\u044d\u0448\u0430) % modulo]->lruhash->array[hash(\u043f\u0440\u0430\u0432\u0430\u044f \u0447\u0430\u0441\u0442\u044c \u0445\u044d\u0448\u0430) % modulo]<\/code><em> <\/em>\u0432\u0435\u0437\u0434\u0435 \u0438\u0434\u0451\u0442 \u043f\u043e \u0441\u043c\u0435\u0449\u0435\u043d\u0438\u044e \u2014 \u043a\u0430\u0436\u0435\u0442\u0441\u044f, \u0442\u0443\u0442 \u043d\u0435\u0447\u0435\u043c\u0443 \u0442\u0443\u043f\u0438\u0442\u044c. \u0412\u0441\u043f\u043e\u043c\u0438\u043d\u0430\u0435\u043c, \u0447\u0442\u043e \u043f\u043e\u0434 \u043b\u043e\u043a\u043e\u043c \u0435\u0449\u0451 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f strcmp.<\/p>\n<p>\u0414\u0430\u043b\u044c\u0448\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u043c, \u0447\u0442\u043e \u0435\u0441\u0442\u044c \u043d\u0435 \u043e\u0434\u043d\u0430 \u043a\u043e\u043b\u043b\u0438\u0437\u0438\u044f \u0438 \u0435\u0441\u0442\u044c \u0431\u0438\u043d\u044b \u0431\u043e\u043b\u044c\u0448\u0435 \u043e\u0434\u043d\u043e\u0433\u043e \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430. \u0412 \u0438\u0442\u043e\u0433\u0435 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c, \u0443\u0432\u0435\u043b\u0438\u0447\u0435\u043d\u043d\u044b\u0439 \u0444\u043e\u043d LA. \u041f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c \u044d\u0442\u0443 \u0442\u0435\u043e\u0440\u0438\u044e. \u0421\u0442\u0430\u0432\u0438\u043c \u0447\u0435\u0442\u044b\u0440\u0435 \u0441\u043b\u0430\u0431\u0430, \u0447\u0442\u043e\u0431\u044b \u0441\u0442\u0430\u043b\u043e \u0437\u0430\u043c\u0435\u0442\u043d\u0435\u0435, \u0431\u0435\u0440\u0451\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e 900\u043a \u0443\u043d\u0438\u043a\u0430\u043b\u044c\u043d\u044b\u0445 \u0437\u0430\u043f\u0438\u0441\u0435\u0439, \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c 60% \u043f\u043e\u043f\u0430\u0434\u0430\u043d\u0438\u044f \u0432 \u043a\u044d\u0448.<\/p>\n<pre><code class=\"bash\">awk -v cache=dns-30k.ammo ' {   print; n=0;   while(n &lt; 2){     ret=getline &lt; cache;     if (!ret){close(cache);}else{n++; print;}   } }' &lt; dns.ammo > dns-870k+60prc-hits.ammo<\/code><\/pre>\n<p>\u0417\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u043f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u043e\u0439 \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u043e\u0439 \u0432 5Krps. \u0412\u0438\u0434\u0438\u043c, \u0447\u0442\u043e \u0440\u0435\u0430\u043b\u043b\u043e\u043a\u0430\u0446\u0438\u0438 \u043f\u043e\u0440\u0442\u044f\u0442 \u0442\u0430\u0439\u043c\u0438\u043d\u0433\u0438.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/db0\/29a\/f46\/db029af46910d9573b5de0a62ab9c7b2.png\" alt=\" \u0417\u0435\u043b\u0451\u043d\u044b\u043c \u043e\u0442\u043c\u0435\u0447\u0435\u043d \u0440\u043e\u0441\u0442 \u043a\u044d\u0448\u0430.\u00a0\" title=\" \u0417\u0435\u043b\u0451\u043d\u044b\u043c \u043e\u0442\u043c\u0435\u0447\u0435\u043d \u0440\u043e\u0441\u0442 \u043a\u044d\u0448\u0430.\u00a0\" width=\"947\" height=\"377\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/db0\/29a\/f46\/db029af46910d9573b5de0a62ab9c7b2.png\"\/><\/p>\n<div><figcaption> \u0417\u0435\u043b\u0451\u043d\u044b\u043c \u043e\u0442\u043c\u0435\u0447\u0435\u043d \u0440\u043e\u0441\u0442 \u043a\u044d\u0448\u0430.\u00a0<\/figcaption><\/div>\n<\/figure>\n<p>\u0415\u0441\u043b\u0438 \u0432\u0437\u044f\u0442\u044c <code>msg-cache-slabs: 1024<\/code>, \u0442\u043e \u043a\u0430\u0436\u0434\u044b\u0439 \u0441\u043b\u0430\u0431 \u0431\u0443\u0434\u0435\u0442 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442\u044c \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u043f\u043e 10\u043a \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439 \u0440\u0430\u0437\u043c\u0435\u0440\u043e\u043c 512 \u0431\u0430\u0439\u0442. \u042d\u0442\u043e \u0441\u0438\u043b\u044c\u043d\u043e \u0441\u043e\u043a\u0440\u0430\u0449\u0430\u0435\u0442 \u043d\u0430\u043a\u043b\u0430\u0434\u043d\u044b\u0435 \u0440\u0430\u0441\u0445\u043e\u0434\u044b \u043d\u0430 \u0440\u0435\u0430\u043b\u043b\u043e\u043a\u0430\u0446\u0438\u044e \u0438 \u043f\u043e\u0438\u0441\u043a \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u043a\u043e\u043b\u043b\u0438\u0437\u0438\u0439.<\/p>\n<p>\u041f\u0435\u0440\u0435\u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c Unbound, \u043f\u043e\u0434\u0430\u0451\u043c \u0442\u0443 \u0436\u0435 \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u0443 \u2014 \u0438 \u0442\u0435\u043f\u0435\u0440\u044c \u043d\u0435 \u0441\u0442\u0440\u0430\u0448\u043d\u043e \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0434\u0430\u0436\u0435 \u043d\u0430 100-\u044b\u0439 \u043f\u0435\u0440\u0446\u0435\u043d\u0442\u0438\u043b\u044c \u043e\u0442\u0432\u0435\u0442\u043e\u0432.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/053\/a5e\/06c\/053a5e06c93630563a5039516c6bc9bc.png\" alt=\"\u0422\u0430\u0439\u043c\u0438\u043d\u0433\u0438 \u043f\u0440\u0438 msg-cache-slabs: 1024\" title=\"\u0422\u0430\u0439\u043c\u0438\u043d\u0433\u0438 \u043f\u0440\u0438 msg-cache-slabs: 1024\" width=\"924\" height=\"375\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/053\/a5e\/06c\/053a5e06c93630563a5039516c6bc9bc.png\"\/><\/p>\n<div><figcaption>\u0422\u0430\u0439\u043c\u0438\u043d\u0433\u0438 \u043f\u0440\u0438 <code>msg-cache-slabs: 1024<\/code><\/figcaption><\/div>\n<\/figure>\n<p>\u041a\u0430\u0437\u0430\u043b\u043e\u0441\u044c, \u0432\u043e\u0442 \u043e\u043d\u0430 \u2014 \u043f\u043e\u0431\u0435\u0434\u0430! \u041f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u044b\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u043d\u0430\u0439\u0434\u0435\u043d\u044b, \u0434\u0430\u043b\u044c\u0448\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u0430\u0442\u0447\u0438\u0442\u044c Unbound \u2014 \u0442\u043e \u0435\u0441\u0442\u044c \u044e\u0432\u0435\u043b\u0438\u0440\u043d\u043e \u043e\u0442\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u043b\u043e\u043a \u043d\u0430 <code>lruhash->array<\/code> \u0432\u043e \u0432\u0441\u0435\u0445 \u043c\u0435\u0441\u0442\u0430\u0445, \u0433\u0434\u0435 \u044d\u0442\u043e \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u0432 \u0442\u043e\u043c \u0447\u0438\u0441\u043b\u0435 \u043f\u0440\u0438 \u0440\u0435\u0430\u043b\u043b\u043e\u043a\u0430\u0446\u0438\u0438 \u043c\u0430\u0441\u0441\u0438\u0432\u0430.<\/p>\n<h3>\u0411\u043e\u043b\u044c\u0448\u0435 \u0434\u043e\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c\u0441\u0442\u0432!<\/h3>\n<p>\u0410 \u0432\u043e\u0442 \u0435\u0449\u0451 \u0437\u0430\u043c\u0435\u0440\u044b \u043c\u043e\u043c\u0435\u043d\u0442\u043e\u0432 \u0441\u0440\u0430\u0431\u043e\u0442\u043a\u0438 <code>table_grow<\/code><em> <\/em>\u0447\u0435\u0440\u0435\u0437 bpftrace \u0438 \u0435\u0451 \u0442\u0430\u0439\u043c\u0438\u043d\u0433\u0438. \u0422\u0443\u0442 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u044b \u0432\u0440\u0435\u043c\u0435\u043d\u0430 \u0440\u0435\u0430\u043b\u043b\u043e\u043a\u0430\u0446\u0438\u0439:<\/p>\n<pre><code class=\"bash\">ns-load.name:~$ sudo bpftrace -e ' BEGIN { printf(\"%s GO go go!\\n\", strftime(\"%H:%M:%S\", nsecs)); } uprobe:\/usr\/sbin\/unbound-1.17.0-release-threaded-zone-write:table_grow {printf(\"%s Oops! table_grow!\\n\", strftime(\"%H:%M:%S\", nsecs)); }' Attaching 2 probes...  11:11:29 GO go go! 11:11:48 Oops! table_grow! 11:11:48 Oops! table_grow! 11:11:48 Oops! table_grow! 11:11:48 Oops! table_grow! 11:11:48 Oops! table_grow! 11:11:48 Oops! table_grow! 11:11:48 Oops! table_grow! 11:11:48 Oops! table_grow! 11:11:50 Oops! table_grow! 11:11:50 Oops! table_grow! 11:11:50 Oops! table_grow! 11:11:50 Oops! table_grow! \u2026<\/code><\/pre>\n<p>\u0410 \u0442\u0443\u0442 \u2014 \u0442\u0430\u0439\u043c\u0438\u043d\u0433\u0438 \u0440\u0430\u0431\u043e\u0442\u044b <code>table_grow<\/code> (\u0432\u0441\u0435\u0433\u043e \u043d\u0430 900\u043a \u0437\u0430\u043f\u0438\u0441\u044f\u0445, \u044d\u0442\u043e \u0434\u0430\u043b\u0435\u043a\u043e \u043d\u0435 18\u041c):<\/p>\n<pre><code class=\"bash\">ns-load.name:~$ sudo bpftrace -e ' uprobe:\/usr\/sbin\/unbound-1.17.0-release-threaded-zone-write:table_grow { @start[tid] = nsecs; } uretprobe:\/usr\/sbin\/unbound-1.17.0-release-threaded-zone-write:table_grow \/@start[tid]\/ { @ns[pid] = hist((nsecs - @start[tid]) \/ 1e6); delete(@start[tid]); }' Attaching 2 probes... ^C  @ns[3540330]: [0]                    8 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@| [1]                    5 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@                    | [2, 4)                 3 |@@@@@@@@@@@@@@@@@@@                                 | [4, 8)                 6 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@             | [8, 16)                2 |@@@@@@@@@@@@@                                       | [16, 32)               4 |@@@@@@@@@@@@@@@@@@@@@@@@@@                          | [32, 64)               4 |@@@@@@@@@@@@@@@@@@@@@@@@@@                          | [64, 128)              4 |@@@@@@@@@@@@@@@@@@@@@@@@@@                          | #     |                 `- \u041a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0432\u044b\u0437\u043e\u0432\u043e\u0432. \u041f\u043e \u043d\u0435\u043c\u0443 \u043c\u043e\u0436\u043d\u043e \u0441\u0443\u0434\u0438\u0442\u044c \u043e \u0442\u043e\u043c, #     |                     \u0447\u0442\u043e \u0440\u0430\u0441\u0442\u0443\u0442 msg-, rrset- \u0438 \u0435\u0449\u0451 \u043a\u0430\u043a\u0438\u0435-\u0442\u043e \u0441\u043b\u0430\u0431\u044b #      `- \u041c\u0438\u043b\u043b\u0438\u0441\u0435\u043a\u0443\u043d\u0434\u044b! #         128 \u043c\u0438\u043b\u043b\u0438\u0441\u0435\u043a\u0443\u043d\u0434! #         \u0412\u0441\u0435 CPU, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0437\u0430\u0445\u043e\u0442\u0435\u043b\u0438 \u0432 \u0440\u0435\u0430\u043b\u043b\u043e\u0446\u0438\u0440\u0443\u0435\u043c\u044b\u0439 \u0441\u043b\u0430\u0431, #         \u0436\u0434\u0430\u043b\u0438 \u043d\u0430 spinlock \u0434\u043e 128 \u043c\u0438\u043b\u043b\u0438\u0441\u0435\u043a\u0443\u043d\u0434!<\/code><\/pre>\n<p>\u042d\u0442\u043e \u0432\u0441\u0451 \u043f\u043e\u0434\u0442\u0432\u0435\u0440\u0436\u0434\u0430\u0435\u0442 <a href=\"https:\/\/github.com\/brendangregg\/FlameGraph\"><u>flamegraph<\/u><\/a>. \u041d\u0438\u0436\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d \u0438\u0442\u043e\u0433, \u0441\u043e\u0431\u0440\u0430\u043d\u043d\u044b\u0439 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u043e\u043c \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0430\u0446\u0438\u0438, \u0432\u043c\u0435\u0441\u0442\u0435 \u0441 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u044b\u043c coredump. <\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/557\/bee\/2b8\/557bee2b8bb2e0f3fcaa4b367fda6beb.png\" alt=\"\u041e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u043d\u0430 \u043f\u0440\u043e\u0446\u0435\u043d\u0442 \u0432\u0440\u0435\u043c\u0435\u043d\u0438 CPU, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0437\u0430\u043d\u0438\u043c\u0430\u044e\u0442 \u043f\u043e\u0434\u0441\u0432\u0435\u0447\u0435\u043d\u043d\u044b\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 (\u043f\u0440\u0430\u0432\u044b\u0439 \u043d\u0438\u0436\u043d\u0438\u0439 \u0443\u0433\u043e\u043b Matched)\" title=\"\u041e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u043d\u0430 \u043f\u0440\u043e\u0446\u0435\u043d\u0442 \u0432\u0440\u0435\u043c\u0435\u043d\u0438 CPU, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0437\u0430\u043d\u0438\u043c\u0430\u044e\u0442 \u043f\u043e\u0434\u0441\u0432\u0435\u0447\u0435\u043d\u043d\u044b\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 (\u043f\u0440\u0430\u0432\u044b\u0439 \u043d\u0438\u0436\u043d\u0438\u0439 \u0443\u0433\u043e\u043b Matched)\" width=\"1600\" height=\"602\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/557\/bee\/2b8\/557bee2b8bb2e0f3fcaa4b367fda6beb.png\"\/><\/p>\n<div><figcaption>\u041e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u043d\u0430 \u043f\u0440\u043e\u0446\u0435\u043d\u0442 \u0432\u0440\u0435\u043c\u0435\u043d\u0438 CPU, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0437\u0430\u043d\u0438\u043c\u0430\u044e\u0442 \u043f\u043e\u0434\u0441\u0432\u0435\u0447\u0435\u043d\u043d\u044b\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 (\u043f\u0440\u0430\u0432\u044b\u0439 \u043d\u0438\u0436\u043d\u0438\u0439 \u0443\u0433\u043e\u043b Matched)<\/figcaption><\/div>\n<\/figure>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/e83\/e41\/a5d\/e83e41a5d9638bd7e746531618a538aa.png\" alt=\"\u0410 \u0432\u043e\u0442 flamegraph \u043f\u043e\u0434 \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u043e\u0439 \u0441 \u043c\u0430\u043b\u044b\u043c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435\u043c msg-cache-slabs. \u0412\u0441\u0435\u0433\u043e\u00a0 4Krps, \u043d\u043e \u0432 gdb \u0438 perf \u0443\u0436\u0435 \u0432\u0438\u0434\u043d\u043e \u043a\u043e\u043d\u0442\u0435\u043d\u0448\u0435\u043d \u043d\u0430 \u043b\u043e\u043a\" title=\"\u0410 \u0432\u043e\u0442 flamegraph \u043f\u043e\u0434 \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u043e\u0439 \u0441 \u043c\u0430\u043b\u044b\u043c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435\u043c msg-cache-slabs. \u0412\u0441\u0435\u0433\u043e\u00a0 4Krps, \u043d\u043e \u0432 gdb \u0438 perf \u0443\u0436\u0435 \u0432\u0438\u0434\u043d\u043e \u043a\u043e\u043d\u0442\u0435\u043d\u0448\u0435\u043d \u043d\u0430 \u043b\u043e\u043a\" width=\"1480\" height=\"525\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/e83\/e41\/a5d\/e83e41a5d9638bd7e746531618a538aa.png\"\/><\/p>\n<div><figcaption>\u0410 \u0432\u043e\u0442 flamegraph \u043f\u043e\u0434 \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u043e\u0439 \u0441 \u043c\u0430\u043b\u044b\u043c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435\u043c <code>msg-cache-slabs<\/code>. \u0412\u0441\u0435\u0433\u043e\u00a0 4Krps, \u043d\u043e \u0432 gdb \u0438 perf \u0443\u0436\u0435 \u0432\u0438\u0434\u043d\u043e \u043a\u043e\u043d\u0442\u0435\u043d\u0448\u0435\u043d \u043d\u0430 \u043b\u043e\u043a<\/figcaption><\/div>\n<\/figure>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/da5\/20f\/cb9\/da520fcb9b90e59889b7571dbac847ac.png\" alt=\"\u0418 flamegraph \u043f\u043e\u0434 \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u043e\u0439 \u0441 \u0431\u043e\u043b\u044c\u0448\u0438\u043c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435\u043c msg-cache-slabs. \u041a\u0430\u0440\u0442\u0438\u043d\u043a\u0430 \u0443\u043b\u0443\u0447\u0448\u0430\u0435\u0442\u0441\u044f \u043f\u043e\u0447\u0442\u0438 \u0432 \u0434\u0432\u0430 \u0440\u0430\u0437\u0430: \u043f\u0440\u0438 \u0431\u043e\u043b\u044c\u0448\u0438\u0445 rps \u0438 \u0431\u043e\u043b\u044c\u0448\u0435\u043c \u043d\u0430\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0438 \u043a\u044d\u0448\u0430 \u0440\u0430\u0437\u043d\u0438\u0446\u0430 \u0431\u0443\u0434\u0435\u0442 \u0435\u0449\u0451 \u0431\u043e\u043b\u044c\u0448\u0435 \u043d\u0435 \u0432 \u043f\u043e\u043b\u044c\u0437\u0443 slabs: 32\" title=\"\u0418 flamegraph \u043f\u043e\u0434 \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u043e\u0439 \u0441 \u0431\u043e\u043b\u044c\u0448\u0438\u043c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435\u043c msg-cache-slabs. \u041a\u0430\u0440\u0442\u0438\u043d\u043a\u0430 \u0443\u043b\u0443\u0447\u0448\u0430\u0435\u0442\u0441\u044f \u043f\u043e\u0447\u0442\u0438 \u0432 \u0434\u0432\u0430 \u0440\u0430\u0437\u0430: \u043f\u0440\u0438 \u0431\u043e\u043b\u044c\u0448\u0438\u0445 rps \u0438 \u0431\u043e\u043b\u044c\u0448\u0435\u043c \u043d\u0430\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0438 \u043a\u044d\u0448\u0430 \u0440\u0430\u0437\u043d\u0438\u0446\u0430 \u0431\u0443\u0434\u0435\u0442 \u0435\u0449\u0451 \u0431\u043e\u043b\u044c\u0448\u0435 \u043d\u0435 \u0432 \u043f\u043e\u043b\u044c\u0437\u0443 slabs: 32\" width=\"1484\" height=\"540\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/da5\/20f\/cb9\/da520fcb9b90e59889b7571dbac847ac.png\"\/><\/p>\n<div><figcaption>\u0418 flamegraph \u043f\u043e\u0434 \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u043e\u0439 \u0441 \u0431\u043e\u043b\u044c\u0448\u0438\u043c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435\u043c <code>msg-cache-slabs<\/code>. \u041a\u0430\u0440\u0442\u0438\u043d\u043a\u0430 \u0443\u043b\u0443\u0447\u0448\u0430\u0435\u0442\u0441\u044f \u043f\u043e\u0447\u0442\u0438 \u0432 \u0434\u0432\u0430 \u0440\u0430\u0437\u0430: \u043f\u0440\u0438 \u0431\u043e\u043b\u044c\u0448\u0438\u0445 rps \u0438 \u0431\u043e\u043b\u044c\u0448\u0435\u043c \u043d\u0430\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0438 \u043a\u044d\u0448\u0430 \u0440\u0430\u0437\u043d\u0438\u0446\u0430 \u0431\u0443\u0434\u0435\u0442 \u0435\u0449\u0451 \u0431\u043e\u043b\u044c\u0448\u0435 \u043d\u0435 \u0432 \u043f\u043e\u043b\u044c\u0437\u0443 <code>slabs: 32<\/code><\/figcaption><\/div>\n<\/figure>\n<p>\u041c\u044b \u0441\u0440\u0430\u0437\u0443 \u0440\u0435\u0448\u0438\u043b\u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u0432\u0441\u0451 \u044d\u0442\u043e \u043d\u0430 \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0435 \u0438 \u0432\u044b\u043a\u0430\u0442\u0438\u043b\u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0443 \u043d\u0430 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u043d\u044b\u0439 \u0445\u043e\u0441\u0442.<\/p>\n<p>\u0421\u0430\u043c\u044b\u0439 \u0433\u043e\u0432\u043e\u0440\u044f\u0449\u0438\u0439 \u0433\u0440\u0430\u0444\u0438\u043a \u2014 \u044d\u0442\u043e, \u043a\u043e\u043d\u0435\u0447\u043d\u043e \u0436\u0435, LA. \u042f \u0434\u0443\u043c\u0430\u044e, \u043d\u0438 \u0443 \u043a\u043e\u0433\u043e \u043d\u0435 \u0431\u0443\u0434\u0435\u0442 \u0441\u043e\u043c\u043d\u0435\u043d\u0438\u0439, \u0447\u0442\u043e \u044d\u0444\u0444\u0435\u043a\u0442 \u043e\u0447\u0435\u0432\u0438\u0434\u0435\u043d.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/649\/558\/511\/649558511c8ca76b27cf2041f36e6797.png\" alt=\"\" title=\"\" width=\"1600\" height=\"569\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/649\/558\/511\/649558511c8ca76b27cf2041f36e6797.png\"\/><\/figure>\n<p>\u0414\u0430\u043b\u044c\u0448\u0435 \u044f \u043f\u043e\u043a\u0430\u0436\u0443 \u0441\u043a\u0440\u0438\u043d\u044b netdata \u043f\u0440\u043e \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0435 \u0434\u0432\u0430 \u0440\u0435\u0441\u0442\u0430\u0440\u0442\u0430: \u043f\u0435\u0440\u0432\u044b\u0439 \u0434\u043e \u0443\u0432\u0435\u043b\u0438\u0447\u0435\u043d\u0438\u044f \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0430 \u0441\u043b\u0430\u0431\u043e\u0432, \u0432\u0442\u043e\u0440\u043e\u0439 \u2014 \u043f\u043e\u0441\u043b\u0435.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/a71\/02a\/8d0\/a7102a8d0ba8090cc76ca4df41ff9056.png\" alt=\"\" title=\"\" width=\"1558\" height=\"235\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/a71\/02a\/8d0\/a7102a8d0ba8090cc76ca4df41ff9056.png\"\/><\/figure>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/d6a\/dda\/366\/d6adda3664be95aa8580cd0f710b4afc.png\" alt=\"\" title=\"\" width=\"1580\" height=\"302\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/d6a\/dda\/366\/d6adda3664be95aa8580cd0f710b4afc.png\"\/><\/figure>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/026\/514\/ca5\/026514ca5d030a19bb7559464d8b366b.png\" alt=\"\" title=\"\" width=\"1562\" height=\"325\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/026\/514\/ca5\/026514ca5d030a19bb7559464d8b366b.png\"\/><\/figure>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/759\/814\/986\/759814986563779a1cd09e01e5666aee.png\" alt=\"\" title=\"\" width=\"1573\" height=\"346\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/759\/814\/986\/759814986563779a1cd09e01e5666aee.png\"\/><\/figure>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/cc1\/6ef\/0d4\/cc16ef0d4f8b2e9eb848b31bc6ab0af5.png\" alt=\"\" title=\"\" width=\"1570\" height=\"313\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/cc1\/6ef\/0d4\/cc16ef0d4f8b2e9eb848b31bc6ab0af5.png\"\/><\/figure>\n<h3>\u0421\u0443\u0440\u043e\u0432\u0430\u044f \u0440\u0435\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u044c: \u0441\u043a\u043e\u043b\u044c\u043a\u043e rps \u0443\u0431\u0438\u0432\u0430\u0435\u0442 Unbound<\/h3>\n<p>\u0418 \u043d\u0430 \u044d\u0442\u043e\u043c \u043c\u043e\u043c\u0435\u043d\u0442\u0435 \u0447\u0438\u0442\u0430\u0442\u0435\u043b\u044c \u043c\u043e\u0436\u0435\u0442 \u0437\u0430\u0434\u0430\u0442\u044c\u0441\u044f \u0432\u043e\u043f\u0440\u043e\u0441\u043e\u043c: \u00ab\u041d\u043e \u0432\u0435\u0434\u044c \u0442\u0443\u0442 \u0442\u0430\u043a\u0430\u044f \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u0430\u044f \u043a\u043e\u0440\u043a\u0430! \u041f\u043e\u0447\u0435\u043c\u0443 \u043e \u043d\u0435\u0439 \u043d\u0438\u0447\u0435\u0433\u043e \u043d\u0435\u0442?\u00bb \u041d\u0430\u0441\u0442\u0430\u043b\u043e \u0432\u0440\u0435\u043c\u044f \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u0430\u0442\u044c \u0438 \u043f\u0440\u043e \u043d\u0435\u0451. Coredump \u0437\u0434\u0435\u0441\u044c \u0438 \u043f\u0440\u0430\u0432\u0434\u0430 \u043e\u0447\u0435\u043d\u044c \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u044b\u0439. \u041f\u0440\u0435\u0436\u0434\u0435 \u0432\u0441\u0435\u0433\u043e \u0442\u0435\u043c, \u0447\u0442\u043e \u0432 \u043d\u0451\u043c \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u043a\u043e\u043f\u0430\u0442\u044c\u0441\u044f \u0438 \u0443\u0432\u0438\u0434\u0435\u0442\u044c \u0440\u0435\u0430\u043b\u044c\u043d\u0443\u044e \u043a\u0430\u0440\u0442\u0438\u043d\u0443 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u044f\u0449\u0435\u0433\u043e.<\/p>\n<p>\u0418\u0442\u0430\u043a, \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u043e \u0441 \u0438\u0437\u0443\u0447\u0435\u043d\u0438\u0435\u043c \u043a\u043e\u0434\u0430 \u0438 \u043f\u0440\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435\u043c \u043d\u0430\u0433\u0440\u0443\u0437\u043e\u0447\u043d\u044b\u0445 \u0442\u0435\u0441\u0442\u043e\u0432 \u044f \u0437\u0430\u043d\u0438\u043c\u0430\u043b\u0441\u044f \u0438\u0437\u0443\u0447\u0435\u043d\u0438\u0435\u043c \u0434\u0430\u043c\u043f\u0430 \u043f\u0430\u043c\u044f\u0442\u0438 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430. \u041d\u0430\u043f\u043e\u043c\u043d\u044e, \u0447\u0442\u043e Unbound \u043f\u044b\u0442\u0430\u0435\u0442\u0441\u044f \u0434\u0435\u0440\u0436\u0430\u0442\u044c \u0440\u0430\u0437\u043c\u0435\u0440\u044b \u0431\u0438\u043d\u043e\u0432 \u0440\u0430\u0432\u043d\u044b\u043c\u0438 \u0435\u0434\u0438\u043d\u0438\u0446\u0435 \u0438 \u044d\u0442\u043e \u0443\u0441\u043b\u043e\u0432\u0438\u0435 \u0443\u0441\u043f\u0435\u0445\u0430: \u0442\u043e\u0433\u0434\u0430 \u043b\u043e\u043a \u043d\u0430 <code>lruhash->array<\/code> \u0432\u0441\u0435\u0433\u0434\u0430 \u0431\u0443\u0434\u0435\u0442 \u0431\u0440\u0430\u0442\u044c\u0441\u044f \u0438 \u043e\u0442\u043f\u0443\u0441\u043a\u0430\u0442\u044c\u0441\u044f \u043c\u043e\u043c\u0435\u043d\u0442\u0430\u043b\u044c\u043d\u043e, \u043a\u0440\u043e\u043c\u0435 \u0441\u043b\u0443\u0447\u0430\u044f <code>table_grow<\/code>.<\/p>\n<p>\u0421 \u043f\u043e\u043c\u043e\u0449\u044c\u044e coredump \u043c\u043e\u0436\u043d\u043e \u043e\u0446\u0435\u043d\u0438\u0442\u044c, \u043d\u0430\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0434\u043e\u043b\u0433\u043e \u0431\u0443\u0434\u0435\u0442 \u0434\u0435\u0440\u0436\u0430\u0442\u044c\u0441\u044f \u043b\u043e\u043a \u0432\u0437\u044f\u0442\u044b\u0439 \u043d\u0430 <code>lruhash->array<\/code>, \u0438\u0441\u0441\u043b\u0435\u0434\u0443\u044f \u0440\u0430\u0437\u043c\u0435\u0440\u044b \u0431\u0438\u043d\u043e\u0432. \u0427\u0442\u043e\u0431\u044b \u0432\u044b\u044f\u0441\u043d\u0438\u0442\u044c, \u043d\u0430\u0441\u043a\u043e\u043b\u044c\u043a\u043e Unbound \u0443\u0434\u0430\u0451\u0442\u0441\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u0443\u0441\u043b\u043e\u0432\u0438\u0435 \u00ab\u043e\u0434\u0438\u043d \u0431\u0438\u043d \u2014 \u043e\u0434\u043d\u0430 \u0437\u0430\u043f\u0438\u0441\u044c\u00bb, \u043d\u0443\u0436\u043d\u043e \u0432\u0437\u044f\u0442\u044c \u043a\u043e\u0440\u043a\u0443 \u0441 \u043f\u043b\u043e\u0445\u043e\u0439 \u043d\u043e\u0434\u044b (\u0443 \u043d\u0430\u0441 \u043a\u0430\u043a \u0440\u0430\u0437 \u0442\u0430\u043a\u0430\u044f \u0435\u0441\u0442\u044c) \u0438 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u043d\u0430 \u0440\u0435\u0430\u043b\u044c\u043d\u044b\u0435 \u0440\u0430\u0437\u043c\u0435\u0440\u044b \u0431\u0438\u043d\u043e\u0432. \u041d\u043e \u0432\u043e\u0437\u043d\u0438\u043a\u0430\u0435\u0442 \u0432\u043e\u043f\u0440\u043e\u0441 \u2014 \u043a\u0430\u043a?\u00a0<\/p>\n<p>\u042f \u0437\u043d\u0430\u043b, \u0447\u0442\u043e \u0432 gdb \u0435\u0441\u0442\u044c \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0430 Python. \u041f\u0438\u0448\u0435\u043c \u043f\u0440\u043e\u0441\u0442\u0435\u043d\u044c\u043a\u0438\u0439 \u0441\u043a\u0440\u0438\u043f\u0442 gdb_traverse.py.<\/p>\n<details class=\"spoiler\">\n<summary>\u041a\u043e\u0434 \u0441\u043a\u0440\u0438\u043f\u0442\u0430 gdb_traverse.py<\/summary>\n<div class=\"spoiler__content\">\n<pre><code class=\"python\">import gdb   class TraverseNodesPrinter(gdb.Command):     \"\"\"Prints the ListNode from our example in a nice format!\"\"\"      def __init__(self):         super(TraverseNodesPrinter, self).__init__(\"walklist\", gdb.COMMAND_USER)      def invoke(self, args, from_tty):         # You can pass args here so this routine could actually evaluate different         # variables at runtime         print(\"Args Passed: %s\" % args)          # Let's walk through the list starting with the head         #         # We can access value info by looking at:         #  https:\/\/sourceware.org\/gdb\/onlinedocs\/gdb\/Values-From-Inferior.html#Values-From-Inferior         argv = args.split()         ref = argv.pop(0)         silent = bool(argv)          slab_ptr = gdb.parse_and_eval(ref)         slab_size = slab_ptr[\"size\"]         print(\"slab_size=%s\" % slab_size)          total = {}         for si in range(slab_size):             slab_max = 0             percent_max = 0             count = 0             node_ptr = slab_ptr[\"array\"] + si             array = node_ptr[\"array\"]             size = int(node_ptr[\"size\"])             next_prc = 10             if not silent:                 print(\"slab-%s\" % si)             most_overloaded_bin = 0             mob_prc = 0             for i in range(size):                 elem = array + i                 if elem == 0:                     continue                  overflow_list = elem[\"overflow_list\"]                 local_max = 0                 while overflow_list != 0:                     local_max += 1                     overflow_list = overflow_list[\"overflow_next\"]                 if local_max > slab_max:                     slab_max = local_max                     most_overloaded_bin = i                 if local_max > percent_max:                     percent_max = local_max                     mob_prc = i                 count += local_max                  prc = float(i) \/ size * 100                 if prc > next_prc:                     next_prc = prc + 10  # every N%                     if not silent:                         print(\"%s prc current max bin(%s).length %s count %s\" % (int(prc), mob_prc, percent_max, count))                     percent_max = 0             total[si] = (most_overloaded_bin, slab_max, count)             if not silent:                 print(\"100 prc max bin(%s).length %s, count %s nodes\" % (most_overloaded_bin, slab_max, count))                 print(\"\")          total_sum = 0         global_max = 0         for si in total:             most_overloaded_bin, slab_max, count = total[si]             total_sum += count             global_max = max(slab_max, global_max)             if not silent:                 print(\"slab-%s max bin(%s).length %s count %s\" % (si, most_overloaded_bin, slab_max, count))         print(\"Found total-max bin.length %s, total=%s nodes\" % (global_max, total_sum))   TraverseNodesPrinter()<\/code><\/pre>\n<\/p>\n<\/div>\n<\/details>\n<p>\u0417\u0430\u0433\u0440\u0443\u0436\u0430\u0435\u043c gdb \u0438 \u043a\u043e\u0440\u043a\u0443 \u2014 \u0443\u0434\u0430\u0447\u043d\u043e \u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c\u0441\u044f \u0432 \u0442\u0440\u0435\u0434\u0435 \u043f\u043e\u0447\u0442\u0438 \u0432 \u043d\u0443\u0436\u043d\u043e\u043c \u043d\u0430\u043c \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0435 (\u043d\u043e \u044d\u0442\u043e \u0441\u044b\u0433\u0440\u0430\u0435\u0442 \u0441 \u043d\u0430\u043c\u0438 \u0437\u043b\u0443\u044e \u0448\u0443\u0442\u043a\u0443).<\/p>\n<details class=\"spoiler\">\n<summary>\u0412\u043e\u0442, \u0447\u0442\u043e \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0432 \u0438\u0442\u043e\u0433\u0435<\/summary>\n<div class=\"spoiler__content\">\n<pre><code class=\"bash\">$ gdb unbound-1.17.0-r10415458-spinlock ... Reading symbols from unbound-1.17.0-r10415458-spinlock... ... (gdb) core core_534009.gdb warning: core file may not match specified executable file. [New LWP 534009] [New LWP 534066] ... (gdb) bt #0  0x00007f8fa0d22d15 in ?? () #1  0x0000000002fef852 in lruhash_lookup (table=0x75b7fb42c80, hash=2948070628,     key=key@entry=0x7fff134b2ae8, wr=wr@entry=0)     at \/-S\/contrib\/tools\/unbound\/util\/storage\/lruhash.c:362 #2  0x0000000002ff0dae in slabhash_lookup (sl=sl@entry=0x75b7f1a68c0, hash=2948070628,    &lt;&lt;&lt;&lt;&lt; \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0441\u044e\u0434\u0430     key=0x7fff134b2a01, key@entry=0x7fff134b2ae8, wr=wr@entry=0) ... # \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u043e\u0435 \u043c\u043e\u0436\u043d\u043e \u043e\u043f\u0443\u0441\u0442\u0438\u0442\u044c  (gdb) up 2 #2  0x0000000002ff0dae in slabhash_lookup (sl=sl@entry=0x75b7f1a68c0, hash=2948070628,     key=0x7fff134b2a01, key@entry=0x7fff134b2ae8, wr=wr@entry=0)     at \/-S\/contrib\/tools\/unbound\/util\/storage\/slabhash.c:125 125    return lruhash_lookup(sl->array[slab_idx(sl, hash)], hash, key, wr); (gdb) print *sl $2 = {size = 32, mask = 4160749568, shift = 27, array = 0x75b7f980200} # \u041e\u041a, \u0432\u0438\u0434\u0438\u043c 32 \u0441\u043b\u0430\u0431\u0430 \u0438 \u043c\u0430\u0441\u0441\u0438\u0432 \u0441\u043b\u0430\u0431\u043e\u0432 # array \u0442\u0443\u0442 \u2014 \u044d\u0442\u043e slabhash->array[32]  ... # \u043e\u0434\u0438\u043d lruhash \u0432\u043d\u0443\u0442\u0440\u0438 slabhash->array \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0442\u0430\u043a (gdb) print *sl->array[0] $6 = {lock = 1, sizefunc = 0x2fdf9c0 &lt;ub_rrset_sizefunc>,   compfunc = 0x2fdfa10 &lt;ub_rrset_compare>, delkeyfunc = 0x2fdfa90 &lt;ub_rrset_key_delete>,   deldatafunc = 0x2fdfad0 &lt;rrset_data_delete>, markdelfunc = 0x2f843c0 &lt;rrset_markdel>,   cb_arg = 0x75b7f340078, size = 524288, size_mask = 524287, array = 0x75e00800000,   lru_start = 0x75b4c0c19e0, lru_end = 0x75c9c818ff0, num = 424038, space_used = 145144085,   space_max = 268435456}   # \u043e\u0434\u0438\u043d bin \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0442\u0430\u043a (gdb) print sl->array[0]->array[0] $7 = {lock = 1, overflow_list = 0x75e5da92e10}   # \u0417\u0430\u0433\u0440\u0443\u0436\u0430\u0435\u043c \u043d\u0430\u0448 \u0447\u0443\u0434\u043e-\u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442 \u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c \u0435\u0433\u043e  (gdb) source gdb_traverse.py (gdb) set pagination off (gdb) walklist sl  # \u0431\u0435\u0437 silent-\u0440\u0435\u0436\u0438\u043c\u0430 \u0434\u043b\u044f \u0431\u043e\u043b\u044c\u0448\u043e\u0433\u043e \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0430 \u0441\u043b\u0430\u0431\u043e\u0432 \u044d\u0442\u043e\u0442 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442 # \u043d\u0430\u043f\u0435\u0447\u0430\u0442\u0430\u0435\u0442 \u043e\u0447\u0435\u043d\u044c \u043c\u043d\u043e\u0433\u043e \u0442\u0435\u043a\u0441\u0442\u0430, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u044f \u0441\u043e\u043a\u0440\u0430\u0442\u0438\u043b \u0432\u044b\u0432\u043e\u0434  #     ,- N \u043d\u043e\u043c\u0435\u0440 \u0441\u043b\u0430\u0431\u0430 \u0432 slabhash->array[N] #   \/      , - M \u043d\u043e\u043c\u0435\u0440 \u0431\u0438\u043d\u0430 \u0432 slabhash->array[0](lruhash)->array[M]->lruhash_bin #  |     \/       ,- \u0440\u0430\u0437\u043c\u0435\u0440 linked-list \u0443 lruhash_bin->overflow_list slab-0 max bin(309871).length 2748 count 424038 # &lt;- \u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0432\u0441\u0435\u0433\u043e \u0437\u0430\u043f\u0438\u0441\u0435\u0439 \u0432 \u044d\u0442\u043e\u043c lruhash slab-1 max bin(436426).length 164 count 421672 slab-2 max bin(329311).length 18 count 420069 slab-3 max bin(261246).length 8 count 420491 slab-4 max bin(280420).length 33 count 421381 slab-5 max bin(285169).length 905 count 422057 slab-6 max bin(346884).length 6621 count 428844 slab-7 max bin(149391).length 44 count 420415 slab-8 max bin(475314).length 64 count 420950 slab-9 max bin(271580).length 25 count 419529 slab-10 max bin(372061).length 13 count 419983 slab-11 max bin(156506).length 50 count 421106 slab-12 max bin(65704).length 10 count 421407 slab-13 max bin(405913).length 31 count 421779 slab-14 max bin(182546).length 1383 count 422440 slab-15 max bin(51181).length 8 count 420793 slab-16 max bin(305677).length 10 count 420843 slab-17 max bin(229787).length 278 count 420631 slab-18 max bin(383134).length 98 count 420769 slab-19 max bin(278627).length 17 count 419738 slab-20 max bin(243904).length 59 count 421958 slab-21 max bin(232340).length 278555 count 707175 slab-22 max bin(108784).length 30 count 420950 slab-23 max bin(378505).length 190 count 420991 slab-24 max bin(244475).length 78 count 421245 slab-25 max bin(158331).length 8 count 421249 slab-26 max bin(294639).length 8 count 421501 slab-27 max bin(151957).length 13 count 421052 slab-28 max bin(362737).length 64837 count 486955 slab-29 max bin(344255).length 3920 count 424799 slab-30 max bin(399645).length 223 count 422094 slab-31 max bin(419568).length 127725 count 548963 Found total-max bin.length 278555, total=13967867 nodes                      #      |              `- \u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0432\u0441\u0435\u0433\u043e \u0437\u0430\u043f\u0438\u0441\u0435\u0439 \u0432 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0430\u0431                      #      |                -\u043a\u044d\u0448\u0435 (slabhash)                      #       `- \u0441\u0430\u043c\u044b\u0439 \u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u0441\u043f\u0438\u0441\u043e\u043a linked-list, \u043d\u0430\u0439\u0434\u0435\u043d\u043d\u044b\u0439 \u0441\u0440\u0435\u0434\u0438 \u0432\u0441\u0435\u0445 \u0431\u0438\u043d\u043e\u0432<\/code><\/pre>\n<\/p>\n<\/div>\n<\/details>\n<p>\u0421\u043e\u0433\u043b\u0430\u0441\u0438\u0442\u0435\u0441\u044c, \u0447\u0442\u043e \u0441 \u043f\u0435\u0440\u0432\u043e\u0433\u043e \u0432\u0437\u0433\u043b\u044f\u0434\u0430 \u0438 \u0434\u0430\u0436\u0435 \u0441\u043e \u0432\u0442\u043e\u0440\u043e\u0433\u043e <code>total<\/code><em> <\/em>\u043d\u0430\u043c \u044f\u0432\u043d\u043e \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442, \u0447\u0442\u043e \u0445\u044d\u0448-\u0444\u0443\u043d\u043a\u0446\u0438\u044f Unbound, \u043c\u044f\u0433\u043a\u043e \u0433\u043e\u0432\u043e\u0440\u044f, \u043d\u0435\u043d\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u0430\u044f. <\/p>\n<pre><code class=\"bash\">Found total-max bin.length 278555, total=13967867 nodes<\/code><\/pre>\n<p>\u041e\u043d\u0430 \u0434\u0430\u0451\u0442 \u0436\u0443\u0442\u043a\u0438\u0435 \u043f\u0435\u0440\u0435\u043a\u043e\u0441\u044b \u043d\u0430 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0431\u0438\u043d\u044b. \u0418\u0437-\u0437\u0430 \u0442\u0430\u043a\u0438\u0445 \u043f\u0435\u0440\u0435\u043a\u043e\u0441\u043e\u0432 \u043e\u0431\u0440\u0430\u0449\u0435\u043d\u0438\u0435 \u0432 \u0431\u0438\u043d \u0441 \u0431\u043e\u043b\u044c\u0448\u0438\u043c <code>linked-list<\/code> \u0442\u043e\u0440\u043c\u043e\u0437\u0438\u0442 \u0432\u0441\u0435 \u0442\u0440\u0435\u0434\u044b \u043d\u0430 \u0436\u0433\u0443\u0447\u0435\u043c spinlock. \u042d\u0442\u043e \u0438 \u0437\u0430\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 Unbound \u0432 \u0430\u0433\u043e\u043d\u0438\u0438 \u043f\u0440\u043e\u0441\u0438\u0442\u044c \u043f\u043e\u043c\u043e\u0449\u0438 \u0447\u0435\u0440\u0435\u0437 \u0430\u043b\u0435\u0440\u0442\u044b \u043d\u0430 load-average \u0441\u0438\u0441\u0442\u0435\u043c\u044b. \u0410 \u0432\u0437\u0440\u044b\u0432\u0430\u0442\u044c\u0441\u044f \u043e\u043d\u043e \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u0442 \u0442\u043e\u0433\u0434\u0430, \u043a\u043e\u0433\u0434\u0430 \u0432\u0441\u0435 \u0436\u0438\u0440\u043d\u044b\u0435 \u0441\u043b\u0430\u0431\u044b (\u0434\u0430\u0436\u0435 \u0432 \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u043c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0435) \u043d\u0430\u0441\u044b\u0449\u0430\u044e\u0442\u0441\u044f \u043e\u0434\u043d\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e \u0438 \u043d\u0430\u0447\u0438\u043d\u0430\u044e\u0442 \u0442\u0440\u0438\u0433\u0433\u0435\u0440\u0438\u0442\u044c <code>table_grow<\/code>.<\/p>\n<p>\u042d\u0442\u0430 \u043a\u043e\u0440\u043a\u0430 \u043a\u0430\u043a \u0440\u0430\u0437 \u043b\u043e\u0432\u0438\u0442 \u0442\u0430\u043a\u043e\u0439 \u043c\u043e\u043c\u0435\u043d\u0442: \u0443 \u0431\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u0430 \u0442\u0440\u0435\u0434\u043e\u0432 \u043f\u043e ~420631 \u0437\u0430\u043f\u0438\u0441\u0435\u0439 \u0432 \u0441\u043b\u0430\u0431\u0430\u0445, \u0430 \u044d\u0442\u043e \u043e\u0447\u0435\u043d\u044c \u0431\u043b\u0438\u0437\u043a\u043e \u043a \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u043c\u0443 <code>table_grow<\/code>.<\/p>\n<p>\u0420\u0430\u0441\u0441\u0447\u0438\u0442\u0430\u0442\u044c \u043c\u043e\u043c\u0435\u043d\u0442\u044b \u0440\u0435\u0430\u043b\u043b\u043e\u043a\u0430\u0446\u0438\u0438 \u043c\u043e\u0436\u043d\u043e \u0442\u0430\u043a.<\/p>\n<pre><code class=\"bash\"># lruhash->array \u0434\u043e\u043b\u0436\u0435\u043d \u0438\u043c\u0435\u0442\u044c \u0440\u0430\u0437\u043c\u0435\u0440 \u0441\u0442\u0435\u043f\u0435\u043d\u0438 \u0434\u0432\u043e\u0439\u043a\u0438 # \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u0441\u0442\u0430\u0440\u0442\u043e\u0432\u044b\u0439 \u0440\u0430\u0437\u043c\u0435\u0440 \u0443 \u043d\u0435\u0433\u043e 1024 1024*2^9 = 524288 -> 1024*2^10 = 1048576<\/code><\/pre>\n<p>A \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 <code>lruhash->array<\/code> \u0435\u0433\u043e \u0443\u0436\u0435 \u043f\u0435\u0440\u0435\u0432\u0430\u043b\u0438\u043b\u0438: \u0443 \u0441\u043b\u0430\u0431\u0430 <code>slab-21<\/code> \u2014 548963 \u0437\u0430\u043f\u0438\u0441\u0435\u0439. \u0412\u0430\u043d\u0433\u0443\u044e, \u0447\u0442\u043e \u043d\u0430 \u0434\u0435\u0441\u044f\u0442\u043e\u043c \u0440\u0435\u0430\u043b\u043b\u043e\u043a\u0435\u0439\u0442\u0435 \u0432\u043e\u043e\u0431\u0449\u0435 \u0432\u0441\u0451 \u0443\u043c\u0440\u0451\u0442 \ud83d\ude42<\/p>\n<blockquote>\n<p><strong>\u0412\u0430\u0436\u043d\u043e:<\/strong> \u0431\u044b\u0441\u0442\u0440\u043e\u0435 \u043f\u0440\u0435\u0434\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0438 \u043d\u0435\u0443\u0434\u0430\u0447\u043d\u043e\u0435 \u0441\u043e\u0432\u043f\u0430\u0434\u0435\u043d\u0438\u0435 \u043c\u043e\u0436\u0435\u0442 \u043f\u043e\u0432\u0435\u0441\u0442\u0438 \u0432\u0430\u0441 \u043f\u043e \u043b\u043e\u0436\u043d\u043e\u043c\u0443 \u043f\u0443\u0442\u0438 \u0438 \u0432 \u0438\u0442\u043e\u0433\u0435 \u043f\u0440\u0438\u0432\u0435\u0441\u0442\u0438 \u043a \u043b\u043e\u0436\u043d\u044b\u043c \u0432\u044b\u0432\u043e\u0434\u0430\u043c. \u0411\u0443\u0434\u044c\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u0442\u0435\u043b\u044c\u043d\u044b \u0438 \u043e\u0441\u0442\u043e\u0440\u043e\u0436\u043d\u044b! \u041c\u043d\u0435 \u043f\u043e\u0432\u0435\u0437\u043b\u043e, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u0432\u043e\u0432\u0440\u0435\u043c\u044f \u043f\u0440\u0438\u0448\u0451\u043b \u043a\u043e\u043b\u043b\u0435\u0433\u0430 \u0441 \u043e\u0447\u0435\u043d\u044c \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u044b\u043c\u0438 \u043f\u0440\u0438\u043c\u0435\u0440\u0430\u043c\u0438 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432, \u043d\u043e \u043e\u0431 \u044d\u0442\u043e\u043c \u043d\u0438\u0436\u0435.<\/p>\n<\/blockquote>\n<p>\u041f\u043e \u043b\u043e\u0433\u0438\u043a\u0435 \u0445\u044d\u0448-\u0444\u0443\u043d\u043a\u0446\u0438\u044e Unbound \u043d\u0430\u0434\u043e \u0431\u044b \u0432\u044b\u043a\u0438\u043d\u0443\u0442\u044c \u0438 \u0432\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0442\u0443\u0434\u0430 \u043a\u0430\u043a\u043e\u0439-\u043d\u0438\u0431\u0443\u0434\u044c <code>xxhash<\/code> \u0438\u043b\u0438 <code>whyhash<\/code>. \u041b\u0438\u0431\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0432\u0430\u0440\u0438\u0430\u043d\u0442 \u0434\u043b\u044f \u0431\u0435\u0434\u043d\u044b\u0445: \u0436\u0438\u0442\u044c \u0441 \u0431\u043e\u043b\u044c\u0448\u0438\u043c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e\u043c \u043c\u0435\u043b\u043a\u0438\u0445 \u0441\u043b\u0430\u0431\u043e\u0432.<\/p>\n<p>\u041f\u0440\u0438 \u043c\u0430\u043b\u0435\u043d\u044c\u043a\u0438\u0445 \u0441\u043b\u0430\u0431\u0430\u0445 \u043f\u043e 8\u043c\u0431 \u043f\u043e \u043c\u043e\u0438\u043c (\u043a\u0430\u043a \u0432\u044b\u044f\u0441\u043d\u0438\u043b\u043e\u0441\u044c \u043f\u043e\u0437\u0436\u0435 \u043d\u0435 \u0441\u043e\u0432\u0441\u0435\u043c \u0442\u043e\u0447\u043d\u044b\u043c) \u0440\u0430\u0441\u0447\u0451\u0442\u0430\u043c \u0432 \u043e\u0434\u0438\u043d <code>BIN->linked-list<\/code> \u043d\u0435 \u0434\u043e\u043b\u0436\u043d\u043e \u043d\u0430\u043b\u0438\u0442\u044c\u0441\u044f \u0431\u043e\u043b\u044c\u0448\u0435 20\u043a \u0437\u0430\u043f\u0438\u0441\u0435\u0439. \u042d\u0442\u043e \u0437\u043d\u0430\u0447\u0438\u0442, \u0447\u0442\u043e \u0434\u0430\u0436\u0435 \u043f\u0440\u0438 \u043e\u0447\u0435\u043d\u044c \u0430\u043d\u043e\u043c\u0430\u043b\u044c\u043d\u043e\u043c \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0438 \u0445\u044d\u0448 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 Unbound, \u043e\u0431\u043e\u0439\u0442\u0438 \u043e\u0434\u0438\u043d \u0431\u0438\u043d \u0432 20\u043a \u0437\u0430\u043f\u0438\u0441\u0435\u0439 \u0432 \u0440\u0430\u0437\u044b \u043b\u0435\u0433\u0447\u0435, \u0447\u0435\u043c \u043e\u0434\u0438\u043d \u0431\u0438\u043d \u0432 278k \u0437\u0430\u043f\u0438\u0441\u0435\u0439.<\/p>\n<p>\u0416\u0430\u043b\u044c, \u0447\u0442\u043e Unbound \u043c\u0435\u0436\u0434\u0443 \u0441\u043b\u0430\u0431\u0430\u043c\u0438 \u0440\u0430\u0441\u043a\u0438\u0434\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0442\u043e\u0439 \u0436\u0435 \u043a\u0440\u0438\u0432\u043e\u0439 \u0445\u044d\u0448-\u0444\u0443\u043d\u043a\u0446\u0438\u0435\u0439 <a href=\"https:\/\/github.com\/NLnetLabs\/unbound\/blob\/d116c9711ad789fc03a25e2cc0747b3e68e28e0f\/util\/storage\/slabhash.c#L111\"><u>slabhash.c#L111<\/u><\/a>-><a href=\"https:\/\/github.com\/NLnetLabs\/unbound\/blob\/d116c9711ad789fc03a25e2cc0747b3e68e28e0f\/util\/data\/dname.c#L287\"><u>dname.c#L287<\/u><\/a>-><a href=\"https:\/\/github.com\/NLnetLabs\/unbound\/blob\/d116c9711ad789fc03a25e2cc0747b3e68e28e0f\/util\/storage\/lookup3.c#L346\"><u>lookup3.c#L346<\/u><\/a>. \u041d\u043e \u0434\u0435\u043b\u0430\u0435\u0442 \u043e\u043d \u044d\u0442\u043e \u043f\u043e \u043f\u0435\u0440\u0432\u043e\u0439 \u0447\u0430\u0441\u0442\u0438 \u0445\u0435\u0448\u0430, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043a\u043e\u043b\u043b\u0438\u0437\u0438\u0438 \u0431\u0443\u0434\u0443\u0442 \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u0434\u0440\u0443\u0433\u0438\u0435. \u0412 \u043e\u0431\u0449\u0435\u043c, \u043d\u0430\u0434\u0435\u0436\u0434\u0430 \u0435\u0441\u0442\u044c!<\/p>\n<p>\u042f \u043d\u0430\u043f\u0438\u0441\u0430\u043b \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0430\u0446\u0438\u044e \u0432 \u0442\u0438\u043a\u0435\u0442, \u0438 \u0431\u044b\u043b \u0433\u043e\u0442\u043e\u0432 \u043d\u0430 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439 \u043d\u0435\u0434\u0435\u043b\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u043f\u0440\u0435\u0434\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043e \u043a\u0440\u0438\u0432\u0438\u0437\u043d\u0435 \u0445\u044d\u0448-\u0444\u0443\u043d\u043a\u0446\u0438\u0438, \u0437\u0430\u043c\u0435\u043d\u0438\u0432 \u0435\u0451. \u0418 \u0442\u0443\u0442 \u0441\u043b\u0443\u0447\u0438\u043b\u0430\u0441\u044c \u0442\u0430 \u0441\u0430\u043c\u0430\u044f \u0441\u0443\u0440\u043e\u0432\u0430\u044f \u0440\u0435\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u044c: \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442 \u043a\u043e\u043b\u043b\u0435\u0433\u0430 \u0438 \u0433\u043e\u0432\u043e\u0440\u0438\u0442, \u0447\u0442\u043e \u0445\u043e\u0442\u044c \u043d\u0430\u0448\u0430 \u043a\u0430\u043d\u0430\u0440\u0435\u0439\u043a\u0430 \u0438 \u0441\u0442\u0430\u043b\u0430 \u0441\u0435\u0431\u044f \u0447\u0443\u0432\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c \u043b\u0443\u0447\u0448\u0435 \u043f\u043e LA, \u0443 \u043d\u0435\u0433\u043e \u0435\u0441\u0442\u044c \u0437\u0430\u043f\u0440\u043e\u0441\u044b, \u0442\u0435\u0441\u0442 \u043a\u043e\u0442\u043e\u0440\u044b\u043c\u0438 \u0432 700-1000 rps \u043c\u043e\u0436\u043d\u043e \u0443\u0431\u0438\u0442\u044c \u0441\u0435\u0440\u0432\u0435\u0440. \u042d\u0442\u043e \u0431\u044b\u043b\u043e \u043d\u0435\u043e\u0436\u0438\u0434\u0430\u043d\u043d\u043e.\u00a0<\/p>\n<p>\u0427\u0443\u0442\u044c \u043f\u043e\u0437\u0436\u0435 \u043c\u044b \u043f\u0440\u0438\u0448\u043b\u0438 \u043a \u0432\u044b\u0432\u043e\u0434\u0443, \u0447\u0442\u043e \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043f\u0440\u043e\u0432\u043e\u0434\u0438\u0442\u044c \u0442\u0435\u0441\u0442 \u0432\u043e\u0442 \u0442\u0430\u043a\u0438\u043c\u0438 \u0437\u0430\u043f\u0438\u0441\u044f\u043c\u0438.<\/p>\n<pre><code class=\"cmake\">$(RANDOM STRING).example.com<\/code><\/pre>\n<p>\u0412 <code>CNAME<\/code> \u0441\u043e \u0437\u0432\u0451\u0437\u0434\u043e\u0447\u043a\u043e\u0439\u00a0 <code>*.example.com<\/code> \u2014 \u044d\u0442\u043e <code>CNAME<\/code> \u043d\u0430 <code>example.com<\/code>.<\/p>\n<p>\u0418 \u043f\u043e\u0437\u0436\u0435 \u0441\u0442\u0430\u043b\u043e \u044f\u0441\u043d\u043e, \u0447\u0442\u043e \u0432 \u043e\u0431\u0449\u0435\u043c \u0432\u0438\u0434\u0435 Pandora-\u043f\u043b\u0430\u0433\u0438\u043d \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0443\u0447\u0438\u0442\u044c \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u043f\u043e \u0448\u0430\u0431\u043b\u043e\u043d\u0443.<\/p>\n<pre><code class=\"cmake\">$(RANDOM_STRING).$(DOMAIN) - *.$(DOMAIN) CNAME \u043d\u0430 $(DOMAIN)<\/code><\/pre>\n<p>\u0411\u0443\u0434\u0435\u043c \u043d\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u0442\u0430\u043a\u0438\u0435 \u0437\u0430\u043f\u0440\u043e\u0441\u044b udp-random.\u00a0<\/p>\n<p>\u041f\u0440\u0435\u0434\u0432\u0430\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u0442\u0435\u0441\u0442 \u043f\u043e\u043a\u0430\u0437\u0430\u043b, \u0447\u0442\u043e \u0440\u0435\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0441\u0443\u0440\u043e\u0432\u0430: \u0432\u0441\u0435\u0433\u043e 701-rps \u0438 Unbound \u043b\u0435\u0436\u0438\u0442 \u043f\u043e\u0434 \u043a\u0443\u0447\u0435\u0439 \u0433\u043e\u0440\u044f\u0449\u0438\u0445 pthread_spin_lock. \u0410 \u0441 \u0431\u043e\u043b\u044c\u0448\u0438\u043c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e\u043c \u0441\u043b\u0430\u0431\u043e\u0432 (1024) \u043e\u0441\u043e\u0431\u043e \u043d\u0438\u0447\u0435\u0433\u043e \u043d\u0435 \u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f. \u042f \u0437\u0430\u043c\u0435\u0442\u0438\u043b, \u0447\u0442\u043e Unbound \u043f\u0430\u0434\u0430\u0435\u0442 \u0443\u0436\u0435 \u043d\u0430 \u0431\u043e\u043b\u044c\u0448\u0435\u043c rps, \u0433\u0434\u0435-\u0442\u043e \u0431\u043e\u043b\u044c\u0448\u0435 1000, \u043d\u043e \u0440\u0430\u0437\u043d\u0438\u0446\u0430 \u0442\u0430\u043a \u043c\u0430\u043b\u0430, \u0447\u0442\u043e \u044f \u043d\u0435 \u043f\u0440\u0438\u0434\u0430\u043b \u0435\u0439 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f.<\/p>\n<p>\u041d\u0430\u0447\u0430\u043b\u0438\u0441\u044c \u0432\u044b\u0445\u043e\u0434\u043d\u044b\u0435&#8230;<\/p>\n<h3>\u041b\u043e\u0436\u043d\u044b\u0439 \u0441\u043b\u0435\u0434: \u0445\u044d\u0448-\u0444\u0443\u043d\u043a\u0446\u0438\u044f Unbound \u043d\u0438 \u043f\u0440\u0438 \u0447\u0451\u043c<\/h3>\n<p>\u041a\u043e\u043d\u0435\u0447\u043d\u043e \u0436\u0435, \u044f \u043d\u0435 \u0441\u043c\u043e\u0433 \u0434\u043e\u0442\u0435\u0440\u043f\u0435\u0442\u044c \u0434\u043e \u043f\u043e\u043d\u0435\u0434\u0435\u043b\u044c\u043d\u0438\u043a\u0430!<\/p>\n<p>\u042f \u043d\u0430\u0447\u0430\u043b \u0434\u0443\u043c\u0430\u0442\u044c, \u0433\u0434\u0435 \u0436\u0435 \u0441\u043f\u0440\u044f\u0442\u0430\u043b\u0430\u0441\u044c \u043e\u0448\u0438\u0431\u043a\u0430 \u0438 \u043f\u043e\u0447\u0435\u043c\u0443 \u0434\u0430\u0436\u0435 \u0441 \u043c\u043e\u0435\u0439 \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0430\u0446\u0438\u0435\u0439 \u0441\u043f\u0438\u043d\u043b\u043e\u043a\u0438 \u0442\u0430\u043a \u043f\u043b\u043e\u0445\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0442. \u042f \u0440\u0435\u0448\u0438\u043b \u043f\u043e-\u0431\u044b\u0441\u0442\u0440\u043e\u043c\u0443 \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u0437\u0430\u043c\u0435\u043d\u0443 \u0445\u044d\u0448-\u0444\u0443\u043d\u043a\u0446\u0438\u0438: \u043d\u0430\u043f\u0438\u0441\u0430\u043b \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u043f\u0430\u0442\u0447, \u0433\u0434\u0435 \u0432\u0441\u0442\u0430\u0432\u0438\u043b <code>XXH32<\/code>, \u0437\u0430\u043b\u0438\u043b \u0431\u0438\u043d\u0430\u0440\u043d\u0438\u043a \u043d\u0430 \u043b\u043e\u0430\u0434 \u0441\u0442\u0435\u043d\u0434 \u0438 \u043d\u0430\u0433\u0440\u0443\u0437\u0438\u043b \u043e\u0431\u044b\u0447\u043d\u044b\u043c\u0438 \u0437\u0430\u043f\u0440\u043e\u0441\u0430\u043c\u0438. \u041a \u044d\u0442\u043e\u043c\u0443 \u043c\u043e\u043c\u0435\u043d\u0442\u0443 \u044f \u0443\u0436\u0435 \u043f\u043e\u043d\u044f\u043b, \u0447\u0442\u043e \u043d\u0443\u0436\u043d\u043e \u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u043d\u0430 \u0434\u0432\u0430 \u0433\u043b\u0430\u0432\u043d\u044b\u0445 \u043a\u044d\u0448\u0430, \u0434\u043b\u044f \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043c\u044b \u0432\u044b\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u043c \u0431\u043e\u043b\u044c\u0448\u0438\u0435 \u0440\u0430\u0437\u043c\u0435\u0440\u044b:<\/p>\n<ul>\n<li>\n<p><code>msg-cache<\/code>, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0445\u0440\u0430\u043d\u0438\u0442\u0441\u044f \u043c\u0435\u0442\u0430-\u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u043f\u0440\u043e \u043f\u0440\u0438\u0448\u0435\u0434\u0448\u0438\u0435 \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u2014 \u043e\u043f\u0446\u0438\u0438, edns \u0438 \u043f\u0440\u043e\u0447\u0438\u0435;<\/p>\n<\/li>\n<li>\n<p><code>rrset-cache<\/code>, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0445\u0440\u0430\u043d\u0438\u0442\u0441\u044f \u0442\u043e, \u0432\u043e \u0447\u0442\u043e \u0440\u0430\u0437\u0440\u0435\u0437\u043e\u043b\u0432\u0438\u043b\u0441\u044f \u0437\u0430\u043f\u0440\u043e\u0441 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f <a href=\"https:\/\/en.wikipedia.org\/wiki\/List_of_DNS_record_types\"><u>RRset types<\/u><\/a>.<\/p>\n<\/li>\n<\/ul>\n<p>\u042f \u0434\u0443\u043c\u0430\u043b, \u0447\u0442\u043e \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u0432 <code>msg-cache<\/code>, \u043d\u043e \u043a\u0430\u0440\u0442\u0438\u043d\u0430 \u043c\u0435\u043d\u044f \u043f\u0440\u0438\u044f\u0442\u043d\u043e \u0443\u0434\u0438\u0432\u0438\u043b\u0430. \u0412\u043e\u0442 \u043a\u0430\u043a \u0434\u043e\u043b\u0436\u043d\u0430 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u043d\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u0430\u044f \u0445\u044d\u0448 \u0444\u0443\u043d\u043a\u0446\u0438\u044f:<\/p>\n<pre><code class=\"bash\">(gdb) walklist daemon->env->msg_cache slab_size=64 slab-0 max bin(417).length 6 count 13851 ... slab-63 max bin(2104).length 6 count 13561 Found total-max bin.length 8, total=869285 nodes                        `- \u042d\u0422\u041e \u041e\u0427\u0415\u041d\u042c \u0425\u041e\u0420\u041e\u0428\u041e! \u041c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u0430\u044f \u0434\u043b\u0438\u043d\u0430 linked-list                           \u0432\u043d\u0443\u0442\u0440\u0438 BIN \u043d\u0435 \u0431\u043e\u043b\u044c\u0448\u0435 8 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432, \u0430 \u0437\u043d\u0430\u0447\u0438\u0442 \u043a\u043e\u043b\u043b\u0438\u0437\u0438\u0438                           \u0432 \u043d\u043e\u0432\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043e\u0447\u0435\u043d\u044c \u0440\u0435\u0434\u043a\u0438\u0435`  (gdb) walklist &amp;daemon->env->rrset_cache.table slab_size=128 slab-0 max bin(5570).length 6 count 6856 ... slab-127 max bin(47).length 5 count 6902 Found total-max bin.length 8, total=872176 nodes                         `- \u0434\u043b\u044f RRset \u0442\u043e\u0436\u0435 \u0432\u0441\u0451 \u0441\u0443\u043f\u0435\u0440<\/code><\/pre>\n<p>\u041a\u0430\u044e\u0441\u044c, \u0442\u0443\u0442 \u044f \u043e\u043f\u044f\u0442\u044c \u043f\u043e\u0442\u043e\u0440\u043e\u043f\u0438\u043b\u0441\u044f \u0438 \u043d\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u043b \u0437\u0430\u043f\u0440\u043e\u0441\u0430\u043c\u0438 <code>udp-random<\/code>. \u041e\u043d\u0438 \u0442\u043e\u0436\u0435 \u0432\u044b\u0437\u044b\u0432\u0430\u044e\u0442 \u043a\u043e\u043b\u043b\u0438\u0437\u0438\u044e \u0432 <code>rrset<\/code>, \u043d\u043e \u0432 <code>msg_cache<\/code> \u043a\u043e\u043b\u043b\u0438\u0437\u0438\u0438 \u043d\u0435\u0442 \u2014 \u0438 \u044d\u0442\u043e \u0443\u0436\u0435 \u0445\u043e\u0440\u043e\u0448\u043e! \u0417\u043d\u0430\u0447\u0438\u0442, \u043d\u0435 \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u0432\u044b\u0448\u0435\u043d\u043d\u043e\u0433\u043e LA \u0434\u0430\u0436\u0435 \u0441 \u043c\u0430\u043b\u044b\u043c \u043a\u043e\u043b-\u0432\u043e\u043c \u0441\u043b\u0430\u0431\u043e\u0432.<\/p>\n<p>\u0414\u043b\u044f <code>msg_cache<\/code> \u0441\u043b\u0430\u0431\u043e\u0432 \u043a\u0430\u0440\u0442\u0438\u043d\u0430 \u0442\u0430\u043a\u0430\u044f \u0436\u0435, \u043a\u0430\u043a \u0432 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u043c \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0435.<\/p>\n<pre><code class=\"bash\">(gdb) walklist daemon->env->msg_cache Args Passed: daemon->env->msg_cache slab_size=64 Found total-max bin.length 8, total=894370 nodes<\/code><\/pre>\n<p>\u0410 \u0434\u043b\u044f <code>rrset<\/code> \u043e\u043d\u0430 \u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f \u0432\u043e\u0442 \u0442\u0430\u043a.<\/p>\n<pre><code class=\"bash\">(gdb) walklist &amp;daemon->env->rrset_cache.table Args Passed: &amp;daemon->env->rrset_cache.table slab_size=128 ... slab-0 max bin(5570).length 6 count 6856 ... # &lt;&lt;&lt;&lt; \u0442\u0443\u0442 \u043e\u0447\u0435\u043d\u044c \u0445\u043e\u0440\u043e\u0448\u0435\u0435 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 4-6 entry \u043d\u0430 bin. slab-108 max bin(4188).length 6 count 6824 slab-109 max bin(21947).length 25093 count 31838  # &lt;&lt;&lt; \u0430\u043d\u043e\u043c\u0430\u043b\u0438\u044f \u2014 \u0432\u0441\u0435\u0433\u043e \u043e\u0434\u043d\u0430 \u043d\u0430 \u0432\u0441\u0435 \u0441\u043b\u0430\u0431\u044b. slab-110 max bin(6428).length 6 count 6791 ... # &lt;&lt;&lt;&lt; \u0442\u0443\u0442 \u043e\u0447\u0435\u043d\u044c \u0445\u043e\u0440\u043e\u0448\u0435\u0435 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 4-6 entry \u043d\u0430 bin. slab-127 max bin(47).length 5 count 6902 Found total-max bin.length 25093, total=897272 nodes<\/code><\/pre>\n<p>\u041f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u0432 \u044d\u0442\u043e\u0442 \u043c\u043e\u043c\u0435\u043d\u0442, \u044f \u043f\u043e\u043d\u044f\u043b, \u0447\u0442\u043e \u043d\u0430\u0434\u043e \u0431\u044b \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u0435\u0449\u0451 \u0438 <code>msg-cache<\/code> \u0434\u043b\u044f coredump, \u0441\u043e\u0431\u0440\u0430\u043d\u043d\u043e\u0433\u043e \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u043a\u043e\u0439. \u041d\u043e \u0432\u0435\u0440\u043d\u0443\u043b\u0441\u044f \u043a \u044d\u0442\u043e\u043c\u0443 \u044f \u0442\u043e\u043b\u044c\u043a\u043e \u0432 \u043f\u043e\u043d\u0435\u0434\u0435\u043b\u044c\u043d\u0438\u043a.<\/p>\n<p>\u0412 \u043f\u043e\u043d\u0435\u0434\u0435\u043b\u044c\u043d\u0438\u043a \u0432\u044b\u044f\u0441\u043d\u0438\u043b\u043e\u0441\u044c, \u0447\u0442\u043e \u044f \u0437\u0440\u044f \u043d\u0430\u0433\u043e\u0432\u0430\u0440\u0438\u0432\u0430\u043b \u043d\u0430 \u0445\u044d\u0448-\u0444\u0443\u043d\u043a\u0446\u0438\u044e Unbound. \u041f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u0442\u0435\u043e\u0440\u0438\u0438 \u043e \u043a\u043e\u043b\u043b\u0438\u0437\u0438\u044f\u0445 \u0438 \u0441\u0432\u0435\u0436\u0430\u044f \u0433\u043e\u043b\u043e\u0432\u0430 \u043f\u043e\u0434\u0442\u0432\u0435\u0440\u0436\u0434\u0430\u044e\u0442, \u0447\u0442\u043e \u0445\u044d\u0448 \u0444\u0443\u043d\u043a\u0446\u0438\u044f Unbound \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043d\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u043e. \u0421\u043c\u043e\u0442\u0440\u0438\u043c \u043d\u0430 \u0442\u0443 \u00ab\u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u0443\u044e \u043a\u043e\u0440\u043a\u0443\u00bb, \u0441 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0432\u0441\u0451 \u043d\u0430\u0447\u0430\u043b\u043e\u0441\u044c. \u0422\u043e\u0447\u043d\u0435\u0435, \u043d\u0430 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f entry \u043f\u043e \u0431\u0430\u043a\u0435\u0442\u0430\u043c (\u0431\u0438\u043d\u0430\u043c) \u0432 <code>lruhash->array<\/code> c \u0440\u043e\u0434\u043d\u043e\u0439 \u0445\u044d\u0448 \u0444\u0443\u043d\u043a\u0446\u0438\u0435\u0439 Unbound.<\/p>\n<pre><code class=\"bash\">gdb \/usr\/sbin\/unbound core-file core_534009.gdb source .\/gdb_traverse.py (gdb) frame function daemon_fork #20 0x00000000021d5df3 in daemon_fork (daemon=daemon@entry=0x75b7f340000) at \/-S\/contrib\/tools\/unbound\/daemon\/daemon.c:789 789    \/-S\/contrib\/tools\/unbound\/daemon\/daemon.c: No such file or directory. (gdb) walklist daemon->env->msg_cache Args Passed: daemon->env->msg_cache slab_size=32 slab-0 100% max bin(23557).length 7, count 459932 nodes ... slab-0 max bin(23557).length 7 count 459932 slab-1 max bin(126260).length 8 count 460129 ... slab-31 max bin(149805).length 8 count 460061 Found total-max bin.length 9, total=14721205 nodes<\/code><\/pre>\n<p>\u041a\u0430\u043a \u0438 \u043e\u0436\u0438\u0434\u0430\u043b\u043e\u0441\u044c, \u0434\u043b\u044f msg_cache \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u043e\u0447\u0435\u043d\u044c \u0445\u043e\u0440\u043e\u0448\u0435\u0435. \u0418 \u0442\u0443\u0442 \u0432\u0441\u0451 \u0441\u0442\u0430\u043b\u043e \u044f\u0441\u043d\u043e: \u0435\u0441\u0442\u044c \u043a\u0430\u043a\u0430\u044f-\u0442\u043e \u0431\u0430\u0433\u0430, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043f\u0440\u0438\u0432\u043e\u0434\u0438\u0442 \u043a \u0442\u043e\u043c\u0443, \u0447\u0442\u043e <code>linked-list<\/code> \u0432 \u0431\u0438\u043d\u0430\u0445 <code>rrcset_cache<\/code> \u043d\u0435\u043f\u043e\u043d\u044f\u0442\u043d\u044b\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u0437\u0430\u043f\u043e\u043b\u043d\u044f\u044e\u0442\u0441\u044f \u0434\u043e \u0431\u043e\u043b\u044c\u0448\u0438\u0445 \u0440\u0430\u0437\u043c\u0435\u0440\u043e\u0432. \u041d\u0430 \u044d\u0442\u043e\u0442 \u0440\u0430\u0437 \u0438\u0441\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u044f \u0437\u0430\u0432\u043e\u0434\u044f\u0442 \u043d\u0430\u0441 \u0432 \u043e\u0447\u0435\u043d\u044c \u0441\u043b\u043e\u0436\u043d\u044b\u0439 \u043a\u043e\u0434 <a href=\"https:\/\/github.com\/NLnetLabs\/unbound\/blob\/master\/iterator\/iterator.c\"><u>iterator\/iterator.c<\/u><\/a> \u0438 <a href=\"https:\/\/github.com\/NLnetLabs\/unbound\/blob\/master\/services\/mesh.c\"><u>services\/mesh.c<\/u><\/a>, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043f\u043e\u0438\u0441\u043a\u0438 \u043c\u0435\u0441\u0442\u0430 \u0432\u043e\u0437\u043d\u0438\u043a\u043d\u043e\u0432\u0435\u043d\u0438\u044f \u0431\u0430\u0433\u0438 \u043f\u043e\u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043b\u0438 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438.<\/p>\n<p>\u041a \u0442\u0435\u043a\u0443\u0449\u0435\u043c\u0443 \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u044f \u0432\u044b\u044f\u0441\u043d\u0438\u043b, \u0447\u0442\u043e \u0432 \u0431\u0438\u043d\u0435 c \u0430\u043d\u043e\u043c\u0430\u043b\u0438\u0435\u0439 \u043f\u0440\u0438 \u0442\u0435\u0441\u0442\u0435 \u0437\u0430\u043f\u0440\u043e\u0441\u0430\u043c\u0438 <code>udp-random<\/code> \u0443 \u0432\u0441\u0435\u0445 \u0437\u0430\u043f\u0438\u0441\u0435\u0439 \u043e\u0434\u0438\u043d \u0438 \u0442\u043e\u0442 \u0436\u0435 \u0445\u044d\u0448. \u041f\u0440\u0438 \u044d\u0442\u043e\u043c <code>dname<\/code> \u0438 \u043c\u0435\u0442\u0430\u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f, \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0440\u0430\u0441\u0441\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u044d\u0442\u043e\u0442 \u0445\u044d\u0448, \u0432\u0435\u0437\u0434\u0435 \u0440\u0430\u0437\u043d\u044b\u0435.<\/p>\n<p>\u0418\u0441\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u044f \u0438\u0441\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u044f\u043c\u0438, \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0437\u0430\u0449\u0438\u0442\u0438\u0442\u044c\u0441\u044f \u043e\u0442 \u044d\u0442\u043e\u0439 \u043e\u043f\u0430\u0441\u043d\u043e\u0439 \u0431\u0430\u0433\u0438. \u041d\u0430\u0447\u0438\u043d\u0430\u0435\u043c \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043d\u0430\u0434 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430\u043c\u0438 \u0438 \u043d\u0430\u0433\u0440\u0443\u0436\u0430\u0442\u044c Unbound, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f <code>udp-random<\/code>.<\/p>\n<pre><code class=\"yaml\">        rrset-cache-size: 8G     # \u0417\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0441 \u043f\u0440\u043e\u0434\u0430\u043a\u0448\u0435\u043d \u0441\u0435\u0440\u0432\u0435\u0440\u0430         rrset-cache-slabs: 1024  # \u041d\u0430\u0447\u043d\u0451\u043c \u0441 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u0439 \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0430\u0446\u0438\u0438. \u041f\u0440\u0438 \u0442\u0430\u043a\u043e\u0439 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0435                                  # \u043d\u0435 \u0434\u043e\u043b\u0436\u043d\u043e \u0431\u044b\u0442\u044c \u0431\u043e\u043b\u044c\u0448\u0435 20\u043a \u0437\u0430\u043f\u0438\u0441\u0435\u0439 \u043d\u0430 \u043e\u0434\u0438\u043d BIN \u0432 \u0445\u0443\u0434\u0448\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435<\/code><\/pre>\n<p>\u0417\u0430\u043b\u043f 1Krps -> 2Krps \u0438 \u0431\u0443\u043a\u0432\u0430\u043b\u044c\u043d\u043e \u0441\u0440\u0430\u0437\u0443 Unbound \u0432\u0441\u0435\u043c\u0438 \u0442\u0440\u0435\u0434\u0430\u043c\u0438 \u0432\u0438\u0441\u0438\u0442 \u043d\u0430 \u0436\u0433\u0443\u0447\u0435\u043c pthread_spin_lock, \u0433\u0440\u0430\u0444\u0438\u043a\u0438 \u0432 netdata \u043f\u0440\u043e\u043f\u0430\u0434\u0430\u044e\u0442, \u0438 \u0432\u0441\u0435 \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u0442\u0430\u0439\u043c\u0430\u0443\u0442\u044f\u0442\u0441\u044f. \u0416\u0434\u0451\u043c \u0438 \u0430\u0442\u0442\u0430\u0447\u0438\u043c <code>gdb<\/code>.<\/p>\n<pre><code class=\"bash\">gdb \/usr\/sbin\/unbound -ex \"attach $(pidof unbound)\" ... (gdb) info threads ...   102  Thread 0x7f6eb6b76700 (LWP 437165) 0x00007f6f03aebd15 in pthread_spin_lock () from \/lib\/x86_64-linux-gnu\/libpthread.so.0   103  Thread 0x7f6eb6375700 (LWP 437166) 0x00007f6f03aebd15 in pthread_spin_lock () from \/lib\/x86_64-linux-gnu\/libpthread.so.0 * 104  Thread 0x7f6eb5b74700 (LWP 437167) 0x0000000002fd6830 in query_dname_compare (d1=0x4481e3ef1171 \"npkbVZViNbVBWAUr\\005alpha\\002tt\\006yandex\\003net\", d2=0x4483f5420eb1 \"vGRcmudYeYHJMVSA\\005alpha\\002tt\\006yandex\\003net\") at \/-S\/contrib\/tools\/unbound\/util\/data\/dname.c:101   105  Thread 0x7f6eb5373700 (LWP 437168) 0x00007f6f03aebd15 in pthread_spin_lock () from \/lib\/x86_64-linux-gnu\/libpthread.so.0   106  Thread 0x7f6eb4b72700 (LWP 437169) 0x00007f6f03aebd12 in pthread_spin_lock () from \/lib\/x86_64-linux-gnu\/libpthread.so.0 ...<\/code><\/pre>\n<p>\u0417\u0430\u0439\u0434\u0451\u043c \u0432 104 \u0442\u0440\u0435\u0434 \u0438 \u043f\u043e\u0441\u0447\u0438\u0442\u0430\u0435\u043c \u0434\u043b\u0438\u043d\u0443 \u0431\u0438\u043d\u0430 \u0432\u043e\u0442 \u0442\u0430\u043a\u0438\u043c \u0441\u043a\u0440\u0438\u043f\u0442\u043e\u043c, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043e\u0447\u0435\u043d\u044c \u043f\u043e\u0445\u043e\u0436 \u043d\u0430 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0438\u0439 gdb_traverse.py.<\/p>\n<pre><code class=\"python\">import gdb   class ListCounter(gdb.Command): \"\"\"Prints the ListNode from our example in a nice format!\"\"\"  def __init__(self):     super(ListCounter, self).__init__(\"listcount\", gdb.COMMAND_USER)  def invoke(self, args, from_tty):     # You can pass args here so this routine could actually evaluate different     # variables at runtime     print(\"Args Passed: %r\" % args)      # Let's walk through the list starting with the head     #     # We can access value info by looking at:     #  https:\/\/sourceware.org\/gdb\/onlinedocs\/gdb\/Values-From-Inferior.html#Values-From-Inferior     ref, next_elem_field_name = args.split()     next_elem = gdb.parse_and_eval(ref)      count = 0     while next_elem != 0:         count += 1         next_elem = next_elem[next_elem_field_name]     print(count)   ListCounter()<\/code><\/pre>\n<p>\u041f\u043e\u0434\u0442\u0432\u0435\u0440\u0436\u0434\u0430\u0435\u043c \u0435\u0449\u0451 \u0440\u0430\u0437 \u043f\u0440\u0435\u0434\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u0435, \u0447\u0442\u043e \u0434\u0435\u043b\u043e \u0432 \u0431\u043e\u043b\u044c\u0448\u0438\u0445 <code>linked-list<\/code> \u0443 \u0431\u0438\u043d\u043e\u0432.<\/p>\n<pre><code class=\"bash\">(gdb) bt #0  0x0000000002fd6830 in query_dname_compare (d1=0x4481e3ef1171 \"npkbVZViNbVBWAUr\\005alpha\\002tt\\006yandex\\003net\", d2=0x4483f5420eb1 \"vGRcmudYeYHJMVSA\\005alpha\\002tt\\006yandex\\003net\") at \/-S\/contrib\/tools\/unbound\/util\/data\/dname.c:101 #1  0x0000000002fdfa48 in ub_rrset_compare (k1=0x4481cb32cf70, k2=0x4482ffee5830) at \/-S\/contrib\/tools\/unbound\/util\/data\/packed_rrset.c:112 #2  0x0000000002fef50d in bin_find_entry (table=0x447f7fb66f00, bin=&lt;optimized out>, hash=3008119653, key=0x4482ffee5830) at \/-S\/contrib\/tools\/unbound\/util\/storage\/lruhash.c:223 #3  lruhash_insert (table=0x447f7fb66f00, hash=hash@entry=3008119653, entry=entry@entry=0x4482ffee5830, data=0x4481be1bc590, cb_arg=cb_arg@entry=0x447f486a2888) at \/-S\/contrib\/tools\/unbound\/util\/storage\/lruhash.c:320 #4  0x0000000002ff0d8e in slabhash_insert (sl=sl@entry=0x447f7f1a68c0, hash=4114747056, hash@entry=3008119653, entry=0x4483f5420ec1, entry@entry=0x4482ffee5830, data=0x4481be1bc590, arg=arg@entry=0x447f486a2888) at \/-S\/contrib\/tools\/unbound\/util\/storage\/slabhash.c:119 #5  0x0000000002f84685 in rrset_cache_update (r=0x447f7f1a68c0, ref=ref@entry=0x7f6eb5b71d60, alloc=0x447f486a2888, timenow=1671175065) at \/-S\/contrib\/tools\/unbound\/services\/cache\/rrset.c:227 (gdb) up 3 #3  lruhash_insert (table=0x447f7fb66f00, hash=hash@entry=3008119653, entry=entry@entry=0x4482ffee5830, data=0x4481be1bc590, cb_arg=cb_arg@entry=0x447f486a2888) at \/-S\/contrib\/tools\/unbound\/util\/storage\/lruhash.c:320 320    \/-S\/contrib\/tools\/unbound\/util\/storage\/lruhash.c: No such file or directory.<\/code><\/pre>\n<p>\u041a\u043e\u043c\u0430\u043d\u0434\u0430 <code>list<\/code>, \u043a \u0441\u043e\u0436\u0430\u043b\u0435\u043d\u0438\u044e, \u0442\u0443\u0442 \u043d\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043e\u0431\u0440\u0430\u0442\u0438\u043c\u0441\u044f \u043a \u043a\u043e\u0434\u0443.<\/p>\n<pre><code class=\"cpp\">       23 void        22 lruhash_insert(struct lruhash* table, hashvalue_type hash,        21 \u250a \u250a \u250a \u250a struct lruhash_entry* entry, void* data, void* cb_arg)        20 { ...         6 \u250a bin = &amp;table->array[hash &amp; table->size_mask];\/\/ &lt;&lt;&lt;&lt;&lt; \u0418\u043d\u0442\u0435\u0440\u0435\u0441\u0435\u043d \u044d\u0442\u043e\u0442 \u043e\u0431\u044a\u0435\u043a\u0442         5 \u250a lock_quick_lock(&amp;bin->lock);         4 \u250a         3 \u250a \/* see if entry exists already *\/         2 \u250a if(!(found=bin_find_entry(table, bin, hash, entry->key))) {  &lt;- (key: )         1 \u250a \u250a \/* if not: add to bin *\/    322    \u250a \u250a entry->overflow_next = bin->overflow_list;         1 \u250a \u250a bin->overflow_list = entry; ...        31 }<\/code><\/pre>\n<p>\u0414\u0430\u043b\u044c\u0448\u0435 \u043f\u043e\u043d\u044f\u0442\u043d\u043e, \u0447\u0442\u043e \u043d\u0443\u0436\u043d\u043e \u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0432 \u0431\u0438\u043d.<\/p>\n<pre><code class=\"bash\">(gdb) p bin $13 = &lt;optimized out>                           # &lt;&lt;&lt;&lt; \u0431\u044b\u0432\u0430\u0435\u0442... (gdb) p &amp;table->array[hash &amp; table->size_mask]  # \u043c\u043e\u0436\u043d\u043e \u0438 \u0432\u043e\u0442 \u0442\u0430\u043a \u043f\u043e\u0434\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c $14 = (struct lruhash_bin *) 0x4484b4ec3650 (gdb) p *$14 $15 = {lock = 0, overflow_list = 0x4482ffef7b00} (gdb) listcount $14->overflow_list overflow_next Args Passed: u'$14->overflow_list overflow_next' 29413                                           # \u0432\u0435\u0441\u044c \u0441\u043b\u0430\u0431 \u0432 \u043e\u0434\u043d\u043e\u043c \u0431\u0438\u043d\u0435!<\/code><\/pre>\n<p>\u042f \u0445\u043e\u0442\u0435\u043b \u0438\u0437\u043c\u0435\u0440\u0438\u0442\u044c, \u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043d\u0430 \u0442\u0430\u043a\u0438\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u044f\u0445 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 <code>bin_find_entry<\/code>, \u043d\u043e \u0441\u0442\u043e\u043b\u043a\u043d\u0443\u043b\u0441\u044f \u0441 \u0442\u0435\u043c, \u0447\u0442\u043e, \u0441\u0443\u0434\u044f \u043f\u043e \u0432\u0441\u0435\u043c\u0443, \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 \u0437\u0430\u0438\u043d\u043b\u0430\u0439\u043d\u0438\u043b\u00a0 <code>bin_find_entry<\/code> (\u0432\u0441\u0442\u0430\u0432\u0438\u043b \u0442\u0435\u043b\u043e \u044d\u0442\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0432 \u0434\u0440\u0443\u0433\u0438\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438), \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e bpftrace \u0435\u0451 \u043d\u0435 \u043b\u043e\u0432\u0438\u0442. \u0417\u0430\u043c\u0435\u0440\u044f\u0442\u044c \u0432\u0440\u0435\u043c\u044f \u0440\u0430\u0431\u043e\u0442\u044b <code>lruhash_insert<\/code> \u0443\u0436\u0435 \u043d\u0435\u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u0432 \u043d\u0435\u0439 \u043d\u0430\u0445\u043e\u0434\u044f\u0442\u0441\u044f \u043b\u043e\u043a\u0438. \u041e\u0441\u0442\u0430\u0451\u0442\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u0441\u0430\u043c\u043e\u043f\u0438\u0441\u043d\u044b\u0439 strcmp, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f <code>query_dname_compare<\/code> (\u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0432\u043d\u0443\u0442\u0440\u0438 <code>bin_find_entry<\/code> \u0434\u043e 29413). \u0411\u0443\u0434\u0435\u043c \u0431\u0440\u0430\u0442\u044c \u0445\u0443\u0434\u0448\u0438\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442 \u0434\u043b\u044f \u0440\u0430\u0441\u0447\u0451\u0442\u043e\u0432.<\/p>\n<pre><code class=\"bash\">ns-load.name:~$ sudo bpftrace -e 'uprobe:\/usr\/sbin\/unbound:query_dname_compare { @start[tid] = nsecs; } uretprobe:\/usr\/sbin\/unbound:query_dname_compare \/@start[tid]\/ { @ns[pid] = hist((nsecs - @start[tid]) \/ 1e3); delete(@start[tid]); }' Attaching 2 probes... ^C  @ns[4001695]: [1]           9762689 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@| [2, 4)         147486 |                                                | [4, 8)          15356 |                                                | [8, 16)          2325 |                                                | [16, 32)          163 |                                                | [32, 64)           12 |                                                | [64, 128)           6 |                                                | [128, 256)          1 |                                                |    `- \u043c\u0438\u043a\u0440\u043e\u0441\u0435\u043a\u0443\u043d\u0434\u044b.  @start[4003804]: 2159892851713379<\/code><\/pre>\n<p>\u0412 \u0438\u0442\u043e\u0433\u0435, \u0435\u0441\u043b\u0438 \u0431\u044b \u043c\u043d\u0435 \u0443\u0434\u0430\u043b\u043e\u0441\u044c \u0438\u0437\u043c\u0435\u0440\u0438\u0442\u044c <code>bin_find_entry<\/code>, \u043c\u043e\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u0431\u044b \u0443\u0432\u0438\u0434\u0435\u0442\u044c \u0447\u0442\u043e-\u0442\u043e \u043f\u043e\u0445\u043e\u0436\u0435\u0435:<\/p>\n<pre><code>29413(ENTRY per BIN) * 4us(per query_dname_compare) = 118 ms<\/code><\/pre>\n<p>\u042d\u0442\u043e \u043d\u0435 \u0438\u0434\u0451\u0442 \u043d\u0438 \u0432 \u043a\u0430\u043a\u043e\u0435 \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0435 \u0441 \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u043e\u0432\u0430\u043d\u043d\u044b\u043c \u0432\u0440\u0435\u043c\u0435\u043d\u0435\u043c \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 \u043f\u043e\u0434 <code>spinlock: 1\u20142us<\/code> (\u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u0440\u0430\u0432\u043d\u043e \u043f\u0435\u0440\u0435\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044e \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u043e\u0432 \u0432 \u044f\u0434\u0440\u0435).<\/p>\n<p>\u041f\u043e\u043a\u0430 \u0442\u0440\u0435\u0434 \u0436\u0436\u0451\u0442 CPU \u043d\u0430 spinlock, \u0448\u0435\u0434\u0443\u043b\u0435\u0440 \u044f\u0434\u0440\u0430 Linux \u043c\u043e\u0436\u0435\u0442 \u043f\u0440\u043e\u0441\u0442\u043e \u0432\u044b\u0442\u0435\u0441\u043d\u0438\u0442\u044c \u0442\u0440\u0435\u0434, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0437\u0430\u043d\u0438\u043c\u0430\u0435\u0442\u0441\u044f bin_find_entry. \u0418 \u0442\u0443\u0442 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u043c\u0430\u043b\u0435\u043d\u044c\u043a\u0438\u0439 \u043a\u043e\u043b\u043b\u0430\u043f\u0441&#8230;<\/p>\n<details class=\"spoiler\">\n<summary>\u0414\u043b\u044f \u0442\u0435\u0445, \u043a\u0442\u043e \u043b\u044e\u0431\u0438\u0442 \u0445\u0430\u0440\u0434\u043a\u043e\u0440, \u043f\u043e\u0434 \u043a\u0430\u0442\u043e\u043c \u0435\u0441\u0442\u044c \u0441\u043f\u043e\u0441\u043e\u0431 \u0437\u0430\u043c\u0435\u0440\u0438\u0442\u044c bin_find_entry<\/summary>\n<div class=\"spoiler__content\">\n<p>\u041f\u043e\u0437\u0436\u0435 \u044f \u043f\u043e\u043d\u044f\u043b, \u043a\u0430\u043a \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e \u0437\u0430\u043c\u0435\u0440\u044f\u0442\u044c \u0432\u0440\u0435\u043c\u044f \u0440\u0430\u0431\u043e\u0442\u044b <code>bin_find_entry<\/code>\u0438\u0437 <a href=\"https:\/\/github.com\/iovisor\/bpftrace\/blob\/master\/docs\/reference_guide.md#3-uprobeuretprobe-dynamic-tracing-user-level\"><u>reference_guide.md bpftrace<\/u><\/a>. \u041a\u0443\u0441\u043e\u043a \u0437\u0430\u0438\u043d\u043b\u0430\u0439\u043d\u0435\u043d\u043d\u043e\u0433\u043e \u043a\u043e\u0434\u0430 \u043c\u043e\u0436\u043d\u043e \u0438\u0437\u043c\u0435\u0440\u044f\u0442\u044c \u043f\u043e \u0441\u043c\u0435\u0449\u0435\u043d\u0438\u044e \u0432 \u0431\u0438\u043d\u0430\u0440\u043d\u0438\u043a\u0435 \u2014 \u0433\u043b\u0430\u0432\u043d\u043e\u0435, \u0447\u0442\u043e\u0431\u044b \u0441\u043c\u0435\u0449\u0435\u043d\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0432\u044b \u043d\u0430\u0448\u043b\u0438 \u0432 \u0431\u0438\u043d\u0430\u0440\u043d\u0438\u043a\u0435, \u0438 \u0431\u0438\u043d\u0430\u0440\u043d\u0438\u043a, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432\u044b \u0437\u0430\u043c\u0435\u0440\u044f\u0435\u0442\u0435 \u043d\u0430 \u043f\u0440\u043e\u0434\u0435\/\u043b\u043e\u0430\u0434\u0435, \u0431\u044b\u043b\u0438 \u043e\u0434\u043d\u0438\u043c\u0438 \u0438 \u0442\u0435\u043c\u0438 \u0436\u0435.<\/p>\n<p>\u041f\u0440\u0438\u0432\u0435\u0434\u0443 \u043f\u0440\u0438\u043c\u0435\u0440, \u043a\u0430\u043a \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0439\u0442\u0438 \u043d\u0443\u0436\u043d\u044b\u0435 \u0441\u043c\u0435\u0449\u0435\u043d\u0438\u044f.<\/p>\n<pre><code class=\"bash\">gdb unbound (gdb) disassemble \/s lruhash_insert  # \u0421\u043e\u043a\u0440\u0430\u0449\u0451\u043d\u043d\u044b\u0439 \u0432\u044b\u0432\u043e\u0434 disassemble \/s lruhash_insert  Dump of assembler code for function lruhash_insert: \/-S\/contrib\/tools\/unbound\/util\/storage\/lruhash.c: 302    {    0x0000000003123f4b &lt;+443>:    mov0x10(%rsp),%rcx ... 317    lock_quick_lock(&amp;bin->lock);    0x0000000003123e63 &lt;+211>:    shl$0x4,%rbp    0x0000000003123e67 &lt;+215>:    lea(%r15,%rbp,1),%rdi    0x0000000003123e6b &lt;+219>:    mov%rdi,0x18(%rsp)    0x0000000003123e70 &lt;+224>:    callq  0x41e53c0 &lt;pthread_spin_lock@plt>    0x0000000003123e75 &lt;+229>:    test   %eax,%eax    0x0000000003123e77 &lt;+231>:    je 0x3123e99 &lt;lruhash_insert+265>    0x0000000003123e79 &lt;+233>:    mov%eax,%edi ... 221    struct lruhash_entry* p = bin->overflow_list;    0x0000000003123e99 &lt;+265>:    lea(%r15,%rbp,1),%rax    0x0000000003123e9d &lt;+269>:    add$0x8,%rax    0x0000000003123ea1 &lt;+273>:    mov%rax,0x10(%rsp)    0x0000000003123ea6 &lt;+278>:    mov0x8(%r15,%rbp,1),%r12  222    while(p) {    0x0000000003123eab &lt;+283>:    test   %r12,%r12    0x0000000003123eae &lt;+286>:    je 0x3123f5a &lt;lruhash_insert+458> ... 330    (*table->sizefunc)(found->key, found->data);    0x0000000003123ef1 &lt;+353>:    mov0x58(%r12),%rdi    0x0000000003123ef6 &lt;+358>:    mov0x60(%r12),%rsi    0x0000000003123efb &lt;+363>:    callq  *0x8(%r13)    0x0000000003123eff &lt;+367>:    mov0x20(%rsp),%rcx  329    table->space_used += need_size -    0x0000000003123f04 &lt;+372>:    sub%rax,%rcx    0x0000000003123f07 &lt;+375>:    add%rcx,0x68(%r13)    0x0000000003123f0b &lt;+379>:    mov0x8(%rsp),%rax ... # \u041d\u0435\u0442, \u0442\u0443\u0442 \u044f \u043d\u0435 \u043f\u0435\u0440\u0435\u043f\u0443\u0442\u0430\u043b \u043b\u0438\u0441\u0442\u0438\u043d\u0433, \u044d\u0442\u043e \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 \u043f\u0435\u0440\u0435\u0432\u0435\u0440\u043d\u0443\u043b \u0443\u0441\u043b\u043e\u0432\u0438\u0435 # \u0438 \u043f\u043e\u0441\u0447\u0438\u0442\u0430\u043b, \u0447\u0442\u043e \u043f\u043e execution path \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u0435\u0435 \u0432\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u043f\u0435\u0440\u0432\u044b\u043c else, \u0430 \u0437\u0430\u0442\u0435\u043c \u0443\u0436\u0435 if  318      319    \/* see if entry exists already *\/ 320    if(!(found=bin_find_entry(table, bin, hash, entry->key))) { 321    \/* if not: add to bin *\/ 322    entry->overflow_next = bin->overflow_list;    0x0000000003123f50 &lt;+448>:    mov(%rcx),%rax    0x0000000003123f53 &lt;+451>:    mov0x8(%rsp),%rsi    0x0000000003123f58 &lt;+456>:    jmp0x3123f6b &lt;lruhash_insert+475>    0x0000000003123f5a &lt;+458>:    xor%eax,%eax    0x0000000003123f5c &lt;+460>:    mov0x18(%rsp),%rbp    0x0000000003123f61 &lt;+465>:    mov0x8(%rsp),%rsi    0x0000000003123f66 &lt;+470>:    mov0x10(%rsp),%rcx    0x0000000003123f6b &lt;+475>:    mov%rax,0x38(%rsi)  323    bin->overflow_list = entry;    0x0000000003123f6f &lt;+479>:    mov%rsi,(%rcx) ... 347    struct lruhash_entry* n = reclaimlist->overflow_next;    0x0000000003124040 &lt;+688>:    mov0x38(%rax),%rbx  349    (*table->delkeyfunc)(reclaimlist->key, cb_arg);    0x0000000003124044 &lt;+692>:    mov0x58(%rax),%rdi<\/code><\/pre>\n<p>\u0418\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e, \u0447\u0442\u043e \u0436\u0435 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0432\u043d\u0443\u0442\u0440\u0438 <code>bin_find_entry<\/code> \u0438 <code>lruhash_insert<\/code>. \u0417\u0434\u0435\u0441\u044c \u044f \u0440\u0435\u0448\u0438\u043b \u0437\u0430\u043c\u0435\u0440\u0438\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u0434\u043b\u044f \u0432\u0441\u0442\u0430\u0432\u043a\u0438: \u044d\u0442\u043e \u0431\u0443\u0434\u0435\u0442 \u043d\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u044b\u043c \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u0435\u043c, \u0434\u0430\u0436\u0435 \u043d\u0435\u0441\u043c\u043e\u0442\u0440\u044f \u043d\u0430 \u0442\u043e, \u0447\u0442\u043e <code>lruhash_lookup<\/code> \u043d\u0430\u043c\u043d\u043e\u0433\u043e \u0433\u043e\u0440\u044f\u0447\u0435\u0435.<\/p>\n<p>\u041b\u0438\u0441\u0442\u0438\u043d\u0433 <code>bin_find_entry<\/code>:<\/p>\n<pre><code class=\"cpp\">(gdb) list bin_find_entry 217    struct lruhash_entry* 218    bin_find_entry(struct lruhash* table, 219    struct lruhash_bin* bin, hashvalue_type hash, void* key) 220    { 221    struct lruhash_entry* p = bin->overflow_list; 222    while(p) { 223    if(p->hash == hash &amp;&amp; table->compfunc(p->key, key) == 0) 224    return p; 225    p = p->overflow_next; 226    } 227    return NULL;<\/code><\/pre>\n<p>\u041b\u0438\u0441\u0442\u0438\u043d\u0433 <code>lruhash_insert<\/code>:<\/p>\n<pre><code class=\"cpp\">(gdb) list lruhash_insert 297    } 298     299    void 300    lruhash_insert(struct lruhash* table, hashvalue_type hash, 301        struct lruhash_entry* entry, void* data, void* cb_arg) 302    { 303    struct lruhash_bin* bin; 304    struct lruhash_entry* found, *reclaimlist=NULL; 305    size_t need_size; 306    fptr_ok(fptr_whitelist_hash_sizefunc(table->sizefunc)); 307    fptr_ok(fptr_whitelist_hash_delkeyfunc(table->delkeyfunc)); 308    fptr_ok(fptr_whitelist_hash_deldatafunc(table->deldatafunc)); 309    fptr_ok(fptr_whitelist_hash_compfunc(table->compfunc)); 310    fptr_ok(fptr_whitelist_hash_markdelfunc(table->markdelfunc)); 311    need_size = table->sizefunc(entry->key, data); 312    if(cb_arg == NULL) cb_arg = table->cb_arg; 313     314    \/* find bin *\/ 315    lock_quick_lock(&amp;table->lock); 316    bin = &amp;table->array[hash &amp; table->size_mask]; 317    lock_quick_lock(&amp;bin->lock); 318     319    \/* see if entry exists already *\/ 320    if(!(found=bin_find_entry(table, bin, hash, entry->key))) { 321    \/* if not: add to bin *\/ 322    entry->overflow_next = bin->overflow_list; 323    bin->overflow_list = entry; 324    lru_front(table, entry); 325    table->num++; 326    table->space_used += need_size; 327    } else { 328    \/* if so: update data - needs a writelock *\/ 329    table->space_used += need_size - 330    (*table->sizefunc)(found->key, found->data); 331    (*table->delkeyfunc)(entry->key, cb_arg); 332    lru_touch(table, found); 333    lock_rw_wrlock(&amp;found->lock); 334    (*table->deldatafunc)(found->data, cb_arg); 335    found->data = data; 336    lock_rw_unlock(&amp;found->lock); 337    } 338    lock_quick_unlock(&amp;bin->lock); 339    if(table->space_used > table->space_max) 340    reclaim_space(table, &amp;reclaimlist); 341    if(table->num >= table->size) 342    table_grow(table); 343    lock_quick_unlock(&amp;table->lock); 344     345    \/* finish reclaim if any (outside of critical region) *\/ 346    while(reclaimlist) { 347    struct lruhash_entry* n = reclaimlist->overflow_next; 348    void* d = reclaimlist->data; 349    (*table->delkeyfunc)(reclaimlist->key, cb_arg); 350    (*table->deldatafunc)(d, cb_arg); 351    reclaimlist = n; 352    } 353    }<\/code><\/pre>\n<p>\u041d\u0430\u043c \u043d\u0443\u0436\u043d\u044b \u0441\u043c\u0435\u0449\u0435\u043d\u0438\u044f \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u0441 221 \u0441\u0442\u0440\u043e\u043a\u0438, \u043a\u043e\u0433\u0434\u0430 \u043f\u043e\u0442\u043e\u043a \u0438\u0441\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0437\u0430\u0448\u0451\u043b \u0432 bin_find_entry. \u0418 \u0435\u0449\u0451 \u043b\u0438\u0431\u043e 322, \u043b\u0438\u0431\u043e 328 \u0438 329 \u0441\u0442\u0440\u043e\u043a\u0438, \u043a\u043e\u0433\u0434\u0430 \u043e\u043d \u043e\u0442\u0442\u0443\u0434\u0430 \u0432\u044b\u0448\u0435\u043b.<\/p>\n<pre><code class=\"assembly\">221    struct lruhash_entry* p = bin->overflow_list;    0x0000000003123e99 &lt;+265>:    lea(%r15,%rbp,1),%rax 322    entry->overflow_next = bin->overflow_list;    0x0000000003123f50 &lt;+448>:    mov(%rcx),%rax 329    table->space_used += need_size -    0x0000000003123f04 &lt;+372>:    sub%rax,%rcx<\/code><\/pre>\n<p>\u0411\u0435\u0440\u0451\u043c \u044d\u0442\u0438 \u0441\u043c\u0435\u0449\u0435\u043d\u0438\u044f \u0438 \u0441\u043e\u0437\u0434\u0430\u0451\u043c \u043d\u0435\u0441\u043b\u043e\u0436\u043d\u044b\u0439 bpftrace-\u0441\u043a\u0440\u0438\u043f\u0442. \u0414\u043b\u044f \u043f\u0440\u0438\u043c\u0435\u0440\u0430 \u044f \u0431\u0440\u0430\u043b \u0441\u043c\u0435\u0449\u0435\u043d\u0438\u044f \u043d\u0430 \u0442\u0435\u0441\u0442\u043e\u0432\u043e\u043c \u0431\u0438\u043d\u0430\u0440\u043d\u0438\u043a\u0435, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u0432 \u043f\u0440\u043e\u0434\u0430\u043a\u0448\u0435\u043d \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u0438 \u043d\u0435\u0442 \u0442\u0430\u043a\u0438\u0445 \u0443\u0434\u043e\u0431\u043d\u044b\u0445 \u043b\u0438\u0441\u0442\u0438\u043d\u0433\u043e\u0432. \u0417\u0430\u043f\u0443\u0441\u0442\u0438\u043c \u0442\u0435\u0441\u0442 \u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u043c \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442.<\/p>\n<pre><code class=\"bash\"># \u0434\u043b\u044f \u0431\u0438\u043d\u0430\u0440\u043d\u0438\u043a\u0430 \/usr\/sbin\/unbound-1.17.0-release-threaded-zone-write \u043d\u0430 ns-load # https:\/\/github.com\/NLnetLabs\/unbound\/blob\/6f7da59b7744c345be580db2bd9b37380cab5a42 # 0x00000000030ab735 - util\/storage\/lruhash.c#L221 # 0x00000000030ab7db - util\/storage\/lruhash.c#L330 # 0x00000000030ab796 - util\/storage\/lruhash.c#L322 ns-load.name:~$ sudo bpftrace -e ' uprobe:\/usr\/sbin\/unbound:0x00000000030ab735 { @start[tid] = nsecs; } uprobe:\/usr\/sbin\/unbound:0x00000000030ab7db \/@start[tid]\/ { @ns[pid] = hist((nsecs - @start[tid]) ); delete(@start[tid]); } uprobe:\/usr\/sbin\/unbound:0x00000000030ab796 \/@start[tid]\/ { @ns[pid] = hist((nsecs - @start[tid])); delete(@start[tid]); }' Attaching 3 probes... ^C  @ns[1494524]: [1K, 2K)           878 |                                                | [2K, 4K)       3670780 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@                   | [4K, 8K)        809724 |@@@@@@                                          | [8K, 16K)      6450716 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@| [16K, 32K)      527853 |@@@@                                            | [32K, 64K)       39081 |                                                | [64K, 128K)       1852 |                                                | [128K, 256K)       100 |                                                | [256K, 512K)         7 |                                                |<\/code><\/pre>\n<p>\u0418 \u044d\u0442\u043e \u0434\u043b\u044f \u0437\u0430\u0442\u044e\u043d\u0435\u043d\u043d\u043e\u0433\u043e <code>rrset-cache-size: 8G \/ rrset-cache-slabs: 131072<\/code> \u2014 \u0442\u043e \u0435\u0441\u0442\u044c \u0432\u0441\u0435\u0433\u043e \u0442\u0435\u0441\u0442\u0430! \u0418 <code>rrset<\/code> \u0442\u0443\u0442 \u0432\u044b\u0440\u043e\u0441 \u0432\u0441\u0435\u0433\u043e \u0432\u043e\u0442 \u043d\u0430\u0441\u0442\u043e\u043b\u044c\u043a\u043e:<\/p>\n<pre><code class=\"bash\">ns-load.name:~$ sudo  gdb \/usr\/sbin\/unbound -ex \"attach $(pidof unbound)\" ... (gdb) up 17 #7  0x0000000002274f00 in daemon_fork (daemon=daemon@entry=0x1745bf340000) at \/-S\/contrib\/tools\/unbound\/daemon\/daemon.c:789 789    \/-S\/contrib\/tools\/unbound\/daemon\/daemon.c: No such file or directory. (gdb) source \/home\/skacheev\/gdb_traverse.py (gdb) walklist &amp;daemon->env->rrset_cache.table silent Args Passed: &amp;daemon->env->rrset_cache.table silent slab_size=131072 Found total-max bin.length 210, total=326 nodes<\/code><\/pre>\n<p>\u0410 \u044d\u0442\u043e \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0430 \u0434\u043b\u044f <code>rrset-cache-slabs: 32<\/code>. \u041f\u043e \u043f\u043e\u043d\u044f\u0442\u043d\u044b\u043c \u043f\u0440\u0438\u0447\u0438\u043d\u0430\u043c \u0437\u0434\u0435\u0441\u044c \u043d\u0435 \u0432\u0435\u0441\u044c \u0442\u0435\u0441\u0442 \u2014 \u044f \u043d\u0435 \u0441\u043c\u043e\u0433 \u0434\u043e\u0436\u0434\u0430\u0442\u044c\u0441\u044f \u043e\u0442\u043b\u0438\u043f\u0430\u043d\u0438\u044f Unbound, \u043e\u043d \u043f\u0440\u043e\u0441\u0442\u043e \u0435\u043b, \u0435\u043b \u0438 \u0435\u043b 100% CPU.<\/p>\n<pre><code class=\"bash\">ns-load.name:~$ sudo bpftrace -e ' uprobe:\/usr\/sbin\/unbound:0x00000000030ab735 { @start[tid] = nsecs; } uprobe:\/usr\/sbin\/unbound:0x00000000030ab7db \/@start[tid]\/ { @ns[pid] = hist((nsecs - @start[tid]) ); delete(@start[tid]); } uprobe:\/usr\/sbin\/unbound:0x00000000030ab796 \/@start[tid]\/ { @ns[pid] = hist((nsecs - @start[tid])); delete(@start[tid]); }' Attaching 3 probes... ^C  @ns[1341345]: [2K, 4K)         2476 |@@@@                                            | [4K, 8K)         3057 |@@@@@                                           | [8K, 16K)         251 |                                                | [16K, 32K)        576 |@                                               | [32K, 64K)        911 |@                                               | [64K, 128K)      2030 |@@@                                             | [128K, 256K)     4050 |@@@@@@@                                         | [256K, 512K)     5657 |@@@@@@@@@@                                      | [512K, 1M)      13731 |@@@@@@@@@@@@@@@@@@@@@@@@@@                      | [1M, 2M)        26856 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@  | [2M, 4M)        21600 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@       | [4M, 8M)          596 |@                                               | [8M, 16M)         245 |                                                |  # K - \u043c\u0438\u043a\u0440\u043e\u0441\u0435\u043a\u0443\u043d\u0434\u044b M - \u043c\u0438\u043b\u043b\u0438\u0441\u0435\u043a\u0443\u043d\u0434\u044b<\/code><\/pre>\n<p>\u0418 \u0435\u0441\u043b\u0438 \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u0442\u0435\u0441\u0442 \u0438 \u0447\u0443\u0442\u044c-\u0447\u0443\u0442\u044c \u043f\u043e\u0434\u043e\u0436\u0434\u0430\u0442\u044c \u043c\u043e\u043c\u0435\u043d\u0442\u0430, \u043a\u043e\u0433\u0434\u0430 Unbound \u043d\u0430\u0447\u043d\u0451\u0442 \u0432\u044b\u0445\u043e\u0434\u0438\u0442\u044c \u0438\u0437 100% CPU-\u0441\u0442\u0443\u043f\u043e\u0440\u0430, \u0430 <code>linked-list<\/code> \u0432\u044b\u0440\u0430\u0441\u0442\u0435\u0442 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0441\u0438\u043b\u044c\u043d\u043e, \u0442\u043e \u043c\u043e\u0436\u043d\u043e \u0443\u0436\u0430\u0441\u043d\u0443\u0442\u044c\u0441\u044f! \u0422\u043e\u043f \u0432\u0440\u0435\u043c\u0451\u043d \u0432\u0441\u0442\u0430\u0432\u043a\u0438 \u0432 <code>lruhash_bin<\/code> \u043f\u043e\u0441\u0442\u0435\u043f\u0435\u043d\u043d\u043e \u043f\u043e\u043b\u0437\u0451\u0442 \u0432\u043d\u0438\u0437 \u0434\u043e 32 \u043c\u0438\u043b\u043b\u0438\u0441\u0435\u043a\u0443\u043d\u0434 \u0438 \u044d\u0442\u043e, \u043a\u043e\u043d\u0435\u0447\u043d\u043e, \u043d\u0435 \u043f\u0440\u0435\u0434\u0435\u043b.<\/p>\n<pre><code class=\"bash\">ns-load.name:~$ sudo bpftrace -e ' uprobe:\/usr\/sbin\/unbound:0x00000000030ab735 { @start[tid] = nsecs; } uprobe:\/usr\/sbin\/unbound:0x00000000030ab7db \/@start[tid]\/ { @ns[pid] = hist((nsecs - @start[tid]) ); delete(@start[tid]); } uprobe:\/usr\/sbin\/unbound:0x00000000030ab796 \/@start[tid]\/ { @ns[pid] = hist((nsecs - @start[tid])); delete(@start[tid]); }' Attaching 3 probes... ^C  @ns[1341345]: [2K, 4K)          46 |@                                               | [4K, 8K)        440 |@@@@@@@@@@@@@@@@                                | [8K, 16K)         12 |                                                | [16K, 32K)         1 |                                                | [32K, 64K)         0 |                                                | [64K, 128K)        0 |                                                | [128K, 256K)       0 |                                                | [256K, 512K)       0 |                                                | [512K, 1M)         0 |                                                | [1M, 2M)           0 |                                                | [2M, 4M)           0 |                                                | [4M, 8M)         412 |@@@@@@@@@@@@@@@                                 | [8M, 16M)       1364 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@| [16M, 32M)       330 |@@@@@@@@@@@@                                    |<\/code><\/pre>\n<p><code>rrset<\/code> \u0432\u044b\u0440\u043e\u0441 \u0434\u043e 135433 \u0437\u0430\u043f\u0438\u0441\u0435\u0439 \u0432 <code>lruhash_bin->linked-list<\/code>.<\/p>\n<pre><code class=\"bash\">(gdb) walklist &amp;daemon->env->rrset_cache.table ... slab-14 max bin(247101).length 135433 count 135436 ... Found total-max bin.length 135433, total=135529 nodes<\/code><\/pre>\n<\/p>\n<\/div>\n<\/details>\n<p>\u0412 \u0438\u0442\u043e\u0433\u0435 \u044f \u043f\u0440\u043e\u0432\u0451\u043b \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0438\u0442\u0435\u0440\u0430\u0446\u0438\u0439 \u043d\u0430\u0433\u0440\u0443\u0437\u043e\u0447\u043d\u043e\u0433\u043e \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0438 \u043f\u0440\u0438\u0448\u0451\u043b \u043a \u0442\u0430\u043a\u043e\u0439 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438:<\/p>\n<pre><code class=\"yaml\"> msg-cache-size: 4G  # \u042d\u0442\u043e \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043d\u0435 \u043e\u0447\u0435\u043d\u044c \u0432\u0430\u0436\u043d\u043e, \u043d\u043e \u0432\u0441\u0451 \u0440\u0430\u0432\u043d\u043e, \u0435\u0441\u043b\u0438 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043f\u0430\u043c\u044f\u0442\u044c \u043d\u0430 \u0441\u0442\u0430\u0440\u0442\u0435, \u0442\u043e \u0447\u0435\u043c \u0431\u043e\u043b\u044c\u0448\u0435 \u0442\u0435\u043c \u043b\u0443\u0447\u0448\u0435.  msg-cache-slabs: 512  rrset-cache-size: 8G  # \u0410 \u044d\u0442\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043e\u0447\u0435\u043d\u044c \u0432\u0430\u0436\u043d\u043e, \u0442\u0430\u043a \u043a\u0430\u043a \u0442\u0443\u0442 \u0435\u0441\u0442\u044c \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u0441 \u043f\u0443\u0445\u043d\u0443\u0449\u0438\u043c\u0438 linked-list \u0438\u0437 ENTRY  rrset-cache-slabs: 262144    # \u041f\u0440\u0438 \u0442\u0430\u043a\u0438\u0445 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430\u0445 \u0433\u0440\u0443\u0431\u043e 100 \u0437\u0430\u043f\u0438\u0441\u0435\u0439 \u043d\u0430 BIN<\/code><\/pre>\n<p>\u041d\u0430 \u0442\u0430\u043a\u0438\u0445 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430\u0445 Unbound \u0443\u0436\u0435 \u0434\u043e\u0436\u0438\u0432\u0430\u0435\u0442 \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u0434\u043e 50Krps \u2014 \u043d\u0430 \u0432\u0440\u0435\u043c\u044f \u043f\u043e\u0438\u0441\u043a\u0430 \u0431\u0430\u0433\u0430 \u044d\u0442\u043e\u0433\u043e \u0434\u043e\u043b\u0436\u043d\u043e \u0445\u0432\u0430\u0442\u0438\u0442\u044c.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/a1d\/28e\/64c\/a1d28e64c535b2915ac5af8ed9f76349.png\" alt=\"\" title=\"\" width=\"949\" height=\"747\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/a1d\/28e\/64c\/a1d28e64c535b2915ac5af8ed9f76349.png\"\/><\/figure>\n<h2>\u0425\u044d\u043f\u043f\u0438-\u044d\u043d\u0434: \u0438\u0441\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0431\u0430\u0433\u0430<\/h2>\n<p>\u041f\u043e\u0442\u043e\u043c \u0431\u044b\u043b\u0438 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0434\u043d\u0435\u0439 \u0438\u0437\u0443\u0447\u0435\u043d\u0438\u044f \u043a\u043e\u0434\u0430 \u0438 coredump. \u0412 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0435 \u0434\u0435\u0431\u0430\u0433\u0430, \u043a\u0430\u043a \u0432\u043e\u0434\u0438\u0442\u0441\u044f, \u0431\u044b\u043b\u0430 \u043f\u043e\u043f\u044b\u0442\u043a\u0430 \u0432\u043e\u0441\u043f\u0440\u043e\u0438\u0437\u0432\u0435\u0441\u0442\u0438 \u0431\u0430\u0433 \u043f\u043e \u043b\u043e\u0436\u043d\u043e\u043c\u0443 \u043f\u0440\u0435\u0434\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u044e. \u042d\u0442\u043e\u043c\u0443 \u043f\u043e\u0441\u043f\u043e\u0441\u043e\u0431\u0441\u0442\u0432\u043e\u0432\u0430\u043b\u043e \u043e\u0441\u043e\u0437\u043d\u0430\u043d\u0438\u0435 \u043f\u0440\u0438\u0447\u0438\u043d \u0441\u0442\u0440\u0430\u043d\u043d\u043e\u0433\u043e \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u044f <code>lruhash<\/code> \u0438 \u0444\u0438\u043a\u0441 \u0441 \u043f\u0435\u0440\u0435\u0441\u0447\u0451\u0442\u043e\u043c \u0445\u044d\u0448\u0430 \u043d\u0435\u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u043f\u0435\u0440\u0435\u0434 \u0432\u0441\u0442\u0430\u0432\u043a\u043e\u0439 \u0432 <code>lruhash<\/code>. \u041d\u043e \u044d\u0442\u043e\u0442 \u0444\u0438\u043a\u0441 \u043d\u0435 \u0431\u044b\u043b \u043d\u0430\u0441\u0442\u043e\u044f\u0449\u0438\u043c \u0444\u0438\u043a\u0441\u043e\u043c, \u0430 \u0431\u044b\u043b \u0437\u0430\u043f\u043b\u0430\u0442\u043a\u043e\u0439 \u043d\u0430 \u0431\u0430\u0433, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0441\u043b\u0443\u0447\u0430\u0435\u0442\u0441\u044f \u0433\u0434\u0435-\u0442\u043e \u0440\u0430\u043d\u0435\u0435.<\/p>\n<p>\u0418 \u043f\u043e\u0441\u043b\u0435 \u0432\u0441\u0435\u0445 \u043d\u0435\u0443\u0434\u0430\u0447\u043d\u044b\u0445 \u043f\u043e\u043f\u044b\u0442\u043e\u043a \u0431\u044b\u0441\u0442\u0440\u043e \u043d\u0430\u0439\u0442\u0438 \u0431\u0430\u0433, \u044f \u043d\u0430\u0447\u0430\u043b \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u0431\u0438\u043d\u0430\u0440\u043d\u0438\u043a Unbound \u043f\u043e\u0434 gdb, \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c \u0432 \u043d\u0435\u0433\u043e \u043f\u043e \u043e\u0434\u043d\u043e\u043c\u0443 \u0437\u0430\u043f\u0440\u043e\u0441\u0443, \u0440\u0430\u0441\u0441\u0442\u0430\u0432\u043b\u044f\u0442\u044c \u043a\u0443\u0447\u0443 \u0431\u0440\u0435\u0439\u043a\u043f\u043e\u0438\u043d\u0442\u043e\u0432 \u0432 \u0440\u0430\u0437\u043d\u044b\u0445 \u043c\u0435\u0441\u0442\u0430\u0445 \u0438 \u043f\u0435\u0440\u0438\u043e\u0434\u0438\u0447\u0435\u0441\u043a\u0438 \u043f\u043e\u0448\u0430\u0433\u043e\u0432\u043e \u043f\u0440\u043e\u0445\u043e\u0434\u0438\u0442\u044c \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0443\u0447\u0430\u0441\u0442\u043a\u0438 \u043a\u043e\u0434\u0430.<\/p>\n<p>\u0421\u0430\u043c\u043e\u0439 \u043f\u043e\u043b\u0435\u0437\u043d\u043e\u0439 \u0444\u0438\u0447\u0435\u0439 \u0432 \u044d\u0442\u043e\u0442 \u043c\u043e\u043c\u0435\u043d\u0442 \u043e\u043a\u0430\u0437\u0430\u043b\u0438\u0441\u044c <code>conditional breakpoints<\/code> \u0438 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u0445 \u043a\u043e\u043c\u0430\u043d\u0434 \u0432 <code>gdb<\/code>. \u0414\u043b\u044f \u043f\u0440\u0438\u043c\u0435\u0440\u0430 \u043f\u043e\u043a\u0430\u0436\u0443 \u043a\u0443\u0441\u043e\u0447\u0435\u043a \u0438\u0437 \u0441\u0432\u043e\u0435\u0433\u043e <code>.gdbinit<\/code>.<\/p>\n<pre><code class=\"bash\">cat ~\/.gdbinit source listprint.py source gdb_traverse.py # ... define print_entry   p *(struct ub_packed_rrset_key*)entry->key   listprint entry->overflow_next overflow_next end  define print_cache  p iq->state  set $num = 0  p *iq->response.rep  while $num &lt; iq->response.rep.rrset_count    p *iq->response.rep.rrsets[$num]    set $num = $num + 1  end  p *iq->response.rep.ref[0].key  p *iq->response.rep.ref[1].key end   define set_breaks   br processQueryTargets thread 1   commands    print_cache   end  # ... - \u0442\u0443\u0442 \u0435\u0449\u0451 \u043a\u0443\u0447\u0430 \u0440\u0430\u0437\u043d\u044b\u0445 \u0442\u043e\u0447\u0435\u043a \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438    br lruhash_insert thread 1   commands     print_entrype     cont   end end<\/code><\/pre>\n<p>\u0415\u0449\u0451 \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u043f\u043e\u0438\u0441\u043a\u043e\u0432 \u0438 \u0444\u0438\u043a\u0441 \u0432 \u043e\u0434\u043d\u0443 \u0441\u0442\u0440\u043e\u043a\u0443, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0432\u043e\u0442 \u0442\u0430\u043a:<\/p>\n<pre><code class=\"diff\">diff --git a\/services\/authzone.c b\/services\/authzone.c index 6de1e431..ab4cedaa 100644 --- a\/services\/authzone.c +++ b\/services\/authzone.c @@ -2756,6 +2756,8 @@ az_change_dnames(struct dns_msg* msg, uint8_t* oldname, uint8_t* newname,   == 0) {   msg->rep->rrsets[i]->rk.dname = newname;   msg->rep->rrsets[i]->rk.dname_len = newlen; + \/\/ We MUST update the entry.hash due to the rk.dname change + msg->rep->rrsets[i]->entry.hash = rrset_key_hash(&amp;msg->rep->rrsets[i]->rk); }   }  }<\/code><\/pre>\n<p>\u0411\u0430\u0433 \u0437\u0430\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u043f\u0440\u0438 \u043e\u0442\u0432\u0435\u0442\u0435 \u043d\u0430 \u0437\u0430\u043f\u0440\u043e\u0441 <code>CNAME<\/code> \u0441\u043e \u0437\u0432\u0451\u0437\u0434\u043e\u0447\u043a\u043e\u0439 Unbound \u043f\u0435\u0440\u0435\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u0434\u0430\u043d\u043d\u044b\u0435 \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u0434\u043b\u044f \u0441\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u043e\u0442\u0432\u0435\u0442\u0430 \u0432 \u043a\u044d\u0448. \u0414\u0430\u043d\u043d\u044b\u0435 \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u043a\u043e\u043f\u0438\u0440\u0443\u044e\u0442\u0441\u044f \u0432 \u043e\u0442\u0432\u0435\u0442 \u0438 \u0432 \u043d\u0438\u0445 \u0437\u0430\u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f dname, \u043d\u043e \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u0430\u0432\u0442\u043e\u0440 \u044d\u0442\u043e\u0433\u043e \u043a\u043e\u0434\u0430 \u0437\u0430\u0431\u044b\u043b \u043e\u0431\u043d\u043e\u0432\u0438\u0442\u044c <code>entry.hash<\/code>. \u0414\u0430\u043b\u0435\u0435, \u043f\u043e\u043f\u0443\u0442\u0435\u0448\u0435\u0441\u0442\u0432\u043e\u0432\u0430\u0432 \u0432\u0435\u0441\u044c\u043c\u0430 \u0437\u0430\u043a\u043e\u0432\u044b\u0440\u0438\u0441\u0442\u044b\u043c\u0438 \u0443\u0447\u0430\u0441\u0442\u043a\u0430\u043c\u0438 \u043a\u043e\u0434\u0430, entry \u043f\u043e\u043f\u0430\u0434\u0430\u0435\u0442 \u0432 \u043a\u044d\u0448 \u0441 \u043f\u043b\u043e\u0445\u0438\u043c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435\u043c <code>entry.hash<\/code>, \u0447\u0442\u043e \u0438 \u043f\u0440\u0438\u0432\u043e\u0434\u0438\u0442 \u043a \u043f\u0435\u0440\u0435\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044e <code>bin->linked_list<\/code>. \u0412 hyperlocal zone \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 \u043a\u044d\u0448 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0434\u043b\u044f \u0443\u0441\u043a\u043e\u0440\u0435\u043d\u0438\u044f \u043e\u0442\u0432\u0435\u0442\u0430, \u0447\u0442\u043e\u0431\u044b \u043d\u0435 \u0441\u043f\u0443\u0441\u043a\u0430\u0442\u044c\u0441\u044f \u0432 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b auth-zone.<\/p>\n<p>\u042f \u043e\u0442\u043f\u0440\u0430\u0432\u0438\u043b \u0441\u0435\u043a\u044c\u044e\u0440\u0438\u0442\u0438-\u0440\u0435\u043f\u043e\u0440\u0442 \u0432 Unbound \u0441 \u0438\u0441\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435\u043c \u0431\u0430\u0433\u0430 \u0438 \u0435\u0433\u043e \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435\u043c. \u0424\u0438\u043a\u0441 \u043f\u043e\u043f\u0430\u043b \u0432\u00a0 <a href=\"https:\/\/github.com\/NLnetLabs\/unbound\/releases\/tag\/release-1.17.1\"><u>release-1.17.1<\/u><\/a>.<\/p>\n<p>\u0422\u0430\u043a\u0436\u0435 \u043c\u044b \u043d\u0435 \u043c\u043e\u0433\u043b\u0438 \u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u044d\u0442\u043e \u043c\u0435\u0441\u0442\u043e \u0431\u0435\u0437 \u043c\u043e\u043d\u0438\u0442\u043e\u0440\u0438\u043d\u0433\u0430. <a href=\"https:\/\/github.com\/NLnetLabs\/unbound\/pull\/826\"><u>\u0421\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043f\u0430\u0442\u0447\u0435\u043c<\/u><\/a> \u043c\u044b \u043e\u0442\u043f\u0440\u0430\u0432\u0438\u043b\u0438 \u043a\u043e\u0434, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u0442 \u043c\u0435\u0442\u0440\u0438\u043a\u0443, \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u044e\u0449\u0443\u044e \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043a\u043e\u043b\u043b\u0438\u0437\u0438\u0439 \u043f\u0440\u0438 \u0432\u0441\u0442\u0430\u0432\u043a\u0435 \u043d\u043e\u0432\u043e\u0433\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0432 <code>BIN->linked_list<\/code>.<\/p>\n<p>\u0412 \u0438\u0442\u043e\u0433\u0435 \u0431\u0430\u0433\u0444\u0438\u043a\u0441 \u0432\u0435\u0440\u043d\u0443\u043b \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c Unbound \u043f\u0440\u0438 \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u0435 \u0437\u0430\u043f\u0440\u043e\u0441\u0430\u043c\u0438 <code>udp-random<\/code> \u043d\u0430 \u043d\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u044b\u0435 600-700 Krps \u043d\u0430 \u0438\u043d\u0441\u0442\u0430\u043d\u0441.<\/p>\n<p>\u041d\u043e \u043d\u0430 \u044d\u0442\u043e\u043c \u0438\u0441\u0442\u043e\u0440\u0438\u044f \u043f\u043e\u0438\u0441\u043a\u0430 \u0431\u0430\u0433\u043e\u0432 \u0432 Unbound \u043d\u0435 \u0437\u0430\u043a\u0430\u043d\u0447\u0438\u0432\u0430\u0435\u0442\u0441\u044f. \u0421\u043f\u0430\u0441\u0438\u0431\u043e \u0432\u0441\u0435\u043c \u043a\u0442\u043e \u0434\u043e\u0447\u0438\u0442\u0430\u043b \u044d\u0442\u043e\u0442 \u0434\u0435\u0442\u0435\u043a\u0442\u0438\u0432 \u0434\u043e \u043a\u043e\u043d\u0446\u0430!<\/p>\n<\/p>\n<\/div>\n<\/div>\n<\/div>\n<p><!----><!----><\/div>\n<p><!----><!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/articles\/729764\/\"> https:\/\/habr.com\/ru\/articles\/729764\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<figure class=\"\"><\/figure>\n<p>\u041f\u0440\u0438\u0432\u0435\u0442, \u043c\u0435\u043d\u044f \u0437\u043e\u0432\u0443\u0442 \u0421\u0435\u0440\u0433\u0435\u0439 \u041a\u0430\u0447\u0435\u0435\u0432, \u044f \u0441\u0442\u0430\u0440\u0448\u0438\u0439 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u0432 \u043e\u0442\u0434\u0435\u043b\u0435 \u0441\u0435\u0442\u0435\u0432\u043e\u0439 \u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b \u042f\u043d\u0434\u0435\u043a\u0441\u0430. \u0421\u0435\u0433\u043e\u0434\u043d\u044f \u044f \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0443 \u0446\u0435\u043b\u044b\u0439 \u0441\u0435\u0442\u0435\u0432\u043e\u0439 \u0434\u0435\u0442\u0435\u043a\u0442\u0438\u0432 \u043e \u0442\u043e\u043c, \u043a\u0430\u043a \u043c\u044b \u0438\u0441\u043a\u0430\u043b\u0438 \u0431\u0430\u0433, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0443\u0431\u0438\u0432\u0430\u043b DNS \u0441\u0435\u0440\u0432\u0435\u0440 Unbound. \u041f\u0440\u0438\u0433\u043e\u0442\u043e\u0432\u044c\u0442\u0435\u0441\u044c, \u043e\u043d \u0431\u0443\u0434\u0435\u0442 \u0434\u043e\u043b\u0433\u0438\u043c.<\/p>\n<p>\u0412\u0441\u0451 \u043d\u0430\u0447\u0430\u043b\u043e\u0441\u044c \u0441 \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u043c\u043d\u0435 \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0438\u043b\u0438 \u043f\u043e\u043c\u043e\u0447\u044c \u0440\u0435\u0431\u044f\u0442\u0430\u043c \u0438\u0437 \u043a\u043e\u043c\u0430\u043d\u0434\u044b DNS \u043d\u0430\u0439\u0442\u0438 \u0442\u0430\u043a\u0438\u0435 \u043c\u0435\u0442\u0440\u0438\u043a\u0438 \u0438 \u043d\u0430\u0431\u043e\u0440\u044b \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432, \u043f\u043e \u043a\u043e\u0442\u043e\u0440\u044b\u043c \u0431\u0443\u0434\u0435\u0442 \u043e\u0434\u043d\u043e\u0437\u043d\u0430\u0447\u043d\u043e \u043f\u043e\u043d\u044f\u0442\u043d\u043e, \u043a\u0430\u043a\u0438\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u0432\u043b\u0438\u044f\u044e\u0442 \u043d\u0430 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c Unbound \u0438 \u043a\u0430\u043a\u0438\u0435 \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u0432\u044b\u0437\u044b\u0432\u0430\u044e\u0442 \u0443 \u043d\u0435\u0433\u043e \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b.<\/p>\n<p>\u0412 \u0441\u0430\u043c\u043e\u043c \u043d\u0430\u0447\u0430\u043b\u0435 \u043d\u0430 \u0433\u0440\u0430\u0444\u0438\u043a\u0430\u0445 \u043d\u0430\u0433\u0440\u0443\u0437\u043e\u0447\u043d\u043e\u0433\u043e \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u044f \u0443\u0432\u0438\u0434\u0435\u043b \u043e\u0447\u0435\u043d\u044c \u043f\u043b\u043e\u0445\u0438\u0435 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b: \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u044b\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u0430\u0431\u0441\u043e\u043b\u044e\u0442\u043d\u043e \u0432\u0441\u0435 \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u043d\u0430\u0433\u0440\u0443\u0437\u043e\u0447\u043d\u043e\u0433\u043e \u0442\u0435\u0441\u0442\u0430 \u0442\u0430\u0439\u043c\u0430\u0443\u0442\u0438\u043b\u0438\u0441\u044c, \u043d\u043e \u0441\u0435\u0440\u0432\u0435\u0440, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u044b\u043b \u043f\u043e\u0434 \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u043e\u0439, \u043d\u0438\u043a\u0430\u043a \u043d\u0435 \u0440\u0435\u0430\u0433\u0438\u0440\u043e\u0432\u0430\u043b \u043d\u0430 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0443. \u041a\u0430\u043a \u0432\u044b\u044f\u0441\u043d\u0438\u043b\u043e\u0441\u044c \u043f\u043e\u0437\u0436\u0435, \u043f\u043e \u0447\u0438\u0441\u0442\u043e\u0439 \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u043e\u0441\u0442\u0438 \u044f \u0434\u043e\u043f\u0443\u0441\u0442\u0438\u043b \u043e\u0448\u0438\u0431\u043a\u0443 \u0432 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 \u043d\u0430\u0448\u0435\u0433\u043e \u043f\u043b\u0430\u0433\u0438\u043d\u0430 <a href=\"https:\/\/github.com\/yandex\/pandora\"><u>Pandora<\/u><\/a>, \u0438 \u0432 \u0438\u0442\u043e\u0433\u0435 \u043e\u043d \u0441\u0430\u043c \u0445\u043e\u0434\u0438\u043b \u0432 DNS \u043d\u0430 \u043a\u0430\u0436\u0434\u044b\u0439 \u0437\u0430\u043f\u0440\u043e\u0441, \u0447\u0442\u043e\u0431\u044b \u0443\u0437\u043d\u0430\u0442\u044c ip \u0430\u0434\u0440\u0435\u0441 \u0442\u0435\u0441\u0442\u0438\u0440\u0443\u0435\u043c\u043e\u0433\u043e \u0441\u0435\u0440\u0432\u0435\u0440\u0430. \u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u044d\u0442\u043e \u0441\u044b\u0433\u0440\u0430\u043b\u043e \u043c\u043d\u0435 \u043d\u0430 \u0440\u0443\u043a\u0443 \u0438 \u043f\u043e\u043c\u043e\u0433\u043b\u043e \u043d\u0430\u0439\u0442\u0438 \u043f\u0435\u0440\u0432\u0443\u044e \u0438\u0437 \u043f\u0440\u043e\u0431\u043b\u0435\u043c, \u0430 \u043f\u043e\u0442\u043e\u043c \u0438 \u0432\u043e\u0432\u0441\u0435 \u0437\u0430\u0434\u0430\u043b\u043e \u0432\u0435\u043a\u0442\u043e\u0440 \u043f\u043e\u0438\u0441\u043a\u043e\u0432 \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u0445 \u0431\u0430\u0433\u043e\u0432. \u0410 \u0432 Unbound \u0438\u0445 \u043d\u0430\u043a\u043e\u043f\u0438\u043b\u043e\u0441\u044c \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e.<\/p>\n<p>\u0423\u0442\u043e\u0447\u043d\u044e, \u0447\u0442\u043e \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u043f\u0440\u043e\u0432\u043e\u0434\u0438\u043b\u043e\u0441\u044c \u0432 LXC-\u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0435, \u043a\u043e\u0442\u043e\u0440\u043e\u043c\u0443 \u0431\u044b\u043b\u043e \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u043e 48 \u044f\u0434\u0435\u0440 \u0438 128 \u0413\u0431 \u043f\u0430\u043c\u044f\u0442\u0438. \u0423 \u0441\u0435\u0440\u0432\u0435\u0440\u0430, \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0437\u0430\u043f\u0443\u0449\u0435\u043d \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440, \u0431\u044b\u043b\u0438 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u0445\u0430\u0440\u0430\u043a\u0442\u0435\u0440\u0438\u0441\u0442\u0438\u043a\u0438:\u00a0<\/p>\n<pre><code>CPU: x2 Intel(R) E5-2660 v4 @ 2.00GHz - total Cores: 28 Threads: 56\u00a0 MEM: x4 Samsung 32GiB 2933MHz - total 128GiB NET: Intel 82599 10Gbit\/s<\/code><\/pre>\n<p>\u041d\u0430\u0433\u0440\u0443\u0437\u043a\u0430 \u043f\u043e\u0434\u0430\u0432\u0430\u043b\u0430\u0441\u044c \u043f\u043e \u0441\u0435\u0442\u0438 \u0441 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u043e\u0432, \u0440\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u043d\u044b\u0445 \u043d\u0430 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0445 \u0444\u0438\u0437\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u0441\u0435\u0440\u0432\u0435\u0440\u0430\u0445.<\/p>\n<h2>\u0410\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0430 worker \u0432 Unbound<\/h2>\n<p>\u041d\u0430\u0447\u043d\u0451\u043c \u0441 \u0442\u043e\u0433\u043e, \u043a\u0430\u043a \u0443\u0441\u0442\u0440\u043e\u0435\u043d Unbound. \u041f\u043e \u0441\u0443\u0442\u0438, \u044d\u0442\u043e \u0434\u0435\u043c\u043e\u043d, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e <a href=\"https:\/\/github.com\/NLnetLabs\/unbound\/blob\/0682d4371edda418ab5bea35554925574fa8c0d1\/daemon\/daemon.c#L637\"><u>\u0442\u0440\u0435\u0434\u043e\u0432<\/u><\/a>. \u041a\u0430\u0436\u0434\u044b\u0439 \u0442\u0440\u0435\u0434 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442 \u0441\u0432\u043e\u0439 <a href=\"https:\/\/github.com\/NLnetLabs\/unbound\/blob\/0682d4371edda418ab5bea35554925574fa8c0d1\/daemon\/worker.c#L1952\"><u>event loop<\/u><\/a>. \u0412 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0441\u043e\u0431\u044b\u0442\u0438\u0439 Unbound \u043f\u0435\u0440\u0435\u0434\u0430\u0451\u0442 \u043d\u0430\u0431\u043e\u0440 callback-\u0444\u0443\u043d\u043a\u0446\u0438\u0439, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0440\u0435\u0430\u0433\u0438\u0440\u0443\u044e\u0442 \u043d\u0430 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0435 \u0441\u0435\u0442\u0435\u0432\u044b\u0435 \u0441\u043e\u0431\u044b\u0442\u0438\u044f: \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0437\u0430\u043f\u0440\u043e\u0441 \u043e\u0442 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f, \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0430 \u0444\u0430\u0439\u043b\u043e\u0432\u044b\u0445 \u0437\u043e\u043d, \u043e\u0442\u0432\u0435\u0442 \u043d\u0430 \u0440\u0435\u043a\u0443\u0440\u0441\u0438\u0432\u043d\u044b\u0439 \u0437\u0430\u043f\u0440\u043e\u0441 \u0438 \u0434\u0440\u0443\u0433\u0438\u0435.<\/p>\n<figure class=\"\">\n<div><figcaption>\u0412\u043e\u0442 \u0442\u0430\u043a \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 Unbound<\/figcaption><\/div>\n<\/figure>\n<p>\u0414\u043b\u044f \u0431\u0430\u043b\u0430\u043d\u0441\u0438\u0440\u043e\u0432\u043a\u0438 \u043c\u0435\u0436\u0434\u0443 \u0442\u0440\u0435\u0434\u0430\u043c\u0438 Unbound \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u043e\u043f\u0446\u0438\u044e \u043f\u0440\u0438 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0438 \u043f\u0440\u043e\u0441\u043b\u0443\u0448\u0438\u0432\u0430\u044e\u0449\u0435\u0433\u043e \u0441\u043e\u043a\u0435\u0442\u0430 <code>SO_REUSEPORT<\/code>. \u0421 \u043d\u0435\u0439 \u044f\u0434\u0440\u043e Linux \u0441\u0430\u043c\u043e \u0440\u0435\u0448\u0430\u0435\u0442, \u0432 \u043a\u0430\u043a\u043e\u0439 \u0442\u0440\u0435\u0434 \u043d\u0430\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u0442\u043e\u0442 \u0438\u043b\u0438 \u0438\u043d\u043e\u0439 \u0437\u0430\u043f\u0440\u043e\u0441 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f. \u041e\u0431 \u044d\u0442\u043e\u043c \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043e \u0432 \u0441\u0442\u0430\u0442\u044c\u0435 <a href=\"https:\/\/blog.flipkart.tech\/linux-tcp-so-reuseport-usage-and-implementation-6bfbf642885a\"><u>Linux TCP SO_REUSEPORT \u2014 Usage and implementation<\/u><\/a>.<\/p>\n<p>\u0414\u0430\u043b\u0435\u0435 event loop \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442 \u043e\u0442 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u0443\u0432\u0435\u0434\u043e\u043c\u043b\u0435\u043d\u0438\u044f \u043e \u043f\u0440\u0438\u0448\u0435\u0434\u0448\u0438\u0445 \u043f\u0430\u043a\u0435\u0442\u0430\u0445 \u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442 callback-\u0444\u0443\u043d\u043a\u0446\u0438\u0438. \u0412\u0441\u0451 \u043f\u0440\u043e\u0441\u0442\u043e.<\/p>\n<p>\u0415\u0449\u0451 \u043e\u0434\u043d\u0430 \u0432\u0430\u0436\u043d\u0430\u044f \u0434\u0435\u0442\u0430\u043b\u044c. \u0414\u043b\u044f \u0443\u0441\u043a\u043e\u0440\u0435\u043d\u0438\u044f \u043e\u0442\u0432\u0435\u0442\u043e\u0432 \u0438\u0437 \u043a\u044d\u0448\u0438\u0440\u0443\u044e\u0449\u0438\u0445 \u0441\u0435\u0440\u0432\u0435\u0440\u043e\u0432 \u043c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044e hyperlocal zone. \u041e\u043d\u0430 \u043f\u043e\u0434\u0440\u0430\u0437\u0443\u043c\u0435\u0432\u0430\u0435\u0442, \u0447\u0442\u043e \u043d\u0430 DNS \u0441\u0435\u0440\u0432\u0435\u0440\u0430\u0445 \u0445\u0440\u0430\u043d\u0438\u0442\u0441\u044f \u043a\u043e\u043f\u0438\u044f auth-zone \u2014 \u0442\u043e \u0435\u0441\u0442\u044c \u0444\u0430\u0439\u043b\u0430, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0445\u0440\u0430\u043d\u044f\u0442\u0441\u044f DNS-\u0437\u0430\u043f\u0438\u0441\u0438. \u0417\u0430 \u0441\u0447\u0451\u0442 \u044d\u0442\u043e\u0433\u043e \u043e\u0442\u0432\u0435\u0442\u044b \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f\u043c \u043e\u0442\u0434\u0430\u044e\u0442\u0441\u044f \u0431\u044b\u0441\u0442\u0440\u0435\u0435, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u0434\u0430\u043d\u043d\u044b\u0435 \u0441\u0447\u0438\u0442\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u043d\u0430 \u043c\u0435\u0441\u0442\u0435, \u0430 \u043d\u0435 \u0441\u043e\u0437\u0434\u0430\u0451\u0442\u0441\u044f \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439 \u0437\u0430\u043f\u0440\u043e\u0441 \u0432 authority-\u0441\u0435\u0440\u0432\u0435\u0440. \u041f\u0435\u0440\u0435\u0434\u0430\u044e\u0442\u0441\u044f \u044d\u0442\u0438 \u0444\u0430\u0439\u043b\u044b \u0441 \u043c\u0430\u0441\u0442\u0435\u0440\u0430 \u043d\u0430 \u0440\u0435\u043f\u043b\u0438\u043a\u0438 \u0447\u0435\u0440\u0435\u0437 \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c\u044b, \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u0435 \u0432 Unbound.<\/p>\n<h2>\u0412\u0437\u0434\u0440\u044b\u0436\u043d\u0438. \u0418 \u043f\u0440\u0438\u0447\u0451\u043c \u0442\u0443\u0442 \u0444\u0430\u0439\u043b\u043e\u0432\u044b\u0435 Authority Zone<\/h2>\n<p>\u0412 \u0441\u0430\u043c\u043e\u043c \u043d\u0430\u0447\u0430\u043b\u0435 \u044f \u0443\u043f\u043e\u043c\u044f\u043d\u0443\u043b \u043f\u0440\u043e \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u044b\u0439 \u0441\u043b\u0443\u0447\u0430\u0439. \u0418\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442 \u0434\u043b\u044f \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f\u00a0 \u043f\u0435\u0440\u0435\u0434 \u043a\u0430\u0436\u0434\u044b\u043c \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u043c \u0440\u0435\u0437\u043e\u043b\u0432\u0438\u043b \u0430\u0434\u0440\u0435\u0441 \u0442\u0435\u0441\u0442\u0438\u0440\u0443\u0435\u043c\u043e\u0433\u043e \u0441\u0435\u0440\u0432\u0435\u0440\u0430. \u0418\u043d\u043e\u0433\u0434\u0430 \u0442\u0430\u043a\u0438\u0435 \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u0432 DNS \u0442\u0430\u0439\u043c\u0430\u0443\u0442\u0438\u043b\u0438\u0441\u044c.<\/p>\n<p>\u041f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u0431\u044b\u043b\u0430 \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u044f \u043d\u0435 \u0437\u043d\u0430\u043b \u0438\u0441\u0442\u0438\u043d\u043d\u0443\u044e \u043f\u0440\u0438\u0447\u0438\u043d\u0443 \u0442\u0430\u0439\u043c\u0430\u0443\u0442\u043e\u0432. \u042f \u043d\u0435 \u043c\u043e\u0433 \u043f\u043e\u043d\u044f\u0442\u044c, \u0447\u0442\u043e \u043d\u0435 \u0442\u0430\u043a \u0438\u043c\u0435\u043d\u043d\u043e \u0441 \u043c\u043e\u0438\u043c \u0441\u0442\u0435\u043d\u0434\u043e\u043c: \u043f\u043e\u0447\u0435\u043c\u0443 \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0443 \u0434\u0440\u0443\u0433\u0438\u0445 \u043a\u043e\u043b\u043b\u0435\u0433 \u043f\u0440\u043e\u0445\u043e\u0434\u0438\u0442 \u0431\u0435\u0437 \u0442\u0430\u043a\u0438\u0445 \u0432\u0441\u043f\u043b\u0435\u0441\u043a\u043e\u0432 100% \u0442\u0430\u0439\u043c\u0430\u0443\u0442\u043e\u0432. \u041a\u0430\u043a\u0430\u044f \u0436\u0435 \u0431\u044b\u043b\u0430 \u0432\u0437\u0430\u0438\u043c\u043e\u0441\u0432\u044f\u0437\u044c \u043c\u0435\u0436\u0434\u0443 \u044d\u0442\u0438\u043c\u0438 \u0442\u0430\u0439\u043c\u0430\u0443\u0442\u0430\u043c\u0438 \u0438 \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435\u043c load-\u0441\u0442\u0435\u043d\u0434\u0430?<\/p>\n<figure class=\"full-width\">\n<div><figcaption>\u041f\u0440\u0438\u043c\u0435\u0440 \u043f\u043b\u043e\u0445\u043e\u0433\u043e \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430 \u043d\u0430\u0433\u0440\u0443\u0437\u043e\u0447\u043d\u043e\u0433\u043e \u0442\u0435\u0441\u0442\u0430<\/figcaption><\/div>\n<\/figure>\n<p>\u041f\u043e\u044f\u0441\u043d\u044e, \u0447\u0442\u043e \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u043d\u0430 \u0433\u0440\u0430\u0444\u0438\u043a\u0430\u0445. \u0422\u0430\u0439\u043c\u0438\u043d\u0433\u0438 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u0438\u043d\u043e\u0433\u0434\u0430 \u043e\u0447\u0435\u043d\u044c \u0431\u043e\u043b\u044c\u0448\u0438\u0435 \u0438 \u0432 \u044d\u0442\u043e \u0436\u0435 \u0432\u0440\u0435\u043c\u044f \u043f\u043e\u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f 502 \u043e\u0448\u0438\u0431\u043a\u0438. \u0423\u0442\u043e\u0447\u043d\u044e, \u0447\u0442\u043e \u0438\u0437\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e <a href=\"http:\/\/overload.yandex.net\">overload.yandex.net<\/a> \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043b\u0441\u044f \u043d\u0430 \u043f\u043e\u043a\u0430\u0437\u0435 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u0432 \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f http-\u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432, \u0438 \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043a\u043e\u0434\u044b \u043e\u0442\u0432\u0435\u0442\u0430 \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u043a\u0430\u043a HTTP. \u041d\u043e \u043d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435 \u0432 \u043f\u043b\u0430\u0433\u0438\u043d\u0435 Pandora \u043c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u0442\u0430\u043a\u0443\u044e \u0442\u0440\u0430\u043d\u0441\u043b\u044f\u0446\u0438\u044e \u043e\u0448\u0438\u0431\u043e\u043a:<\/p>\n<pre><code class=\"go\">DnsServerTimeout:   502, DnsAmmoNotSupported:503, dns.RcodeSuccess:   200, dns.RcodeFormatError:   400, dns.RcodeServerFailure: 401, \/\/ NXDOMAIN dns.RcodeNameError:  402, dns.RcodeNotImplemented: 403, dns.RcodeRefused:    404, dns.RcodeYXDomain:   405, dns.RcodeYXRrset:    406, dns.RcodeNXRrset:    407, dns.RcodeNotAuth:    408, dns.RcodeNotZone:    409, dns.RcodeBadSig:     410, dns.RcodeBadKey:     411, dns.RcodeBadTime:    412, dns.RcodeBadMode:    413, dns.RcodeBadName:    414, dns.RcodeBadAlg:     415, dns.RcodeBadTrunc:   416, dns.RcodeBadCookie:  417,<\/code><\/pre>\n<p>\u042f \u043a\u0440\u0443\u0442\u0438\u043b \u0432\u0441\u0451, \u0447\u0442\u043e \u0442\u043e\u043b\u044c\u043a\u043e \u043c\u043e\u0433 \u0432 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430\u0445 LXD-\u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u043a\u0440\u0443\u0442\u0438\u043b\u0441\u044f \u0441\u0442\u0435\u043d\u0434. \u042f \u043f\u0435\u0440\u0435\u043d\u043e\u0441\u0438\u043b \u0441\u0442\u0435\u043d\u0434 \u043d\u0430 \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0435 \u044f\u0434\u0440\u0430 \u0438 \u043f\u0435\u0440\u0435\u043c\u0435\u0449\u0430\u043b \u0434\u0430\u043d\u043d\u044b\u0435 Unbound \u0432 tmpfs. \u041d\u0435 \u043f\u043e\u043c\u043e\u0433\u0430\u043b\u043e. \u0411\u043e\u043b\u044c\u0448\u0435 \u0432\u0441\u0435\u0433\u043e \u0441\u043c\u0443\u0449\u0430\u043b\u043e \u0442\u043e, \u0447\u0442\u043e \u044d\u0444\u0444\u0435\u043a\u0442 \u0441\u043e\u0432\u0435\u0440\u0448\u0435\u043d\u043d\u043e \u043d\u0435 \u0437\u0430\u0432\u0438\u0441\u0435\u043b \u043e\u0442 \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u0438: 1rps, 1Krps, 5Krps \u2014 \u043d\u0435\u0432\u0430\u0436\u043d\u043e! \u0412\u0441\u0451 \u0442\u0430\u043a \u0436\u0435 \u043f\u043e\u044f\u0432\u043b\u044f\u043b\u0438\u0441\u044c 100% \u0442\u0430\u0439\u043c\u0430\u0443\u0442\u043e\u0432.<\/p>\n<p>\u042f \u0438\u0437\u0443\u0447\u0438\u043b \u0432\u0441\u0435 \u0441\u043e\u043c\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u043c\u0435\u0441\u0442\u0430 \u0432 \u043a\u043e\u0434\u0435 Unbound: \u0441\u043c\u043e\u0442\u0440\u0435\u043b \u043d\u0430 \u0432\u0441\u0451, \u0447\u0442\u043e \u0442\u043e\u043b\u044c\u043a\u043e \u043c\u043e\u0433 \u0442\u0443\u043b\u0430\u043c\u0438 \u0438\u0437 bcc-tools, bpf-tools \u0438 atop. \u0418 \u0432\u0435\u0434\u044c \u043d\u0430\u0448\u0451\u043b \u0447\u0442\u043e-\u0442\u043e \u043f\u043e\u0434\u043e\u0437\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0435! \u0418\u043d\u043e\u0433\u0434\u0430 \u043c\u043e\u043c\u0435\u043d\u0442\u044b \u0432\u0437\u0434\u0440\u044b\u0436\u043d\u0435\u0439 (\u0442\u0430\u043a \u043c\u044b \u043d\u0430\u0437\u0432\u0430\u043b\u0438 \u044d\u0442\u043e\u0442 \u044d\u0444\u0444\u0435\u043a\u0442 \u0432 \u043a\u043e\u043c\u0430\u043d\u0434\u0435 DNS) \u0441\u043e\u0432\u043f\u0430\u0434\u0430\u043b\u0438 \u0441 \u043c\u043e\u043c\u0435\u043d\u0442\u043e\u043c \u0437\u0430\u043f\u0438\u0441\u0438 \u0444\u0430\u0439\u043b\u043e\u0432\u044b\u0445 \u0437\u043e\u043d.<\/p>\n<p>\u0412 <a href=\"https:\/\/unbound.docs.nlnetlabs.nl\/en\/latest\/manpages\/unbound.conf.html?highlight=forward-no-cache#authority-zone-options\"><u>\u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438<\/u><\/a> \u043e\u0431 \u044d\u0442\u043e\u043c \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043e \u0442\u0430\u043a:<\/p>\n<blockquote>\n<p><em>Authority zones can be read from zonefile. And can be kept updated via AXFR\u00a0 and\u00a0 IXFR. After\u00a0 update the zonefile is rewritten.<\/em><\/p>\n<\/blockquote>\n<p>\u042f \u043d\u0430\u0447\u0430\u043b \u043a\u043e\u043f\u0430\u0442\u044c \u0432 \u044d\u0442\u043e\u043c \u043c\u0435\u0441\u0442\u0435. \u041e\u0447\u0435\u0440\u0435\u0434\u043d\u0430\u044f \u043f\u043e\u043f\u044b\u0442\u043a\u0430: atop \u0438 bpftrace \u0437\u0430\u043f\u0443\u0449\u0435\u043d\u044b, netdata \u043e\u0442\u043a\u0440\u044b\u0442\u0430. \u0421\u043c\u043e\u0442\u0440\u0438\u043c, \u0436\u0434\u0451\u043c.<\/p>\n<pre><code class=\"bash\">ns-load.name:~$ sudo bpftrace -e 'tracepoint:syscalls:sys_enter_openat                    \/\/              |,---------------^                    \/\/  \u043a\u0430\u043a\u043e\u0435 \u0441\u043e\u0431\u044b\u0442\u0438\u0435 \u0432 \u0441\u0438\u0441\u0442\u0435\u043c\u0435 \u043c\u044b \u0441\u043e\u0431\u0438\u0440\u0430\u0435\u043c\u0441\u044f \u043c\u043e\u043d\u0438\u0442\u043e\u0440\u0438\u0442\u044c.                    \/\/  \u041f\u0440\u043e \u044d\u0442\u043e \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0447\u0438\u0442\u0430\u0442\u044c \u0432 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438 man bpftrace,   \/\/  \u0438 \u0442\u0430\u043c \u0436\u0435 \u043f\u0440\u043e kprobe \u0438 uprobe. \/\/  \/\/ - \u044d\u0442\u043e \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0439 \u0432 \u043a\u043e\u0434\u0435 bpftrace-\u0441\u043a\u0440\u0438\u043f\u0442\u0430. \/\/  ,- filter, \u043b\u043e\u0432\u0438\u0442\u044c \u0441\u043e\u0431\u044b\u0442\u0438\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0442 Unbound, \/\/  |  \u0437\u0430\u043f\u0443\u0449\u0435\u043d\u043d\u043e\u0433\u043e \u0432 \u044d\u0442\u043e\u043c lxc-\u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0435, \/\/  |  \u0430 \u0435\u0441\u043b\u0438 \u0442\u043e\u0447\u043d\u0435\u0435 \u2014 \u0442\u043e\u043b\u044c\u043a\u043e \u0432 cgroup,  \/\/  |  \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u043e\u0439 \u044d\u0442\u0438\u043c systemd-\u0441\u0435\u0440\u0432\u0438\u0441\u043e\u043c. \/cgroup == cgroupid(\"\/sys\/fs\/cgroup\/unified\/system.slice\/unbound.service\")\/ \/\/ \u041e\u0434\u043d\u043e\u0441\u0442\u0440\u043e\u0447\u043d\u0438\u043a, \u0441\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u044e\u0449\u0438\u0439 \u043d\u0430 \u043a\u0430\u0436\u0434\u043e\u0435 \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u043e\u0435 \u0441\u043e\u0431\u044b\u0442\u0438\u0435 \u2014 \u0432 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 tracepoint { printf(\"%s %s %s\\n\", strftime(\"%H:%M:%S\", nsecs), comm, str(args->filename)); }' | grep slave  # \u043d\u0430\u043c \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u044b \u0442\u043e\u043b\u044c\u043a\u043e \u0437\u043e\u043d\u044b 14:03:22 unbound \/etc\/unbound\/slave\/db.yandex.net.tmp2136807 14:03:29 unbound \/etc\/unbound\/slave\/cloud.yandex.net.tmp2136807 14:03:33 unbound \/etc\/unbound\/slave\/db.yandex.net.tmp2136807 14:03:41 unbound \/etc\/unbound\/slave\/cloud-preprod.yandex.net.tmp2136807 14:03:45 unbound \/etc\/unbound\/slave\/db.yandex.net.tmp2136807 14:03:53 unbound \/etc\/unbound\/slave\/db.yandex.net.tmp2136807 14:03:59 unbound \/etc\/unbound\/slave\/yandexcloud.net.tmp2136807<\/code><\/pre>\n<p>\u0425\u043e\u0440\u043e\u0448\u043e, \u043a\u0430\u043a\u0443\u044e-\u0442\u043e \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u0443\u044e \u043a\u043e\u0440\u0440\u0435\u043b\u044f\u0446\u0438\u044e \u044f \u043f\u043e\u0439\u043c\u0430\u043b. \u041f\u0443\u0441\u0442\u044c \u043e\u043d\u0430 \u043d\u0435 \u0441\u0442\u0430\u0431\u0438\u043b\u044c\u043d\u0430, \u043d\u043e \u044d\u0442\u043e \u0445\u043e\u0442\u044c \u043a\u0430\u043a\u043e\u0439-\u0442\u043e \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442.<\/p>\n<p>\u0412 atop\/htop \u0432\u0438\u0434\u043d\u043e, \u0447\u0442\u043e \u043f\u0440\u0438 \u0437\u0430\u043f\u0438\u0441\u0438 \u0444\u0430\u0439\u043b\u043e\u0432\u043e\u0439 \u0437\u043e\u043d\u044b \u0442\u0440\u0435\u0434, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u044d\u0442\u0438\u043c \u0437\u0430\u043d\u0438\u043c\u0430\u0435\u0442\u0441\u044f, \u043d\u0430 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0441\u0435\u043a\u0443\u043d\u0434 \u0441\u044a\u0435\u0434\u0430\u043b \u0432\u0441\u0451 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u043d\u043e\u0435 \u044f\u0434\u0440\u043e \u043f\u043e\u0434 100%. \u0410 \u0441\u0430\u043c\u0430\u044f \u0431\u043e\u043b\u044c\u0448\u0430\u044f \u0438\u0437 \u044d\u0442\u0438\u0445 \u0437\u043e\u043d \u0437\u0430\u043d\u0438\u043c\u0430\u0435\u0442 \u043f\u0440\u0438\u0431\u043b\u0438\u0437\u0438\u0442\u0435\u043b\u044c\u043d\u043e 70 \u041c\u0411 \u043d\u0430 \u0434\u0438\u0441\u043a\u0435 \u2014 \u043d\u0430 \u043d\u0435\u0439 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u043f\u0440\u043e\u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u044f\u0440\u0447\u0435 \u0432\u0441\u0435\u0433\u043e.<\/p>\n<p>\u0414\u043b\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u044f \u0440\u0435\u0448\u0438\u043b \u043e\u0442\u043a\u043b\u044e\u0447\u0438\u0442\u044c auth-zone \u0438 \u0437\u0430\u043c\u0435\u043d\u0438\u0442\u044c \u043e\u0434\u043d\u0443 \u0438\u0437 \u043d\u0438\u0445 \u043d\u0430 local-zone, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0435 \u043f\u0438\u0448\u0443\u0442\u0441\u044f \u043d\u0430 \u0434\u0438\u0441\u043a. \u041f\u043e\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u043b \u043f\u0440\u043e\u0432\u0435\u0441\u0442\u0438 \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u0443 \u0437\u0430\u043f\u0440\u043e\u0441\u0430\u043c\u0438, \u0445\u043e\u0434\u044f\u0449\u0438\u043c\u0438 \u0442\u043e\u043b\u044c\u043a\u043e \u0432 \u044d\u0442\u0443 local-zone. \u0418 \u043a\u0430\u043a\u043e\u0432\u043e \u0431\u044b\u043b\u043e \u043c\u043e\u0451 \u0443\u0434\u0438\u0432\u043b\u0435\u043d\u0438\u0435, \u043a\u043e\u0433\u0434\u0430 \u043f\u0435\u0440\u0432\u044b\u0439 \u0442\u0435\u0441\u0442 \u0432\u044b\u0434\u0430\u043b \u043c\u043d\u0435 \u0436\u0435\u043b\u0430\u0435\u043c\u044b\u0439 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442, \u0430 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u0431\u044b\u043b \u0434\u0430\u0436\u0435 \u0445\u0443\u0436\u0435 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0438\u0445 \u2014 \u0432\u0437\u0434\u0440\u044b\u0436\u043d\u0438 \u043d\u0435 \u043f\u0440\u043e\u0448\u043b\u0438.<\/p>\n<p>\u0412 \u044d\u0442\u043e\u0442 \u043c\u043e\u043c\u0435\u043d\u0442 \u044f \u043d\u0430\u0447\u0430\u043b \u0441\u043e\u043c\u043d\u0435\u0432\u0430\u0442\u044c\u0441\u044f \u0432\u043e \u0432\u0441\u0435\u0445 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u0430\u0445, \u0438 \u0432\u043e \u0432\u0441\u0435\u0445 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0438\u0445 \u0434\u043e\u0433\u0430\u0434\u043a\u0430\u0445. \u041f\u043e\u0441\u0442\u0435\u043f\u0435\u043d\u043d\u043e \u044f \u043f\u0435\u0440\u0435\u0448\u0451\u043b \u043a \u0434\u0435\u0431\u0430\u0433\u0443 Pandora. \u0421\u043f\u0443\u0441\u0442\u044f \u0432\u0440\u0435\u043c\u044f \u044f \u043d\u0430\u0448\u0451\u043b \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0443 \u0432 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 \u0438 \u043f\u043e\u043f\u0440\u0430\u0432\u0438\u043b \u043f\u043b\u0430\u0433\u0438\u043d, \u0447\u0442\u043e\u0431\u044b \u043e\u043d \u043d\u0435 \u0440\u0430\u0437\u0440\u0435\u0448\u0430\u043b \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c DNS \u0438\u043c\u044f \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 target. \u041f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0441\u044f, \u0447\u0442\u043e \u044f \u043b\u043e\u0432\u0438\u043b \u0442\u0435 \u0441\u0430\u043c\u044b\u0435 \u0432\u0437\u0434\u0440\u044b\u0436\u043d\u0438, \u043d\u043e \u0441\u043e \u0441\u0442\u043e\u0440\u043e\u043d\u044b \u043f\u043b\u0430\u0433\u0438\u043d\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0445\u043e\u0434\u0438\u043b \u0432 DNS. \u041d\u0430\u0433\u0440\u0443\u0437\u043e\u0447\u043d\u043e\u0435 \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0432 local-zone \u0438 auth-zone \u0442\u043e\u0436\u0435 \u043f\u043e\u043a\u0430\u0437\u0430\u043b\u043e \u0436\u0435\u043b\u0430\u0435\u043c\u043e\u0435 \u2014 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b \u0432 local-zone \u043d\u0435\u0442, \u0430 \u0432 auth-zone \u0435\u0441\u0442\u044c.<\/p>\n<p>\u0412\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u043c\u0441\u044f \u043a \u0434\u0435\u0431\u0430\u0433\u0443 auth-zone. \u0423 \u043c\u0435\u043d\u044f \u0431\u044b\u043b\u043e \u0447\u0451\u0442\u043a\u043e\u0435 \u0441\u043e\u0432\u043f\u0430\u0434\u0435\u043d\u0438\u0435 \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0433\u043e \u0444\u043e\u043d\u0430 \u0442\u0430\u0439\u043c\u0430\u0443\u0442\u043e\u0432 \u0441 \u043c\u043e\u043c\u0435\u043d\u0442\u043e\u043c \u043f\u0435\u0440\u0435\u0437\u0430\u043f\u0438\u0441\u0438 \u0444\u0430\u0439\u043b\u0430 \u0444\u0430\u0439\u043b\u043e\u0432\u043e\u0439 \u0437\u043e\u043d\u044b.<\/p>\n<pre><code class=\"lua\">         15:38:59: open path: slave\/db.yandex.net.tmp926625 # &lt;&lt; \u0441\u0431\u0440\u043e\u0441 \u0444\u0430\u0439\u043b\u043e\u0432\u043e\u0439                                                             # \u0437\u043e\u043d\u044b \u0432\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0439 \u0444\u0430\u0439\u043b,                                                             # \u0442\u0443\u0442 \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u0442 \u0433\u043e\u0440\u0435\u0442\u044c CPU \u0443 \u0442\u0440\u0435\u0434\u0430        7 2022-11-18T15:38:59   # &lt;&lt; \u043a\u043e\u043b-\u0432\u043e \u043e\u0448\u0438\u0431\u043e\u043a       32 2022-11-18T15:39:00     15:39:03: open path: slave\/cloud.yandex.net.tmp926625     15:39:12: open path: slave\/cloud.yandex.net.tmp926625     15:39:15: open path: slave\/yandexcloud.net.tmp926625     15:39:19: open path: slave\/cloud.yandex.net.tmp926625     15:39:21: open path: slave\/db.yandex.net.tmp926625        2 2022-11-18T15:39:21       22 2022-11-18T15:39:22        3 2022-11-18T15:39:23     15:39:28: open path: slave\/cloud.yandex.net.tmp926625     15:39:33: open path: slave\/yandexcloud.net.tmp926625     15:39:37: open path: slave\/db.yandex.net.tmp926625       29 2022-11-18T15:39:37       13 2022-11-18T15:39:38 <\/code><\/pre>\n<p>\u0418\u0437 \u043a\u043e\u0434\u0430 \u044f \u043f\u043e\u043d\u044f\u043b, \u043a\u0430\u043a\u043e\u0439 callback-\u0444\u0443\u043d\u043a\u0446\u0438\u0435\u0439 Unbound \u043e\u0442\u0432\u0435\u0447\u0430\u0435\u0442 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044e: <code>comm_point_udp_callback<\/code>. \u0427\u0442\u043e\u0431\u044b \u0443\u0432\u0438\u0434\u0435\u0442\u044c \u043c\u0435\u0434\u043b\u0435\u043d\u043d\u044b\u0435 \u043e\u0442\u0432\u0435\u0442\u044b \u043d\u0430 \u0437\u0430\u043f\u0440\u043e\u0441\u044b, \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0437\u0430\u043c\u0435\u0440\u0438\u0442\u044c \u0432\u0440\u0435\u043c\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0435\u0451 \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0435\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 <code>worker_handle_request<\/code><em>.<\/em><\/p>\n<p>\u0421\u043c\u043e\u0442\u0440\u0438\u043c \u043d\u0430 \u0435\u0451 \u0442\u0430\u0439\u043c\u0438\u043d\u0433\u0438:<\/p>\n<pre><code class=\"bash\">srv58:~$ sudo funclatency-bpfcc -u  \/usr\/sbin\/unbound-1.17.0-release:worker_handle_request -p 1953108 Tracing 1 functions for \"\/usr\/sbin\/unbound-1.17.0-release:worker_handle_request\"... Hit Ctrl-C to end. ^C      usecs               : count     distribution          0 -> 1          : 3        |                                        |          2 -> 3          : 304      |                                        |          4 -> 7          : 5630     |******                                  |          8 -> 15         : 35734    |****************************************|         16 -> 31         : 12844    |**************                          |         32 -> 63         : 1281     |*                                       |         64 -> 127        : 215      |                                        |        128 -> 255        : 53       |                                        |        256 -> 511        : 46       |                                        |        512 -> 1023       : 26       |                                        |       1024 -> 2047       : 0        |                                        |       2048 -> 4095       : 1        |                                        | Detaching...<\/code><\/pre>\n<p>\u0412\u0441\u0435 \u043e\u0442\u0432\u0435\u0442\u044b \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u044e\u0442\u0441\u044f \u0432 \u043f\u0440\u0435\u0434\u0435\u043b\u0430\u0445 \u043e\u0434\u043d\u043e\u0439 \u043c\u0438\u043b\u043b\u0438\u0441\u0435\u043a\u0443\u043d\u0434\u044b \u2014 \u0433\u0434\u0435 \u0436\u0435 \u0442\u0430\u0439\u043c\u0430\u0443\u0442\u044b?<\/p>\n<p>\u0412\u0441\u043f\u043e<\/p>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-380995","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/380995","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=380995"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/380995\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=380995"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=380995"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=380995"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}