{"id":1459,"date":"2024-11-08T16:31:12","date_gmt":"2024-11-08T13:31:12","guid":{"rendered":"https:\/\/aristov.tech\/blog\/?p=1459"},"modified":"2024-12-13T16:19:09","modified_gmt":"2024-12-13T13:19:09","slug":"pgbouncer-connecting-clients-v-postgresql","status":"publish","type":"post","link":"https:\/\/aristov.tech\/blog\/pgbouncer-connecting-clients-v-postgresql\/","title":{"rendered":"Pgbouncer &#8212; connecting clients \u0432 PostgreSQL"},"content":{"rendered":"\n<p>\u0421\u0442\u0430\u0442\u044c\u044f \u043e\u0441\u043d\u043e\u0432\u0430\u043d\u0430 \u043d\u0430 \u043c\u0430\u0442\u0435\u0440\u0438\u0430\u043b\u0430\u0445 \u043e\u0442\u043a\u0440\u044b\u0442\u043e\u0433\u043e \u0432\u0435\u0431\u0438\u043d\u0430\u0440\u0430, \u043f\u0440\u043e\u0448\u0435\u0434\u0448\u0435\u0433\u043e 30.10. \u0417\u0430\u043f\u0438\u0441\u044c \u0437\u0430\u043d\u044f\u0442\u0438\u044f \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u0430 \u0432&nbsp;<a href=\"https:\/\/youtu.be\/RuZVYwnSlPo\">\u044e\u0442\u0443\u0431 \u0432\u0435\u0440\u0441\u0438\u0438<\/a>, <a href=\"https:\/\/rutube.ru\/video\/b4bc11893ba9eb012f36db46a37363f1\/\">\u0440\u0443\u0442\u0443\u0431 \u0432\u0435\u0440\u0441\u0438\u0438<\/a> \u0438 <a href=\"https:\/\/vk.com\/video-212716752_456239107\">VK \u0412\u0438\u0434\u0435\u043e<\/a>.<\/p>\n\n\n\n<p>\u041f\u0440\u0435\u0437\u0435\u043d\u0442\u0430\u0446\u0438\u044f \u0438 \u0438\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u0438 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b \u043f\u043e <a href=\"https:\/\/github.com\/aeuge\/aristov_tech\">\u0441\u0441\u044b\u043b\u043a\u0435<\/a>.<\/p>\n\n\n\n<p class=\"has-x-large-font-size\"><strong>\u041f\u0440\u043e\u0431\u043b\u0435\u043c\u0430\u0442\u0438\u043a\u0430<\/strong><\/p>\n\n\n\n<p>\u041a\u043b\u0430\u0441\u0441\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0441\u0442\u0430\u0440\u0442 PostgreSQL: \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442\u0441\u044f \u0431\u0430\u0437\u043e\u0432\u044b\u0439 \u043f\u0440\u043e\u0446\u0435\u0441\u0441 postgres, \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0435\u0433\u043e fork (\u043a\u0430\u0436\u0434\u044b\u0439 fork \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430 \u0437\u0430\u043d\u0438\u043c\u0430\u0435\u0442\u0441\u044f \u0441\u0432\u043e\u0435\u0439 \u0437\u0430\u0434\u0430\u0447\u0435\u0439), \u0444\u043e\u0440\u043c\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0440\u0430\u0437\u0434\u0435\u043b\u044f\u0435\u043c\u0430\u044f \u043f\u0430\u043c\u044f\u0442\u044c, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043b\u0435\u0436\u0438\u0442 \u0431\u0443\u0444\u0435\u0440\u043d\u044b\u0439 \u043f\u0443\u043b \u0438 \u0434\u0440\u0443\u0433\u0438\u0435 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b.<\/p>\n\n\n\n<figure class=\"wp-block-image aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"800\" height=\"450\" src=\"https:\/\/aristov.tech\/blog\/wp-content\/uploads\/2024\/11\/image.png\" alt=\"\" class=\"wp-image-1460\" srcset=\"https:\/\/aristov.tech\/blog\/wp-content\/uploads\/2024\/11\/image.png 800w, https:\/\/aristov.tech\/blog\/wp-content\/uploads\/2024\/11\/image-300x169.png 300w, https:\/\/aristov.tech\/blog\/wp-content\/uploads\/2024\/11\/image-768x432.png 768w\" sizes=\"auto, (max-width: 800px) 100vw, 800px\" \/><\/figure>\n\n\n\n<p>\u0414\u0430\u043b\u0435\u0435 \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442 \u043a\u043b\u0438\u0435\u043d\u0442 \u0438 \u0441\u043d\u043e\u0432\u0430 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 fork \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430 postgres.<\/p>\n\n\n\n<figure class=\"wp-block-image aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"800\" height=\"450\" src=\"https:\/\/aristov.tech\/blog\/wp-content\/uploads\/2024\/11\/image-1.png\" alt=\"\" class=\"wp-image-1461\" srcset=\"https:\/\/aristov.tech\/blog\/wp-content\/uploads\/2024\/11\/image-1.png 800w, https:\/\/aristov.tech\/blog\/wp-content\/uploads\/2024\/11\/image-1-300x169.png 300w, https:\/\/aristov.tech\/blog\/wp-content\/uploads\/2024\/11\/image-1-768x432.png 768w\" sizes=\"auto, (max-width: 800px) 100vw, 800px\" \/><\/figure>\n\n\n\n<p>\u0417\u0430\u0442\u0435\u043c \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u0438 \u0441\u043d\u043e\u0432\u0430 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 fork \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430 \u0438 \u0442\u0430\u043a \u0434\u0430\u043b\u0435\u0435 \u0441 \u043a\u0430\u0436\u0434\u044b\u043c \u043d\u043e\u0432\u044b\u043c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u043c (fork &#8212; \u044d\u0442\u043e \u0445\u043e\u0442\u044c \u0438 \u0431\u044b\u0441\u0442\u0440\u043e, \u043d\u043e \u0437\u0430\u0442\u0440\u0430\u0442\u043d\u043e \u043f\u043e \u0440\u0435\u0441\u0443\u0440\u0441\u0430\u043c).<\/p>\n\n\n\n<figure class=\"wp-block-image aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"800\" height=\"450\" src=\"https:\/\/aristov.tech\/blog\/wp-content\/uploads\/2024\/11\/image-2.png\" alt=\"\" class=\"wp-image-1462\" srcset=\"https:\/\/aristov.tech\/blog\/wp-content\/uploads\/2024\/11\/image-2.png 800w, https:\/\/aristov.tech\/blog\/wp-content\/uploads\/2024\/11\/image-2-300x169.png 300w, https:\/\/aristov.tech\/blog\/wp-content\/uploads\/2024\/11\/image-2-768x432.png 768w\" sizes=\"auto, (max-width: 800px) 100vw, 800px\" \/><\/figure>\n\n\n\n<figure class=\"wp-block-image aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"800\" height=\"450\" src=\"https:\/\/aristov.tech\/blog\/wp-content\/uploads\/2024\/11\/image-3.png\" alt=\"\" class=\"wp-image-1463\" srcset=\"https:\/\/aristov.tech\/blog\/wp-content\/uploads\/2024\/11\/image-3.png 800w, https:\/\/aristov.tech\/blog\/wp-content\/uploads\/2024\/11\/image-3-300x169.png 300w, https:\/\/aristov.tech\/blog\/wp-content\/uploads\/2024\/11\/image-3-768x432.png 768w\" sizes=\"auto, (max-width: 800px) 100vw, 800px\" \/><\/figure>\n\n\n\n<p class=\"has-medium-font-size\">\u041d\u0430 \u043a\u0430\u0436\u0434\u044b\u0439 \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u0432\u044b\u0434\u0435\u043b\u044f\u0435\u0442\u0441\u044f \u0441\u0432\u043e\u044f \u043f\u0430\u043c\u044f\u0442\u044c. \u041a\u043b\u0430\u0441\u0441\u0438\u0447\u0435\u0441\u043a\u0438 \u043d\u0430 backend process \u0432\u044b\u0434\u0435\u043b\u044f\u0435\u0442\u0441\u044f work_mem &#8212; 4 \u041c\u0411 (\u043f\u0440\u0438 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u044f\u0445 \u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u043a\u0438 \u0438 \u0445\u044d\u0448\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043c\u043e\u0436\u0435\u0442 \u0432\u044b\u0434\u0435\u043b\u044f\u0442\u044c\u0441\u044f \u043d\u0435\u043e\u0434\u043d\u043e\u043a\u0440\u0430\u0442\u043d\u043e &#8212; \u0434\u043e 5 \u0440\u0430\u0437). \u041e\u043d\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u043d\u0430 \u044d\u0442\u0430\u043f\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0437\u0430\u043f\u0440\u043e\u0441\u0430. \u0422\u0430\u043a\u0436\u0435 \u043c\u043e\u0436\u0435\u0442 \u0432\u044b\u0434\u0435\u043b\u044f\u0442\u044c\u0441\u044f maintenance_work_mem &#8212; 64 \u041c\u0411, \u0435\u0441\u043b\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f \u0441\u043b\u0443\u0436\u0435\u0431\u043d\u044b\u0435 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 (indexes, vacuum \u0438 \u0442. \u0434.). Temp_buffers &#8212; 8 \u041c\u0411 -\u0432\u044b\u0434\u0435\u043b\u044f\u0435\u0442\u0441\u044f \u043f\u0440\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438 \u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u0442\u0430\u0431\u043b\u0438\u0446. \u041e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u0432\u044b\u0434\u0435\u043b\u044f\u044e\u0442\u0441\u044f shared buffer \u0434\u043b\u044f \u0447\u0442\u0435\u043d\u0438\u044f \u0434\u0430\u043d\u043d\u044b\u0445 \u0441 \u0434\u0438\u0441\u043a\u0430\/\u0438\u043d\u0434\u0435\u043a\u0441\u0430.<\/p>\n\n\n\n<p>\u0412 \u0438\u0442\u043e\u0433\u0435 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u043d\u043e\u0432\u044b\u0445 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439 &#8212; \u043e\u0434\u043d\u043e \u0438\u0437 \u0431\u043e\u043b\u044c\u043d\u044b\u0445 \u043c\u0435\u0441\u0442 PostgreSQL \u0438\u0437-\u0437\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u043f\u0430\u043c\u044f\u0442\u0438.<\/p>\n\n\n\n<figure class=\"wp-block-image aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"761\" height=\"763\" src=\"https:\/\/aristov.tech\/blog\/wp-content\/uploads\/2024\/11\/image-4.png\" alt=\"\" class=\"wp-image-1464\" srcset=\"https:\/\/aristov.tech\/blog\/wp-content\/uploads\/2024\/11\/image-4.png 761w, https:\/\/aristov.tech\/blog\/wp-content\/uploads\/2024\/11\/image-4-300x300.png 300w, https:\/\/aristov.tech\/blog\/wp-content\/uploads\/2024\/11\/image-4-150x150.png 150w\" sizes=\"auto, (max-width: 761px) 100vw, 761px\" \/><\/figure>\n\n\n\n<p>\u0412\u044b\u0440\u0430\u0431\u043e\u0442\u0430\u043d\u043d\u0430\u044f \u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0444\u043e\u0440\u043c\u0443\u043b\u0430 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u043f\u0430\u043c\u044f\u0442\u0438:<\/p>\n\n\n\n<p>\u041e\u0417\u0423 (&gt;\u0413\u0411) + Shared buffers (25-40%) + max_connections * (work_mem + temp_buffers) + maintance_parallel_workers * maintance_work_mem.<\/p>\n\n\n\n<p>\u0415\u0441\u043b\u0438 \u043f\u0440\u043e\u043b\u0435\u0442\u0435\u043b\u0438 \u0441 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430\u043c\u0438 \u043f\u0430\u043c\u044f\u0442\u0438, \u0442\u043e <a href=\"https:\/\/ngelinux.com\/configure-oom-killer-in-linux\/\">OOM killer<\/a> \u043c\u043e\u0436\u0435\u0442 \u043f\u0440\u0438\u0439\u0442\u0438 \u0438 \u0443\u0431\u0438\u0442\u044c \u0431\u0430\u0437\u043e\u0432\u044b\u0439 \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u0432\u043c\u0435\u0441\u0442\u043e backend process, \u0447\u0442\u043e \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u043f\u0435\u0447\u0430\u043b\u044c\u043d\u043e.<\/p>\n\n\n\n<p><\/p>\n\n\n\n<p class=\"has-x-large-font-size\"><strong>\u0412\u0430\u0440\u0438\u0430\u043d\u0442\u044b<\/strong><strong> <\/strong><strong>\u0434\u043e\u0441\u0442\u0443\u043f\u0430<\/strong><strong> \u043a <\/strong><strong>\u043a\u043b\u0430\u0441\u0442\u0435\u0440\u0443<\/strong><\/p>\n\n\n\n<p class=\"has-large-font-size\">\u0412\u0430\u0440\u0438\u0430\u043d\u0442\u044b \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u043a PostgreSQL<\/p>\n\n\n\n<p>\u041f\u043e\u0441\u043b\u0435 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 PostgreSQL  \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442\u0441\u044f \u0441 \u0442\u0430\u043a\u0438\u043c\u0438 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430\u043c\u0438:<\/p>\n\n\n\n<figure class=\"wp-block-image aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"59\" src=\"https:\/\/aristov.tech\/blog\/wp-content\/uploads\/2024\/11\/image-5-1024x59.png\" alt=\"\" class=\"wp-image-1465\" srcset=\"https:\/\/aristov.tech\/blog\/wp-content\/uploads\/2024\/11\/image-5-1024x59.png 1024w, https:\/\/aristov.tech\/blog\/wp-content\/uploads\/2024\/11\/image-5-300x17.png 300w, https:\/\/aristov.tech\/blog\/wp-content\/uploads\/2024\/11\/image-5-768x44.png 768w, https:\/\/aristov.tech\/blog\/wp-content\/uploads\/2024\/11\/image-5-1536x89.png 1536w, https:\/\/aristov.tech\/blog\/wp-content\/uploads\/2024\/11\/image-5.png 1938w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>\u041f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 \u043e\u0431 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0435 \u0432 \u0441\u0442\u0430\u0442\u044c\u044f\u0445 &#8212; <a href=\"https:\/\/aristov.tech\/blog\/ustanovka-postgresql\/\">\u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 PostgreSQL<\/a> \u0438  <a href=\"https:\/\/aristov.tech\/blog\/varianty-ustanovki-postgresql\/\">\u0432\u0430\u0440\u0438\u0430\u043d\u0442\u044b \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438.<\/a><\/p>\n\n\n\n<p>\u0418\u0437\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e \u043e\u0442\u043a\u0440\u044b\u0442 \u0434\u043e\u0441\u0442\u0443\u043f \u0442\u043e\u043b\u044c\u043a\u043e \u0441 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e\u0439 \u043c\u0430\u0448\u0438\u043d\u044b. \u041a\u043b\u0430\u0441\u0441\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0434\u043e\u0441\u0442\u0443\u043f \u043c\u043e\u0436\u0435\u0442 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0441\u0443\u043f\u0435\u0440\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c (\u0447\u0435\u0440\u0435\u0437 sudo), \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c postgres. \u041e\u043d \u043f\u0440\u0435\u0434\u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d \u0434\u043b\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u0430 PostgreSQL \u0438 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0432\u043b\u0430\u0434\u0435\u043b\u044c\u0446\u0435\u043c \u0432\u0441\u0435\u0445 \u0444\u0430\u0439\u043b\u043e\u0432, \u043e\u0442\u043d\u043e\u0441\u044f\u0449\u0438\u0445\u0441\u044f \u043a PostgreSQL (\u0438\u0441\u043f\u043e\u043b\u043d\u044f\u0435\u043c\u044b\u0445 \u0444\u0430\u0439\u043b\u043e\u0432, \u0444\u0430\u0439\u043b\u043e\u0432 \u0434\u0430\u043d\u043d\u044b\u0445 \u0438 \u043b\u043e\u0433\u043e\u0432). \u041f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u043a \u044d\u0442\u0438\u043c \u0444\u0430\u0439\u043b\u0430\u043c \u043a\u0440\u043e\u043c\u0435 \u043d\u0435\u0433\u043e \u043c\u043e\u0433\u0443\u0442 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0434\u043e\u0441\u0442\u0443\u043f \u0442\u043e\u043b\u044c\u043a\u043e \u0441\u0443\u043f\u0435\u0440\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0438 Linux &#8212; root \u0438 \u0433\u0440\u0443\u043f\u043f\u0430 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439, \u0438\u043c\u0435\u044e\u0449\u0430\u044f \u043f\u0440\u0430\u0432\u043e \u043d\u0430 \u0437\u0430\u043f\u0443\u0441\u043a \u0443\u0442\u0438\u043b\u0438\u0442\u044b sudo, \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0449\u0435\u0439 \u043f\u043e\u0432\u044b\u0441\u0438\u0442\u044c \u0441\u0432\u043e\u0438 \u043b\u0438\u0447\u043d\u044b\u0435 \u043f\u0440\u0430\u0432\u0430 \u0434\u043e \u043f\u0440\u0430\u0432 \u0441\u0443\u043f\u0435\u0440\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f.<\/p>\n\n\n\n<p>\u0414\u043e\u0441\u0442\u0443\u043f \u043a PostgreSQL \u043f\u043e\u0441\u043b\u0435 \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u0432\u043e\u0437\u043c\u043e\u0436\u0435\u043d \u0442\u043e\u043b\u044c\u043a\u043e \u0447\u0435\u0440\u0435\u0437 psql \u0438 Unix socket. \u042d\u0442\u043e \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442, \u0447\u0442\u043e \u043f\u0430\u0440\u043e\u043b\u044c \u043e\u0442 \u0435\u0434\u0438\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0433\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0421\u0423\u0411\u0414 \u041d\u0415 \u0431\u0443\u0434\u0435\u0442 \u0437\u0430\u043f\u0440\u0430\u0448\u0438\u0432\u0430\u0442\u044c\u0441\u044f \u043f\u0440\u0438 \u0432\u0445\u043e\u0434\u0435 \u0432 PostgreSQL, \u0432\u043c\u0435\u0441\u0442\u043e \u044d\u0442\u043e\u0433\u043e PostgreSQL \u0441\u043f\u0440\u043e\u0441\u0438\u0442 \u0443 \u041e\u0421 &#8212; \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u043e\u0432\u0430\u043d \u043b\u0438 \u0442\u0430\u043a\u043e\u0439 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u0432 \u041e\u0421.<\/p>\n\n\n\n<p>\u0412 \u043d\u0430\u0448\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0441\u0443\u043f\u0435\u0440\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u0411\u0414 \u0442\u0430\u043a\u0436\u0435 \u0438\u043c\u0435\u0435\u0442 \u0438\u043c\u044f postgres. \u0415\u0441\u043b\u0438 \u0432 Linux \u043f\u0435\u0440\u0435\u0439\u0442\u0438 \u043e\u0442 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f aeugene \u043a \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044e postgres (\u043f\u043e\u0432\u044b\u0441\u0438\u0432 \u0441\u0432\u043e\u0438 \u043f\u0440\u0430\u0432\u0430 \u0434\u043e \u0441\u0443\u043f\u0435\u0440\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f Linux \u0438 \u0434\u0430\u0432 \u043a\u043e\u043c\u0430\u043d\u0434\u0443 \u043f\u0435\u0440\u0435\u043a\u043b\u044e\u0447\u0438\u0442\u044c\u0441\u044f \u043d\u0430 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f postgres), \u0442\u043e \u043f\u0440\u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0435 \u0443\u0442\u0438\u043b\u0438\u0442\u044b psql \u043f\u0440\u043e\u0438\u0437\u043e\u0439\u0434\u0435\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0435 &#8212; PostgreSQL \u0441\u043f\u0440\u043e\u0441\u0438\u0442 \u0443 Linux \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u043e\u0432\u0430\u043d \u043b\u0438 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c postgres \u0438 \u043f\u0443\u0441\u0442\u0438\u0442 \u0432\u043d\u0443\u0442\u0440\u044c \u0421\u0423\u0411\u0414 \u0431\u0435\u0437 \u043f\u0430\u0440\u043e\u043b\u044f. \u0418\u043d\u0430\u0447\u0435 \u0434\u043e\u0441\u0442\u0443\u043f \u043c\u044b \u043d\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u043c.<\/p>\n\n\n\n<p>\u0420\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u0435\u0442\u0441\u044f \u041d\u0415 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f postgres, \u0430 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u0441\u0432\u043e\u0438\u0445 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439 \u0441 \u043d\u0443\u0436\u043d\u044b\u043c\u0438 \u043f\u0440\u0430\u0432\u0430\u043c\u0438. \u041d\u0430 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f postgres \u0436\u0435 \u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0441\u043b\u043e\u0436\u043d\u044b\u0439 \u043f\u0430\u0440\u043e\u043b\u044c.<\/p>\n\n\n\n<p>\u0412\u0430\u0440\u0438\u0430\u043d\u0442\u044b \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u043a PostgreSQL:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u0417\u0430\u0439\u0442\u0438 \u0432 psql \u043f\u043e\u0434 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u043c postges (sudo su postgres)<\/li>\n\n\n\n<li>\u041f\u043e\u0432\u044b\u0441\u0438\u0442\u044c \u0441\u0432\u043e\u0438 \u043f\u0440\u0430\u0432\u0430 \u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u043a\u043e\u043c\u0430\u043d\u0434\u0443 psql \u0438\u0437-\u043f\u043e\u0434 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f postgres (\u043d\u0435 \u0437\u0430\u0445\u043e\u0434\u044f \u043f\u043e\u0434 \u0435\u0433\u043e \u0438\u043c\u0435\u043d\u0435\u043c) &#8212; sudo -u postgres psql.<\/li>\n<\/ul>\n\n\n\n<p class=\"has-large-font-size\">\u0412\u0430\u0440\u0438\u0430\u043d\u0442\u044b \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438<\/p>\n\n\n\n<p>\u041a\u0440\u043e\u043c\u0435 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u043f\u043e Unix Socket \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u043c \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435\u043c \u043a \u0421\u0423\u0411\u0414 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u043f\u043e \u0441\u0435\u0442\u0438 (\u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b TCP\/IP).<\/p>\n\n\n\n<p>\u0414\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u0437\u0430\u0439\u0442\u0438 \u043f\u043e \u0441\u0435\u0442\u0438 \u043c\u044b \u0434\u043e\u043b\u0436\u043d\u044b \u043e\u0442\u0440\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0434\u0432\u0430 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0445 \u0444\u0430\u0439\u043b\u0430:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>hba_file.conf<\/strong> &#8212; \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u043e\u0433\u043e \u0432 PostgreSQL firewall<\/li>\n\n\n\n<li><strong>postgresql.conf <\/strong>&#8212; \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 PostgreSQL, \u0432 \u0442\u043e\u043c \u0447\u0438\u0441\u043b\u0435 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0439 \u0438\u0437\u0432\u043d\u0435<\/li>\n<\/ul>\n\n\n\n<p>\u0420\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u044d\u0442\u0438\u0445 \u0444\u0430\u0439\u043b\u043e\u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u0442 \u043e\u0442 \u0442\u0438\u043f\u0430 \u0438 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u0430 \u041e\u0421. \u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c, \u0433\u0434\u0435 \u043e\u043d\u0438 \u0440\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u044b \u043c\u043e\u0436\u043d\u043e \u0438\u0437 \u0443\u0442\u0438\u043b\u0438\u0442\u044b psql:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>show <\/strong><strong>hba_file<\/strong><strong>;<\/strong><\/li>\n\n\n\n<li><strong>show config_file;<\/strong><br><\/li>\n<\/ul>\n\n\n\n<p>\u0412 Ubuntu \u0434\u0430\u043d\u043d\u044b\u0435 \u0444\u0430\u0439\u043b\u044b \u0440\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u044b:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>\/etc\/postgresql\/16\/main\/pg_hba.conf<\/strong><\/li>\n\n\n\n<li><strong>\/etc\/postgresql\/16\/main\/postgresql.conf<\/strong><\/li>\n<\/ul>\n\n\n\n<p>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u0443\u0442\u0438\u043b\u0438\u0442\u0443 \u043f\u0440\u043e\u0441\u043c\u043e\u0442\u0440\u0430 \u0444\u0430\u0439\u043b\u043e\u0432 cat \u043f\u043e\u0434 \u0442\u0435\u043a\u0443\u0449\u0438\u043c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u043c Linux postgres:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>cat \/etc\/postgresql\/16\/main\/pg_hba.conf<\/code><\/pre>\n\n\n\n<p>\u041e\u0442\u043a\u0440\u044b\u0432\u0430\u0439\u0442\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u0441\u0435\u0442\u0435\u0432\u043e\u0435 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u0432 \u0434\u043e\u0432\u0435\u0440\u0435\u043d\u043d\u043e\u0439 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e\u0439 \u0441\u0435\u0442\u0438! \u041d\u0415 \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u0435\u0442\u0441\u044f \u043e\u0442\u043a\u0440\u044b\u0432\u0430\u0442\u044c \u0434\u043e\u0441\u0442\u0443\u043f \u0432 \u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442!<\/p>\n\n\n\n<figure class=\"wp-block-image aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"165\" src=\"https:\/\/aristov.tech\/blog\/wp-content\/uploads\/2024\/11\/image-6-1024x165.png\" alt=\"\" class=\"wp-image-1466\" srcset=\"https:\/\/aristov.tech\/blog\/wp-content\/uploads\/2024\/11\/image-6-1024x165.png 1024w, https:\/\/aristov.tech\/blog\/wp-content\/uploads\/2024\/11\/image-6-300x48.png 300w, https:\/\/aristov.tech\/blog\/wp-content\/uploads\/2024\/11\/image-6-768x124.png 768w, https:\/\/aristov.tech\/blog\/wp-content\/uploads\/2024\/11\/image-6.png 1441w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>\u041f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 \u043e <a href=\"https:\/\/aristov.tech\/blog\/podklyuchenie-k-klasteru\/\">\u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0438 \u043a \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u0443<\/a> \u0438 <a href=\"https:\/\/aristov.tech\/blog\/podklyuchenie-k-postgresu-iz-komandnoj-stroki\/\">\u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0438 \u0438\u0437 \u043a\u043e\u043c\u0430\u043d\u0434\u043d\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0438.<\/a><\/p>\n\n\n\n<p class=\"has-large-font-size\">\u0428\u0438\u0444\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u043f\u0430\u0440\u043e\u043b\u0435\u0439<\/p>\n\n\n\n<p>\u042114 \u0432\u0435\u0440\u0441\u0438\u0438 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0441\u0438\u0441\u0442\u0435\u043c\u0430 \u0448\u0438\u0444\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043f\u0430\u0440\u043e\u043b\u0435\u0439 SCRAM-SHA-256, \u0430 \u0432 \u0431\u043e\u043b\u0435\u0435 \u0440\u0430\u043d\u043d\u0438\u0445 \u0432\u0435\u0440\u0441\u0438\u044f\u0445 &#8212; \u0441\u0438\u0441\u0442\u0435\u043c\u0430 MD5. \u041e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435, \u0447\u0442\u043e \u043e\u043d\u0438 \u043d\u0435 \u0441\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u043c\u044b, \u043f\u0440\u0438 \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0438 \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u0430 \u0441 13 \u043d\u0430 14+ \u0432\u0435\u0440\u0441\u0438\u044e \u043d\u0443\u0436\u043d\u043e \u044d\u0442\u043e \u0438\u043c\u0435\u0442\u044c \u0432 \u0432\u0438\u0434\u0443. \u041d\u0435 \u0441\u0442\u043e\u0438\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0441\u0438\u0441\u0442\u0435\u043c\u0443 PASSWORD &#8212; \u043f\u0430\u0440\u043e\u043b\u044c \u043f\u0435\u0440\u0435\u0434\u0430\u0435\u0442\u0441\u044f \u0432 \u043e\u0442\u043a\u0440\u044b\u0442\u043e\u043c \u0432\u0438\u0434\u0435.<\/p>\n\n\n\n<p class=\"has-large-font-size\">\u0410\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f<\/p>\n\n\n\n<p>\u0427\u0442\u043e\u0431\u044b \u0437\u0430\u0434\u0430\u0442\u044c \u043f\u0430\u0440\u043e\u043b\u044c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u0437\u0430\u0439\u0442\u0438 \u0432 \u043a\u043e\u043d\u0441\u043e\u043b\u044c<\/li>\n\n\n\n<li>psql<\/li>\n\n\n\n<li>\u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u043f\u0430\u0440\u043e\u043b\u044c \u0434\u043b\u044f \u0442\u0435\u043a\u0443\u0449\u0435\u0433\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f (\u0434\u0432\u0430 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u0430):\n<ul class=\"wp-block-list\">\n<li> \u043a\u043e\u043c\u0430\u043d\u0434\u0430&nbsp; psql<strong> &#8212;  \\password<\/strong><\/li>\n\n\n\n<li>SQL \u043a\u043e\u043c\u0430\u043d\u0434\u0430 <strong>ALTER USER postgres PASSWORD &#8216;123&#8217;<\/strong>;<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n\n\n\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0437\u0430\u0439\u0442\u0438 \u043f\u043e \u0441\u0435\u0442\u0438 \u043d\u0430 localhost (127.0.0.1).<\/p>\n\n\n\n<p>\u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c 3 \u0448\u0430\u0433\u0430:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u0432\u044b\u0439\u0442\u0438 \u0438\u0437 psql &#8212; <strong>\\q<\/strong><\/li>\n\n\n\n<li>\u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u044c\u0441\u044f \u0443\u043a\u0430\u0437\u0430\u0432 \u0445\u043e\u0441\u0442 \u0434\u043b\u044f \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f &#8212; <strong>psql -h localhost<\/strong><\/li>\n\n\n\n<li>\u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0441\u0442\u0430\u0442\u0443\u0441 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f &#8212;<strong> \\conninfo<\/strong><\/li>\n<\/ul>\n\n\n\n<p>\u0412\u0438\u0434\u0438\u043c, \u0447\u0442\u043e \u0442\u0435\u043f\u0435\u0440\u044c \u043c\u044b \u0432\u043c\u0435\u0441\u0442\u043e Unix Socket \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u043b\u0438\u0441\u044c \u043f\u043e \u0441\u0435\u0442\u0438 \u0441 localhost.<\/p>\n\n\n\n<p>\u041d\u0430\u043f\u043e\u043c\u0438\u043d\u0430\u044e, \u0447\u0442\u043e psql \u043c\u044b \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c \u0438\u0437 Linux \u0438\u0437-\u043f\u043e\u0434 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f postgres. \u0415\u0441\u043b\u0438 \u0437\u0430\u043a\u0440\u044b\u043b\u0438 \u043a\u043e\u043d\u0441\u043e\u043b\u044c, \u043f\u0435\u0440\u0435\u043a\u043b\u044e\u0447\u0438\u0442\u044c\u0441\u044f \u043d\u0430 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f postgres \u043c\u043e\u0436\u043d\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0432 sudo su postgres.<\/p>\n\n\n\n<p class=\"has-large-font-size\">\u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u043a PostgreSQL \u0438\u0437\u0432\u043d\u0435<\/p>\n\n\n\n<p>\u0414\u043b\u044f \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u0438\u0437\u0432\u043d\u0435 \u0412\u041c, \u043d\u0430\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0431\u043e\u043b\u044c\u0448\u0435 \u0448\u0430\u0433\u043e\u0432:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u0432\u043a\u043b\u044e\u0447\u0430\u0435\u043c listener \u0432 postgresql.conf (\u043e\u0431\u044b\u0447\u043d\u043e 2 \u0441\u0435\u0442\u0438 &#8212; \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u044f\u044f \u0438 \u0432\u043d\u0435\u0448\u043d\u044f\u044f &#8212; \u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442. \u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u0447\u0435\u0440\u0435\u0437 \u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442 \u043a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u0447\u0435\u0441\u043a\u0438 \u043d\u0435 \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u0435\u0442\u0441\u044f). <\/li>\n\n\n\n<li>\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c IP \u0430\u0434\u0440\u0435\u0441\u0430, \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f PostgreSQL, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 localhost, 10.*.*.* (\u0434\u0432\u0430 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u0430):\n<ul class=\"wp-block-list\">\n<li>listen_addresses = &#8216;*&#8217;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; # IP \u0430\u0434\u0440\u0435\u0441\u0430, \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f PostgreSQL, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 localhost, 10.*.*.*;<\/li>\n\n\n\n<li>alter system set listen_addresses = \u2018*\u2019;<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li>\u0432\u043a\u043b\u044e\u0447\u0430\u0435\u043c \u0432\u0445\u043e\u0434 \u043f\u043e \u043f\u0430\u0440\u043e\u043b\u044e \u0432 pg_hba.conf \u0438 \u043c\u0435\u043d\u044f\u0435\u043c \u043c\u0430\u0441\u043a\u0443 \u043f\u043e\u0434\u0441\u0435\u0442\u0438: <\/li>\n<\/ul>\n\n\n\n<p>host&nbsp; all&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; all&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; 0.0.0.0\/0&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; scram-sha-256<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u043f\u043e\u0440\u0442 \u0432\u043e \u0432\u043d\u0435\u0448\u043d\u0438\u0439 firewall, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u044b\u0439 \u0443 \u0432\u0430\u0441 \u0432 \u043e\u0440\u0433\u0430\u043d\u0438\u0437\u0430\u0446\u0438\u0438<\/li>\n\n\n\n<li>\u0437\u0430\u0434\u0430\u0435\u043c \u043f\u0430\u0440\u043e\u043b\u044c \u044e\u0437\u0435\u0440\u0443 postgres &#8212; <strong>ALTER USER postgres PASSWORD &#8216;123&#8217;;<\/strong><\/li>\n\n\n\n<li>\u041f\u0435\u0440\u0435\u0433\u0440\u0443\u0436\u0430\u0435\u043c \u0441\u0435\u0440\u0432\u0435\u0440 &#8212;<strong> pg_ctlcluster 16 main restart<\/strong> &#8212; \u043e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435, \u0447\u0442\u043e \u043f\u0440\u0438 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0435 PostgreSQL \u0437\u0430\u043f\u0443\u0449\u0435\u043d \u043e\u0442 \u0438\u043c\u0435\u043d\u0438 root \u0438 \u0440\u0435\u0441\u0442\u0430\u0440\u0442 \u043e\u0442 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f postgres \u043c\u044b \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043d\u0435 \u043c\u043e\u0436\u0435\u043c (\u0442\u043e\u043b\u044c\u043a\u043e stop \u0438 \u043f\u043e\u0442\u043e\u043c start). \u041f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e \u043f\u043e\u0442\u043e\u043c \u043f\u0435\u0440\u0435\u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u043d\u0430 postgres \u043f\u0440\u0438 \u0441\u0442\u0430\u0440\u0442\u0435 \u0412\u041c.<\/li>\n\n\n\n<li>\u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0435\u043c\u0441\u044f &#8212; <strong>psql -h 104.197.151.20 -U postgres<\/strong>.. \u0422\u0435\u043f\u0435\u0440\u044c \u043c\u044b \u0432\u043d\u0443\u0442\u0440\u0438 \u043d\u0430\u0448\u0435\u0433\u043e \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u0430 \u0438 \u043c\u043e\u0436\u0435\u043c \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0432 &#8212; <strong>\\conninfo<\/strong><\/li>\n<\/ul>\n\n\n\n<p class=\"has-large-font-size\">\u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u0438\u0437 \u0434\u0440\u0443\u0433\u0438\u0445 \u0432\u0435\u0440\u0441\u0438\u0439<\/p>\n\n\n\n<p>\u0422\u0430\u043a \u043a\u0430\u043a \u0443 PostgreSQL \u0443\u043d\u0438\u0432\u0435\u0440\u0441\u0430\u043b\u044c\u043d\u044b\u0439 \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b \u043e\u0431\u043c\u0435\u043d\u0430 \u043c\u0435\u0436\u0434\u0443 \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u0430\u043c\u0438 \u0438 \u0432\u0435\u0440\u0441\u0438\u044f\u043c\u0438, \u0442\u043e \u043d\u0438\u043a\u0430\u043a\u0438\u0445 \u043f\u0440\u043e\u0431\u043b\u0435\u043c \u043f\u0440\u0438 \u0441\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u043c\u043e\u0441\u0442\u0438, \u043d\u0430\u0447\u0438\u043d\u0430\u044f \u0441 \u0432\u0435\u0440\u0441\u0438\u0438 9.6, \u043d\u0435 \u043d\u0430\u0431\u043b\u044e\u0434\u0430\u0435\u0442\u0441\u044f. \u0415\u0441\u0442\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u043e, \u0435\u0441\u043b\u0438 \u0432\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0435 psql 16 \u0432\u0435\u0440\u0441\u0438\u0438 \u0438 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0435\u0441\u044c \u043a 10, \u0442\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b \u0431\u0443\u0434\u0435\u0442 \u0434\u043e\u0441\u0442\u0443\u043f\u0435\u043d \u0442\u043e\u043b\u044c\u043a\u043e 10 \u0432\u0435\u0440\u0441\u0438\u0438.<\/p>\n\n\n\n<p class=\"has-x-large-font-size\"><strong>\u0422\u0435\u043a\u0443\u0449\u0430\u044f \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044f<\/strong><\/p>\n\n\n\n<p>\u041f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0438 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u044e\u0442\u0441\u044f, load balancer \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442 \u0442\u0440\u0430\u0444\u0438\u043a \u043d\u0430 backend.<\/p>\n\n\n\n<figure class=\"wp-block-image aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"800\" height=\"450\" src=\"https:\/\/aristov.tech\/blog\/wp-content\/uploads\/2024\/11\/image-7.png\" alt=\"\" class=\"wp-image-1467\" srcset=\"https:\/\/aristov.tech\/blog\/wp-content\/uploads\/2024\/11\/image-7.png 800w, https:\/\/aristov.tech\/blog\/wp-content\/uploads\/2024\/11\/image-7-300x169.png 300w, https:\/\/aristov.tech\/blog\/wp-content\/uploads\/2024\/11\/image-7-768x432.png 768w\" sizes=\"auto, (max-width: 800px) 100vw, 800px\" \/><\/figure>\n\n\n\n<p>\u041e\u0434\u043d\u0430\u043a\u043e, \u043d\u0435\u0441\u043c\u043e\u0442\u0440\u044f \u043d\u0430 \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u0439 firewall, PostgreSQL &#8212; \u043d\u0435 \u0441\u0440\u0435\u0434\u0441\u0442\u0432\u043e \u0437\u0430\u0449\u0438\u0442\u044b \u043e\u0442 DDoS \u0438 \u0434\u0440\u0443\u0433\u0438\u0445 \u0430\u0442\u0430\u043a:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u0436\u0435\u043b\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u0432 \u0434\u043e\u0432\u0435\u0440\u0435\u043d\u043d\u043e\u0439 \u0437\u043e\u043d\u0435<\/li>\n\n\n\n<li>\u043c\u0435\u043d\u044f\u0442\u044c \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0439 \u043f\u043e\u0440\u0442<\/li>\n\n\n\n<li>\u0430\u043a\u043a\u0443\u0440\u0430\u0442\u043d\u0435\u0435 \u043f\u043e\u0434\u043d\u0438\u043c\u0430\u0442\u044c \u0434\u043e\u043a\u0435\u0440 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u044b \u0441 \u043f\u043e\u0440\u0442\u043e\u043c \u043d\u0430\u0440\u0443\u0436\u0443 -p 5432:5432 &#8212; \u043b\u0443\u0447\u0448\u0435 \u0434\u043e\u043a\u0435\u0440 \u0441\u0435\u0442\u044c \u0438 \u043f\u043e \u043d\u0435\u0439 \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u0431\u044d\u043a\u0435\u043d\u0434\u0430\u043c (k8s \u0438 port-forward)<\/li>\n\n\n\n<li>\u0441\u043b\u043e\u0436\u043d\u044b\u0435 \u043f\u0430\u0440\u043e\u043b\u0438 <\/li>\n<\/ul>\n\n\n\n<p>\u041f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u0432 \u0434\u043e\u043f\u0443\u0441\u0442\u0438\u043c\u043e\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0439 \u0432 PostgreSQL &#8212; 100.<\/p>\n\n\n\n<figure class=\"wp-block-image aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"800\" height=\"450\" src=\"https:\/\/aristov.tech\/blog\/wp-content\/uploads\/2024\/11\/image-8.png\" alt=\"\" class=\"wp-image-1468\" srcset=\"https:\/\/aristov.tech\/blog\/wp-content\/uploads\/2024\/11\/image-8.png 800w, https:\/\/aristov.tech\/blog\/wp-content\/uploads\/2024\/11\/image-8-300x169.png 300w, https:\/\/aristov.tech\/blog\/wp-content\/uploads\/2024\/11\/image-8-768x432.png 768w\" sizes=\"auto, (max-width: 800px) 100vw, 800px\" \/><\/figure>\n\n\n\n<p>\u042d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442 \u043f\u043e \u0443\u0432\u0435\u043b\u0438\u0447\u0435\u043d\u0438\u044e \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0430 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u0445 \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0439:<\/p>\n\n\n\n<figure class=\"wp-block-image aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"582\" src=\"https:\/\/aristov.tech\/blog\/wp-content\/uploads\/2024\/11\/image-9-1024x582.png\" alt=\"\" class=\"wp-image-1469\" srcset=\"https:\/\/aristov.tech\/blog\/wp-content\/uploads\/2024\/11\/image-9-1024x582.png 1024w, https:\/\/aristov.tech\/blog\/wp-content\/uploads\/2024\/11\/image-9-300x170.png 300w, https:\/\/aristov.tech\/blog\/wp-content\/uploads\/2024\/11\/image-9-768x436.png 768w, https:\/\/aristov.tech\/blog\/wp-content\/uploads\/2024\/11\/image-9.png 1458w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>\u0410\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u044b\u0439 \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442 \u043f\u0440\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438 pgbouncer:<\/p>\n\n\n\n<figure class=\"wp-block-image aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"587\" src=\"https:\/\/aristov.tech\/blog\/wp-content\/uploads\/2024\/11\/image-10-1024x587.png\" alt=\"\" class=\"wp-image-1470\" srcset=\"https:\/\/aristov.tech\/blog\/wp-content\/uploads\/2024\/11\/image-10-1024x587.png 1024w, https:\/\/aristov.tech\/blog\/wp-content\/uploads\/2024\/11\/image-10-300x172.png 300w, https:\/\/aristov.tech\/blog\/wp-content\/uploads\/2024\/11\/image-10-768x440.png 768w, https:\/\/aristov.tech\/blog\/wp-content\/uploads\/2024\/11\/image-10.png 1446w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>\u041f\u0440\u0438 \u0431\u043e\u043b\u044c\u0448\u043e\u043c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0435 \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0439 (&gt;300-400) \u0438\u043b\u0438 \u043f\u0440\u0438 \u0434\u0435\u0433\u0440\u0430\u0434\u0430\u0446\u0438\u0438 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u0438\u043c\u0435\u0435\u0442 \u0441\u043c\u044b\u0441\u043b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c pooler.<\/p>\n\n\n\n<p>Pooler &#8212; \u043b\u0435\u0433\u043a\u043e\u0432\u0435\u0441\u043d\u044b\u0435 \u043f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u044b\u0435 \u043a\u043e\u043d\u043d\u0435\u043a\u0442\u044b \u043e\u0442 \u0431\u044d\u043a\u0435\u043d\u0434\u043e\u0432 \u0438 \u043f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u044b\u0435 \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u044f \u0432 \u0411\u0414.<\/p>\n\n\n\n<p>\u041a\u043b\u0430\u0441\u0441\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u044b:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Pgpool II<\/li>\n\n\n\n<li>pg_bouncer + haproxy<\/li>\n\n\n\n<li>Odyssey<\/li>\n<\/ul>\n\n\n\n<p class=\"has-large-font-size\">Pgpool II<\/p>\n\n\n\n<p><a href=\"https:\/\/www.pgpool.net\/mediawiki\/index.php\/Main_Page\">Pgpool II<\/a> &#8212; \u043e\u0434\u0438\u043d \u0438\u0437 \u0441\u0430\u043c\u044b\u0445 \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u044b\u0445 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u043e\u0432<\/p>\n\n\n\n<p>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u0439 \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c \u0440\u0435\u043f\u043b\u0438\u043a\u0430\u0446\u0438\u0438, \u0435\u0441\u0442\u044c \u043f\u0443\u043b \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0439, \u0435\u0441\u0442\u044c \u0431\u0430\u043b\u0430\u043d\u0441\u0438\u0440\u043e\u0432\u0449\u0438\u043a \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u0438, \u043e\u0431\u043b\u0430\u0434\u0430\u0435\u0442 \u0432\u044b\u0441\u043e\u043a\u043e\u0439 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u043e\u0441\u0442\u044c\u044e (\u043d\u0430\u0431\u043b\u044e\u0434\u0430\u0442\u0435\u043b\u044c \u0441 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u043c IP, \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0435 \u043f\u0435\u0440\u0435\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u043c\u0430\u0441\u0442\u0435\u0440\u0430)<\/p>\n\n\n\n<p><a href=\"https:\/\/severalnines.com\/database-blog\/guide-pgpool-postgresql-part-one\">\u0418\u0437\u043b\u0438\u0448\u0435\u043a \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u0430 &#8212; \u043e\u0441\u043d\u043e\u0432\u043d\u0430\u044f \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 Pgpool2<\/a><\/p>\n\n\n\n<p class=\"has-large-font-size\">PgBouncer<\/p>\n\n\n\n<p><strong><a href=\"https:\/\/www.pgbouncer.org\/\">PgBouncer<\/a> <\/strong>&#8212; \u043f\u0443\u043b \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0439:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u043b\u0435\u0433\u043a\u043e\u0432\u0435\u0441\u043d\u044b\u0439 &#8212; 2 \u041a\u0431 \u043d\u0430 \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0435<\/li>\n\n\n\n<li>\u043c\u043e\u0436\u043d\u043e \u0432\u044b\u0431\u0440\u0430\u0442\u044c \u0442\u0438\u043f \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u044f: \u043d\u0430 \u0441\u0435\u0441\u0441\u0438\u044e, \u0442\u0440\u0430\u043d\u0437\u0430\u043a\u0446\u0438\u044e \u0438\u043b\u0438 \u043a\u0430\u0436\u0434\u0443\u044e \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u044e<\/li>\n\n\n\n<li>\u043e\u043d\u043b\u0430\u0439\u043d-\u0440\u0435\u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044f \u0431\u0435\u0437 \u0441\u0431\u0440\u043e\u0441\u0430 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0439<\/li>\n<\/ul>\n\n\n\n<p>PgBouncer \u0441\u043f\u0440\u043e\u0435\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u043d \u043e\u0434\u043d\u043e\u043f\u043e\u0442\u043e\u0447\u043d\u044b\u043c. \u041e\u043d \u0441\u0434\u0435\u043b\u0430\u043d \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e \u043f\u0440\u043e\u0441\u0442\u044b\u043c, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043d\u0435 \u043c\u0430\u0441\u0448\u0442\u0430\u0431\u0438\u0440\u0443\u0435\u043c. <\/p>\n\n\n\n<p>\u0424\u0443\u043d\u043a\u0446\u0438\u044f reuseport \u043f\u043e\u043c\u043e\u0433\u0430\u0435\u0442 \u043d\u0435 \u0432\u0441\u0435\u0433\u0434\u0430:<\/p>\n\n\n\n<figure class=\"wp-block-image aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"286\" src=\"https:\/\/aristov.tech\/blog\/wp-content\/uploads\/2024\/11\/image-11-1024x286.png\" alt=\"\" class=\"wp-image-1471\" srcset=\"https:\/\/aristov.tech\/blog\/wp-content\/uploads\/2024\/11\/image-11-1024x286.png 1024w, https:\/\/aristov.tech\/blog\/wp-content\/uploads\/2024\/11\/image-11-300x84.png 300w, https:\/\/aristov.tech\/blog\/wp-content\/uploads\/2024\/11\/image-11-768x214.png 768w, https:\/\/aristov.tech\/blog\/wp-content\/uploads\/2024\/11\/image-11.png 1178w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p><a href=\"https:\/\/habr.com\/ru\/articles\/498250\/\">\u0421\u0442\u0430\u0442\u044c\u044f \u043d\u0430 \u044d\u0442\u0443 \u0442\u0435\u043c\u0443<\/a><\/p>\n\n\n\n<p>\u0412\u0438\u0434\u0438\u043c \u043f\u043e\u0434\u043d\u044f\u0442\u044b\u0439 \u043a\u0430\u0441\u043a\u0430\u0434\u043e\u043c PgBouncer, \u0433\u0434\u0435 \u0443 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0438\u0439 Bouncer, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u043e-\u043f\u0440\u0435\u0436\u043d\u0435\u043c\u0443 \u0443\u043f\u0435\u0440\u0442 \u0432 \u043e\u0434\u043d\u043e \u044f\u0434\u0440\u043e. \u0412 \u043a\u0430\u0441\u043a\u0430\u0434\u0435 \u043c\u043e\u0436\u043d\u043e \u043e\u0431\u043e\u0439\u0442\u0438\u0441\u044c \u0431\u0435\u0437 \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0435\u0433\u043e PgBouncer, \u043d\u043e \u0442\u043e\u0433\u0434\u0430 connection pool \u0431\u0443\u0434\u0435\u0442 \u0432\u043d\u0443\u0442\u0440\u0438 \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430 PgBouncer.<\/p>\n\n\n\n<p>\u0412\u043d\u0435\u0448\u043d\u0438\u0439 \u0441\u043b\u043e\u0439 PgBouncer \u043e\u0431\u044b\u0447\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0434\u043b\u044f \u043f\u0440\u0438\u0435\u043c\u0430 \u0432\u043e\u043b\u043d\u044b TLS-\u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0439. TLS-\u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u044f \u2013 \u044d\u0442\u043e \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0442\u0440\u0435\u0431\u0443\u0435\u0442 \u0443\u0447\u0430\u0441\u0442\u0438\u0435 \u0446\u0435\u043d\u0442\u0440\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u0430 \u0437\u043d\u0430\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0431\u043e\u043b\u044c\u0448\u0435, \u0447\u0435\u043c \u0442\u0438\u043f\u0438\u0447\u043d\u043e\u0435 \u043f\u0435\u0440\u0435\u043a\u043b\u0430\u0434\u044b\u0432\u0430\u043d\u0438\u0435 \u0431\u0430\u0439\u0442\u043e\u0432 \u0438\u0437 \u0441\u043e\u043a\u0435\u0442\u0430 \u0432 \u0441\u043e\u043a\u0435\u0442. \u0422. \u0435. \u0434\u043b\u044f \u0446\u0435\u043d\u0442\u0440\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u0430 \u043f\u043e\u0442\u043e\u043a\u0438 \u0434\u0430\u043d\u043d\u044b\u0445, \u0438\u0437\u043c\u0435\u0440\u0435\u043d\u043d\u044b\u0435 \u0432 \u0431\u0430\u0439\u0442\u0430\u0445 \u0432 \u0441\u0435\u043a\u0443\u043d\u0434\u0443, \u043d\u0435 \u0437\u0430\u043c\u0435\u0442\u043d\u044b. \u041d\u043e \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u044c \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c \u043a\u0440\u0438\u043f\u0442\u043e\u0433\u0440\u0430\u0444\u0438\u044e \u043f\u0440\u0438 TLS handshake \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u0430.<\/p>\n\n\n\n<p><a href=\"https:\/\/scalegrid.io\/blog\/postgresql-connection-pooling-part-4-pgbouncer-vs-pgpool\/\">\u0421\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0435 PgBouncer \u0438 <\/a>Pgpool II.<\/p>\n\n\n\n<p class=\"has-large-font-size\">Odyssey<\/p>\n\n\n\n<p>\u0415\u0441\u043b\u0438 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0441\u0431\u0440\u043e\u0441\u0438\u043b\u043e \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u043a \u0411\u0414, \u0442\u043e PgBouncer \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0438\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c \u0442\u043e\u0442 \u0437\u0430\u043f\u0440\u043e\u0441, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u043b\u0441\u044f. \u041d\u0430 \u044d\u0442\u0443 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0443 \u043e\u0431\u0440\u0430\u0449\u0430\u043b\u0438 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u043c\u043d\u043e\u0433\u043e \u0440\u0430\u0437, \u0432 \u0442\u043e\u043c \u0447\u0438\u0441\u043b\u0435 &#8212; \u0430\u0432\u0442\u043e\u0440\u044b Odyssey.<\/p>\n\n\n\n<p><a href=\"https:\/\/github.com\/yandex\/odyssey\">Odyssey<\/a> &#8212; \u0431\u0435\u0441\u043f\u043b\u0430\u0442\u043d\u044b\u0439 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442 \u043e\u0442 \u042f\u043d\u0434\u0435\u043a\u0441\u0430.<\/p>\n\n\n\n<figure class=\"wp-block-image aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"797\" height=\"441\" src=\"https:\/\/aristov.tech\/blog\/wp-content\/uploads\/2024\/11\/image-12.png\" alt=\"\" class=\"wp-image-1472\" srcset=\"https:\/\/aristov.tech\/blog\/wp-content\/uploads\/2024\/11\/image-12.png 797w, https:\/\/aristov.tech\/blog\/wp-content\/uploads\/2024\/11\/image-12-300x166.png 300w, https:\/\/aristov.tech\/blog\/wp-content\/uploads\/2024\/11\/image-12-768x425.png 768w\" sizes=\"auto, (max-width: 797px) 100vw, 797px\" \/><\/figure>\n\n\n\n<p><a href=\"https:\/\/habr.com\/ru\/articles\/498250\/\">\u0420\u0430\u0437\u0431\u043e\u0440 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u044b.<\/a><\/p>\n\n\n\n<p class=\"has-large-font-size\">\u0414\u0440\u0443\u0433\u0438\u0435 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u044b<\/p>\n\n\n\n<p><a href=\"https:\/\/github.com\/agroal\/pgagroal\">pg agroal<\/a> \u2014 \u0432\u044b\u0441\u043e\u043a\u043e\u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u043f\u0443\u043b \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0439 \u0441 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u043e\u0439 \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b\u0430 PostgreSQL.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u041f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0439<\/li>\n\n\n\n<li>\u0412\u044b\u0441\u043e\u043a\u0430\u044f \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c<\/li>\n\n\n\n<li>\u041f\u0443\u043b \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0439<\/li>\n\n\n\n<li>\u041e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u0435 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0439 \u0434\u043b\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439 \u0438 \u0431\u0430\u0437 \u0434\u0430\u043d\u043d\u044b\u0445<\/li>\n\n\n\n<li>\u041f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0430 \u043f\u0440\u0435\u0434\u0432\u0430\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0433\u043e \u0437\u0430\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u043f\u0443\u043b\u0430<\/li>\n\n\n\n<li>\u0423\u0434\u0430\u043b\u0435\u043d\u0438\u0435 \u043d\u0435\u0430\u043a\u0442\u0438\u0432\u043d\u044b\u0445 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0439<\/li>\n<\/ul>\n\n\n\n<p>\u041d\u0435 \u0443\u043c\u0435\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441 \u043f\u044f\u0442\u0438\u0437\u043d\u0430\u0447\u043d\u044b\u043c \u043d\u043e\u043c\u0435\u0440\u043e\u043c \u043f\u043e\u0440\u0442\u0430.<\/p>\n\n\n\n<p><a href=\"https:\/\/github.com\/supabase\/supavisor\">Supavisor<\/a> &#8212; <a href=\"https:\/\/github.com\/supabase\/supavisor\">\u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0439 \u043d\u0430 GitHub<\/a><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u041b\u0438\u0446\u0435\u043d\u0437\u0438\u044f Apache 2.0<\/li>\n\n\n\n<li>\u0412\u044b\u0441\u043e\u043a\u0430\u044f \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u043e\u0441\u0442\u044c<\/li>\n\n\n\n<li>\u0411\u0443\u0444\u0435\u0440\u0438\u0437\u0430\u0446\u0438\u044f \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0439<\/li>\n\n\n\n<li>\u041e\u0431\u043b\u0430\u0447\u043d\u0430\u044f \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0430 (Cloud-native)<\/li>\n\n\n\n<li>\u041f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0430 \u043c\u043d\u043e\u0433\u043e\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u043e\u0439 \u0441\u0440\u0435\u0434\u044b (multi-tenant)<\/li>\n\n\n\n<li>\u041c\u0430\u0441\u0448\u0442\u0430\u0431\u0438\u0440\u0443\u0435\u043c\u043e\u0441\u0442\u044c<\/li>\n\n\n\n<li>\u0411\u0430\u043b\u0430\u043d\u0441\u0438\u0440\u043e\u0432\u043a\u0430 \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u0438<\/li>\n<\/ul>\n\n\n\n<p><a href=\"https:\/\/supabase.com\/blog\/supavisor-1-million\">1 \u043c\u043b\u043d \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0439<\/a><\/p>\n\n\n\n<p>\u0422\u0430\u043a\u0436\u0435 \u0432 \u043a\u0430\u0436\u0434\u044b\u0439 \u044f\u0437\u044b\u043a \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u044b \u0441\u0432\u043e\u0438 \u043f\u0443\u043b\u0435\u0440\u044b. \u041e\u0434\u043d\u0430\u043a\u043e \u044d\u0442\u043e \u043d\u0435 \u0443\u043d\u0438\u0432\u0435\u0440\u0441\u0430\u043b\u044c\u043d\u044b\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u0438 \u0438\u043c\u0435\u0435\u0442 \u0441\u0432\u043e\u0438 \u043f\u043e\u0434\u0432\u043e\u0434\u043d\u044b\u0435 \u043a\u0430\u043c\u043d\u0438.<\/p>\n\n\n\n<p><a href=\"https:\/\/www.enterprisedb.com\/blog\/what-3000-users-say-about-postgresql-tools-they-use\">\u0421\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f pooler<\/a><\/p>\n\n\n\n<figure class=\"wp-block-image aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"627\" src=\"https:\/\/aristov.tech\/blog\/wp-content\/uploads\/2024\/11\/image-13-1024x627.png\" alt=\"\" class=\"wp-image-1473\" srcset=\"https:\/\/aristov.tech\/blog\/wp-content\/uploads\/2024\/11\/image-13-1024x627.png 1024w, https:\/\/aristov.tech\/blog\/wp-content\/uploads\/2024\/11\/image-13-300x184.png 300w, https:\/\/aristov.tech\/blog\/wp-content\/uploads\/2024\/11\/image-13-768x470.png 768w, https:\/\/aristov.tech\/blog\/wp-content\/uploads\/2024\/11\/image-13.png 1128w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p class=\"has-x-large-font-size\"><strong>\u0412\u044b\u0431\u043e\u0440 \u0431\u0430\u043b\u0430\u043d\u0441\u0438\u0440\u043e\u0432\u0449\u0438\u043a\u0430<\/strong><\/p>\n\n\n\n<p>\u0412 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u0437\u0430\u0434\u0430\u0447\u0438 \u0438 \u043f\u0440\u043e\u0444\u0438\u043b\u044f \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u0442\u0435\u0441\u0442\u0438\u0440\u0443\u0435\u043c \u043d\u0430 \u0434\u0435\u0432 \u0441\u0442\u0435\u043d\u0434\u0435, \u043f\u043e\u043c\u043d\u044f \u043e\u0431 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u044f\u0445, \u043f\u043b\u044e\u0441\u0430\u0445 \u0438 \u043c\u0438\u043d\u0443\u0441\u0430\u0445.<\/p>\n\n\n\n<p>\u041e\u0431\u0440\u0430\u0449\u0430\u0439\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u043d\u0430:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043a\u043e\u043d\u043d\u0435\u043a\u0442\u043e\u0432<\/li>\n\n\n\n<li>\u043d\u0430\u0433\u0440\u0443\u0437\u043a\u0430 \u043d\u0430 \u0441\u0435\u0442\u044c\/\u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440<\/li>\n\n\n\n<li>\u043c\u0438\u043d\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u044f \u043e\u0431\u043c\u0435\u043d\u0430 \u0434\u0430\u043d\u043d\u044b\u043c\u0438 \u043f\u043e \u0441\u0435\u0442\u0438<\/li>\n\n\n\n<li>\u0443\u043c\u0435\u043d\u044c\u0448\u0435\u043d\u0438\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0430 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432<\/li>\n\n\n\n<li>\u0447\u0442\u0435\u043d\u0438\u0435 \u043c\u0435\u043d\u044c\u0448\u0435\u0433\u043e \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0430 \u0434\u0430\u043d\u043d\u044b\u0445<\/li>\n\n\n\n<li>\u043e\u0431\u043d\u043e\u0432\u043b\u044f\u0442\u044c \u043c\u0435\u043d\u044c\u0448\u0435 \u0434\u0430\u043d\u043d\u044b\u0445 (\u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e update insert \u0432 \u043e\u0434\u043d\u0443 \u0442\u0440\u0430\u043d\u0437\u0430\u043a\u0446\u0438\u044e)<\/li>\n\n\n\n<li>\u0443\u043c\u0435\u043d\u044c\u0448\u0435\u043d\u0438\u0435 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u043d\u0430 \u043b\u0435\u0442\u0443 &#8212; \u0445\u0440\u0430\u043d\u0438\u043c\u044b\u0435 \u043f\u0440\u043e\u0446\u0435\u0434\u0443\u0440\u044b<\/li>\n\n\n\n<li>\u0430\u043d\u0430\u043b\u0438\u0437 \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0438 \u0434\u0430\u043d\u043d\u044b\u0445\n<ul class=\"wp-block-list\">\n<li>\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0434\u0430\u043d\u043d\u044b\u0445 \u0431\u044b\u043b\u043e \u043f\u0440\u043e\u0441\u043a\u0430\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u043e &#8212; \u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043e\u0442\u043e\u0441\u043b\u0430\u043d\u043e<\/li>\n\n\n\n<li>\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0431\u044b\u043b\u043e \u043e\u0442\u043e\u0441\u043b\u0430\u043d\u043e &#8212;&nbsp; \u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435\u043c<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n\n\n\n<p>\u0421\u043e\u0432\u0435\u0442\u044b:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u0431\u044d\u043a\u0430\u043f \u0441\u043d\u0438\u043c\u0430\u0435\u043c \u0441 secondary<\/li>\n\n\n\n<li>\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0439\u0442\u0435 \u043a\u0430\u0441\u043a\u0430\u0434\u043d\u0443\u044e \u0440\u0435\u043f\u043b\u0438\u043a\u0430\u0446\u0438\u044e<\/li>\n\n\n\n<li>\u0434\u043b\u044f OLAP \u0434\u0435\u043b\u0430\u0439\u0442\u0435 \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u0443\u044e \u0440\u0435\u043f\u043b\u0438\u043a\u0443, \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u044c clickhouse<\/li>\n\n\n\n<li>\u043d\u0435 \u0437\u0430\u0431\u044b\u0432\u0430\u0439\u0442\u0435 \u043f\u0440\u043e \u0433\u0435\u043e\u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u0438<\/li>\n\n\n\n<li>\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0439\u0442\u0435 LT-\u0441\u0442\u0435\u043d\u0434\u044b (<a href=\"https:\/\/habr.com\/ru\/companies\/rtlabs\/articles\/577580\/\">\u0421\u0442\u0435\u043d\u0434 \u0434\u043b\u044f \u043d\u0430\u0433\u0440\u0443\u0437\u043e\u0447\u043d\u043e\u0433\u043e \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f: \u043e\u0442 DEV \u0434\u043e PROD<\/a> )<\/li>\n<\/ul>\n\n\n\n<figure class=\"wp-block-image aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"800\" height=\"450\" src=\"https:\/\/aristov.tech\/blog\/wp-content\/uploads\/2024\/11\/image-14.png\" alt=\"\" class=\"wp-image-1474\" srcset=\"https:\/\/aristov.tech\/blog\/wp-content\/uploads\/2024\/11\/image-14.png 800w, https:\/\/aristov.tech\/blog\/wp-content\/uploads\/2024\/11\/image-14-300x169.png 300w, https:\/\/aristov.tech\/blog\/wp-content\/uploads\/2024\/11\/image-14-768x432.png 768w\" sizes=\"auto, (max-width: 800px) 100vw, 800px\" \/><\/figure>\n\n\n\n<p class=\"has-x-large-font-size\"><strong>SSL \u0438 \u0442\u0435\u0440\u043c\u0438\u043d\u0430\u0446\u0438\u044f \u0442\u0440\u0430\u0444\u0438\u043a\u0430<\/strong><\/p>\n\n\n\n<p>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 <a href=\"https:\/\/en.wikipedia.org\/wiki\/Transport_Layer_Security\">TLS<\/a>\/SSL (Secure Socket Layer) \u0434\u043b\u044f \u0437\u0430\u0449\u0438\u0449\u0435\u043d\u043d\u043e\u0433\u043e \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u044f \u0441 PostgreSQL \u0432\u043d\u0443\u0442\u0440\u0438 \u0437\u0430\u043a\u0440\u044b\u0442\u043e\u0439 \u043f\u0435\u0440\u0438\u043c\u0435\u0442\u0440\u0438\u0438 (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0432\u043d\u0443\u0442\u0440\u0438 \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0439 \u0441\u0435\u0442\u0438 \u0438\u043b\u0438 \u0441\u0435\u0442\u0438 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0445 \u043c\u0430\u0448\u0438\u043d) \u0438\u043c\u0435\u0435\u0442 \u0441\u0432\u043e\u0438 \u043f\u043b\u044e\u0441\u044b \u0438 \u043c\u0438\u043d\u0443\u0441\u044b.<\/p>\n\n\n\n<p>\u041f\u043b\u044e\u0441\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f SSL:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>\u0428\u0438\u0444\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0445<\/strong>: SSL \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0432\u0430\u0435\u0442 \u0448\u0438\u0444\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0445 \u043c\u0435\u0436\u0434\u0443 \u043a\u043b\u0438\u0435\u043d\u0442\u043e\u043c \u0438 \u0441\u0435\u0440\u0432\u0435\u0440\u043e\u043c, \u0447\u0442\u043e \u0434\u0435\u043b\u0430\u0435\u0442 \u043f\u0435\u0440\u0435\u0445\u0432\u0430\u0442 \u0438 \u0443\u0442\u0435\u0447\u043a\u0443 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u0431\u043e\u043b\u0435\u0435 \u0441\u043b\u043e\u0436\u043d\u044b\u043c\u0438 \u0434\u043b\u044f \u0437\u043b\u043e\u0443\u043c\u044b\u0448\u043b\u0435\u043d\u043d\u0438\u043a\u043e\u0432, \u0434\u0430\u0436\u0435 \u0435\u0441\u043b\u0438 \u043e\u043d\u0438 \u0438\u043c\u0435\u044e\u0442 \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0435\u0439 \u0441\u0435\u0442\u0438.<\/li>\n\n\n\n<li><strong>\u0414\u043e\u0432\u0435\u0440\u0438\u0435 \u0438 \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u044c<\/strong>: \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 SSL \u043f\u043e\u043c\u043e\u0433\u0430\u0435\u0442 \u043f\u043e\u0434\u0442\u0432\u0435\u0440\u0434\u0438\u0442\u044c \u043f\u043e\u0434\u043b\u0438\u043d\u043d\u043e\u0441\u0442\u044c \u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u043f\u0435\u0440\u0435\u0434 \u043a\u043b\u0438\u0435\u043d\u0442\u043e\u043c \u0438 \u0441\u043e\u0437\u0434\u0430\u0435\u0442 \u0434\u043e\u0432\u0435\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u043a\u0430\u043d\u0430\u043b \u0434\u043b\u044f \u043e\u0431\u043c\u0435\u043d\u0430 \u0434\u0430\u043d\u043d\u044b\u043c\u0438. \u042d\u0442\u043e \u0437\u0430\u0449\u0438\u0449\u0430\u0435\u0442 \u043e\u0442 \u0430\u0442\u0430\u043a &#171;\u0447\u0435\u043b\u043e\u0432\u0435\u043a \u043f\u043e\u0441\u0435\u0440\u0435\u0434\u0438\u043d\u0435&#187; (<a href=\"https:\/\/en.wikipedia.org\/wiki\/Man-in-the-middle_attack\">Man-in-the-Middle<\/a>) \u0438 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 \u0446\u0435\u043b\u043e\u0441\u0442\u043d\u043e\u0441\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0445.<\/li>\n\n\n\n<li><strong>\u0421\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u0435 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u0430\u043c \u0438 \u043d\u043e\u0440\u043c\u0430\u043c<\/strong>: \u0412 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u0432\u0430\u0448\u0435\u0439 \u043e\u0442\u0440\u0430\u0441\u043b\u0438 \u0438 \u0437\u0430\u043a\u043e\u043d\u043e\u0434\u0430\u0442\u0435\u043b\u044c\u0441\u0442\u0432\u0430, \u0432\u0430\u043c \u043c\u043e\u0436\u0435\u0442 \u043f\u043e\u0442\u0440\u0435\u0431\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0448\u0438\u0444\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0445, \u0434\u0430\u0436\u0435 \u0435\u0441\u043b\u0438 \u043e\u043d\u0438 \u043f\u0435\u0440\u0435\u0434\u0430\u044e\u0442\u0441\u044f \u0432\u043d\u0443\u0442\u0440\u0438 \u0437\u0430\u043a\u0440\u044b\u0442\u043e\u0439 \u0441\u0435\u0442\u0438. \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 SSL \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u0430\u043c \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u0438 \u0434\u0430\u043d\u043d\u044b\u0445.<\/li>\n\n\n\n<li><strong>\u0417\u0430\u0449\u0438\u0442\u0430 \u043e\u0442 \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0438\u0445 \u0443\u0433\u0440\u043e\u0437<\/strong>: \u0412\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0438\u0435 \u0443\u0433\u0440\u043e\u0437\u044b, \u0442\u0430\u043a\u0438\u0435 \u043a\u0430\u043a \u0437\u043b\u043e\u0443\u043c\u044b\u0448\u043b\u0435\u043d\u043d\u0438\u043a\u0438 \u0432\u043d\u0443\u0442\u0440\u0438 \u0441\u0435\u0442\u0438, \u043c\u043e\u0433\u0443\u0442 \u043f\u043e\u043f\u044b\u0442\u0430\u0442\u044c\u0441\u044f \u043f\u0435\u0440\u0435\u0445\u0432\u0430\u0442\u0438\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u0438\u043b\u0438 \u043e\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0438\u0442\u044c \u0430\u0442\u0430\u043a\u0438 \u043d\u0430 \u0431\u0430\u0437\u0443 \u0434\u0430\u043d\u043d\u044b\u0445. SSL \u043f\u043e\u043c\u043e\u0433\u0430\u0435\u0442 \u0443\u043c\u0435\u043d\u044c\u0448\u0438\u0442\u044c \u0440\u0438\u0441\u043a\u0438 \u0442\u0430\u043a\u0438\u0445 \u0430\u0442\u0430\u043a.<\/li>\n<\/ul>\n\n\n\n<p>\u041c\u0438\u043d\u0443\u0441\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f SSL \u0432\u043d\u0443\u0442\u0440\u0438 \u0437\u0430\u043a\u0440\u044b\u0442\u043e\u0439 \u043f\u0435\u0440\u0438\u043c\u0435\u0442\u0440\u0438\u0438:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>\u0414\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u0430\u044f \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u0430<\/strong> \u043d\u0430 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c: \u0428\u0438\u0444\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0438 \u0440\u0430\u0441\u0448\u0438\u0444\u0440\u043e\u0432\u043a\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 \u043c\u043e\u0436\u0435\u0442 \u0432\u044b\u0437\u0432\u0430\u0442\u044c \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u0443\u044e \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u0443 \u043d\u0430 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u0441\u0435\u0440\u0432\u0435\u0440\u0430 PostgreSQL. \u0412 \u0437\u0430\u043a\u0440\u044b\u0442\u043e\u0439 \u0441\u0435\u0442\u0438 \u044d\u0442\u0430 \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u0430 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0438\u0437\u043b\u0438\u0448\u043d\u0435\u0439.<\/li>\n\n\n\n<li><strong>\u0421\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438<\/strong>: \u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 SSL \u0442\u0440\u0435\u0431\u0443\u0435\u0442 \u043d\u0430\u043b\u0438\u0447\u0438\u044f \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u044b\u0445 \u0441\u0435\u0440\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0432, \u0438 \u044d\u0442\u043e \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0441\u043b\u043e\u0436\u043d\u043e \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0438\u0445 \u0441\u0435\u0442\u0435\u0439. \u041d\u0435\u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u0430\u044f \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 \u043c\u043e\u0436\u0435\u0442 \u043f\u0440\u0438\u0432\u0435\u0441\u0442\u0438 \u043a \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430\u043c \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u044f.<\/li>\n\n\n\n<li><strong>\u0423\u0432\u0435\u043b\u0438\u0447\u0435\u043d\u0438\u0435 \u0441\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u043e\u0431\u0441\u043b\u0443\u0436\u0438\u0432\u0430\u043d\u0438\u044f<\/strong>: \u0412\u043d\u0435\u0434\u0440\u0435\u043d\u0438\u0435 SSL \u0443\u0432\u0435\u043b\u0438\u0447\u0438\u0432\u0430\u0435\u0442 \u0441\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 \u0438 \u043e\u0431\u0441\u043b\u0443\u0436\u0438\u0432\u0430\u043d\u0438\u044f \u0431\u0430\u0437\u044b \u0434\u0430\u043d\u043d\u044b\u0445. \u042d\u0442\u043e \u043c\u043e\u0436\u0435\u0442 \u043f\u043e\u0442\u0440\u0435\u0431\u043e\u0432\u0430\u0442\u044c \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u0448\u0430\u0433\u043e\u0432 \u043f\u0440\u0438 \u0440\u0430\u0437\u0432\u0435\u0440\u0442\u044b\u0432\u0430\u043d\u0438\u0438 \u0438 \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0438.<\/li>\n\n\n\n<li><strong>\u0417\u0430\u0442\u0440\u0430\u0442\u044b \u043d\u0430 \u0440\u0435\u0441\u0443\u0440\u0441\u044b<\/strong>: \u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0438 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0441\u0435\u0440\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u0430\u043c\u0438 \u0442\u0440\u0435\u0431\u0443\u0435\u0442 \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0438 \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0432. \u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u0432\u0430\u043c \u043f\u043e\u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u043d\u0430\u043b\u0438\u0447\u0438\u0435 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0439 \u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0441\u0435\u0440\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u0430\u043c\u0438.<\/li>\n<\/ul>\n\n\n\n<p>\u0412 \u0446\u0435\u043b\u043e\u043c, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 SSL \u0432\u043d\u0443\u0442\u0440\u0438 \u0437\u0430\u043a\u0440\u044b\u0442\u043e\u0439 \u043f\u0435\u0440\u0438\u043c\u0435\u0442\u0440\u0438\u0438 \u0438\u043c\u0435\u0435\u0442 \u0441\u043c\u044b\u0441\u043b, \u0435\u0441\u043b\u0438 \u0432\u044b \u0441\u0442\u0440\u0435\u043c\u0438\u0442\u0435\u0441\u044c \u043a \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0435\u043d\u0438\u044e \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0433\u043e \u0443\u0440\u043e\u0432\u043d\u044f \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u0438, \u0437\u0430\u0449\u0438\u0442\u044b \u0434\u0430\u043d\u043d\u044b\u0445 \u0438 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u044f \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u0430\u043c. \u041e\u0434\u043d\u0430\u043a\u043e \u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u0442\u0449\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u0432\u0437\u0432\u0435\u0441\u0438\u0442\u044c \u043f\u043b\u044e\u0441\u044b \u0438 \u043c\u0438\u043d\u0443\u0441\u044b \u0432 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u0438 \u0441 \u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u044f\u043c\u0438 \u0432\u0430\u0448\u0435\u0439 \u043e\u0440\u0433\u0430\u043d\u0438\u0437\u0430\u0446\u0438\u0438 \u0438 \u0441\u0435\u0442\u0435\u0432\u043e\u0439 \u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u043e\u0439.<\/p>\n\n\n\n<p><a href=\"https:\/\/habr.com\/ru\/companies\/vk\/articles\/500708\/\">\u0411\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u044c \u0438 \u0421\u0423\u0411\u0414: \u043e \u0447\u0451\u043c \u043d\u0430\u0434\u043e \u043f\u043e\u043c\u043d\u0438\u0442\u044c, \u043f\u043e\u0434\u0431\u0438\u0440\u0430\u044f \u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0430 \u0437\u0430\u0449\u0438\u0442\u044b<\/a><\/p>\n\n\n\n<figure class=\"wp-block-image aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"677\" src=\"https:\/\/aristov.tech\/blog\/wp-content\/uploads\/2024\/11\/image-15-1024x677.png\" alt=\"\" class=\"wp-image-1475\" srcset=\"https:\/\/aristov.tech\/blog\/wp-content\/uploads\/2024\/11\/image-15-1024x677.png 1024w, https:\/\/aristov.tech\/blog\/wp-content\/uploads\/2024\/11\/image-15-300x198.png 300w, https:\/\/aristov.tech\/blog\/wp-content\/uploads\/2024\/11\/image-15-768x508.png 768w, https:\/\/aristov.tech\/blog\/wp-content\/uploads\/2024\/11\/image-15.png 1240w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p><a href=\"https:\/\/habr.com\/ru\/articles\/550882\/\">\u041e\u0431\u0435\u0441\u043f\u0435\u0447\u0435\u043d\u0438\u0435<\/a><a href=\"https:\/\/habr.com\/ru\/articles\/550882\/\"> <\/a><a href=\"https:\/\/habr.com\/ru\/articles\/550882\/\">\u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u0438<\/a><a href=\"https:\/\/habr.com\/ru\/articles\/550882\/\"> <\/a><a href=\"https:\/\/habr.com\/ru\/articles\/550882\/\">\u0431\u0430\u0437\u044b<\/a><a href=\"https:\/\/habr.com\/ru\/articles\/550882\/\"> <\/a><a href=\"https:\/\/habr.com\/ru\/articles\/550882\/\">\u0434\u0430\u043d\u043d\u044b\u0445<\/a><a href=\"https:\/\/habr.com\/ru\/articles\/550882\/\"> PostgreSQL<\/a><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u0411\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u044c \u043d\u0430 \u0441\u0435\u0442\u0435\u0432\u043e\u043c \u0443\u0440\u043e\u0432\u043d\u0435<\/li>\n\n\n\n<li>\u0411\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u044c \u043d\u0430 \u0442\u0440\u0430\u043d\u0441\u043f\u043e\u0440\u0442\u043d\u043e\u043c \u0443\u0440\u043e\u0432\u043d\u0435<\/li>\n\n\n\n<li>\u0411\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u044c \u043d\u0430 \u0443\u0440\u043e\u0432\u043d\u0435 \u0431\u0430\u0437\u044b \u0434\u0430\u043d\u043d\u044b\u0445<\/li>\n<\/ul>\n\n\n\n<p class=\"has-x-large-font-size\"><strong>\u0411\u0430\u043b\u0430\u043d\u0441\u0438\u0440\u0443\u0435\u043c \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u0443<\/strong><\/p>\n\n\n\n<p>\u0421\u0442\u043e\u0438\u0442 \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c <a href=\"https:\/\/www.haproxy.org\/\">HAPROXY <\/a>\u0434\u043b\u044f <a href=\"https:\/\/www.percona.com\/blog\/2018\/10\/02\/scaling-postgresql-using-connection-poolers-and-load-balancers-for-an-enterprise-grade-environment\">\u0431\u0430\u043b\u0430\u043d\u0441\u0438\u043d\u0433\u0430 \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u0438<\/a><\/p>\n\n\n\n<p>\u0415\u0449\u0435 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u044b \u0431\u0430\u043b\u0430\u043d\u0441\u0435\u0440\u043e\u0432:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u0438\u043b\u0438 \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u0439 GLB \u0432 \u043e\u0431\u043b\u0430\u043a\u043e \u0438\u043b\u0438 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u044b:<\/li>\n\n\n\n<li><a href=\"https:\/\/docs.nginx.com\/nginx\/admin-guide\/load-balancer\/http-load-balancer\/\">NGINX<\/a><\/li>\n<\/ul>\n\n\n\n<p class=\"has-large-font-size\">\u0412\u0430\u0440\u0438\u0430\u043d\u0442\u044b \u0431\u0430\u043b\u0430\u043d\u0441\u0438\u0440\u043e\u0432\u043a\u0438<\/p>\n\n\n\n<p>\u041f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u0445\u043e\u0434\u0438\u0442 \u043d\u0430 HaProxy, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0437\u043d\u0430\u0435\u0442, \u0433\u0434\u0435 master \u0438 slave, \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442 \u0442\u0440\u0430\u0444\u0438\u043a \u043d\u0430 PgBouncer, \u0430 \u0442\u043e\u0442 \u043d\u0430 PostgreSQL.<\/p>\n\n\n\n<figure class=\"wp-block-image aligncenter size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"916\" height=\"599\" src=\"https:\/\/aristov.tech\/blog\/wp-content\/uploads\/2024\/11\/image-16.png\" alt=\"\" class=\"wp-image-1476\" style=\"width:414px;height:auto\" srcset=\"https:\/\/aristov.tech\/blog\/wp-content\/uploads\/2024\/11\/image-16.png 916w, https:\/\/aristov.tech\/blog\/wp-content\/uploads\/2024\/11\/image-16-300x196.png 300w, https:\/\/aristov.tech\/blog\/wp-content\/uploads\/2024\/11\/image-16-768x502.png 768w\" sizes=\"auto, (max-width: 916px) 100vw, 916px\" \/><\/figure>\n\n\n\n<p>\u0412\u0441\u0435 \u0445\u043e\u0434\u044f\u0442 \u043d\u0430 PgBouncer, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442 \u0442\u0440\u0430\u0444\u0438\u043a \u043d\u0430 HaProxy. HaProxy \u0436\u0435 \u0437\u043d\u0430\u0435\u0442, \u0433\u0434\u0435 master \u0438 slave. PgBouncer \u043c\u043e\u0436\u0435\u0442 \u0441\u0442\u0430\u0442\u044c \u0443\u0437\u043a\u0438\u043c \u0433\u043e\u0440\u043b\u044b\u0448\u043a\u043e\u043c.<\/p>\n\n\n\n<figure class=\"wp-block-image aligncenter size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"774\" height=\"728\" src=\"https:\/\/aristov.tech\/blog\/wp-content\/uploads\/2024\/11\/image-17.png\" alt=\"\" class=\"wp-image-1477\" style=\"width:424px;height:auto\" srcset=\"https:\/\/aristov.tech\/blog\/wp-content\/uploads\/2024\/11\/image-17.png 774w, https:\/\/aristov.tech\/blog\/wp-content\/uploads\/2024\/11\/image-17-300x282.png 300w, https:\/\/aristov.tech\/blog\/wp-content\/uploads\/2024\/11\/image-17-768x722.png 768w\" sizes=\"auto, (max-width: 774px) 100vw, 774px\" \/><\/figure>\n\n\n\n<p>\u0415\u0449\u0451 \u043e\u0434\u0438\u043d \u0432\u0430\u0440\u0438\u0430\u043d\u0442 &#8212; \u0435\u0441\u0442\u044c \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u044b\u0439 load balancer. PgBouncer \u0438 HaProxy &#8212; \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0435 \u043d\u043e\u0434\u044b. HaProxy \u0437\u043d\u0430\u0435\u0442, \u0433\u0434\u0435 master \u0438 slave. PgBouncer \u0445\u043e\u0434\u0438\u0442 \u043d\u0430 \u043d\u0443\u0436\u043d\u0443\u044e \u043d\u043e\u0434\u0443. \u041e\u0442\u043a\u0430\u0437\u043e\u0443\u0441\u0442\u043e\u0439\u0447\u0438\u0432\u044b\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442.<\/p>\n\n\n\n<figure class=\"wp-block-image aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"680\" src=\"https:\/\/aristov.tech\/blog\/wp-content\/uploads\/2024\/11\/image-18-1024x680.png\" alt=\"\" class=\"wp-image-1478\" srcset=\"https:\/\/aristov.tech\/blog\/wp-content\/uploads\/2024\/11\/image-18-1024x680.png 1024w, https:\/\/aristov.tech\/blog\/wp-content\/uploads\/2024\/11\/image-18-300x199.png 300w, https:\/\/aristov.tech\/blog\/wp-content\/uploads\/2024\/11\/image-18-768x510.png 768w, https:\/\/aristov.tech\/blog\/wp-content\/uploads\/2024\/11\/image-18.png 1406w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p class=\"has-x-large-font-size\"><strong>\u041f\u0440\u0430\u043a\u0442\u0438\u043a\u0430<\/strong><\/p>\n\n\n\n<p>\u0420\u0430\u0437\u0432\u0435\u0440\u043d\u0435\u043c \u0412\u041c \u043d\u0430 4 \u044f\u0434\u0440\u0430 \u0438 16 \u0413\u0411 \u043f\u0430\u043c\u044f\u0442\u0438 \u0438 \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u0438\u043c postgres 16 \u0432\u0435\u0440\u0441\u0438\u0438.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\u0417\u0430\u0439\u0434\u0435\u043c \u043f\u043e\u0434 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u043c postgres:<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo su postgres<\/code><\/pre>\n\n\n\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u043c config, \u0440\u0430\u0441\u0441\u0447\u0438\u0442\u0430\u043d\u043d\u044b\u0439 \u0432 <a href=\"https:\/\/pgconfigurator.cybertec-postgresql.com\/\">\u043a\u0430\u043b\u044c\u043a\u0443\u043b\u044f\u0442\u043e\u0440\u0435<\/a> \u0434\u043b\u044f \u043d\u0430\u0448\u0435\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u044b:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>cat &gt;&gt; \/etc\/postgresql\/16\/main\/postgresql.conf &lt;&lt; EOL\nshared_buffers = '4096 MB'\nwork_mem = '32 MB'\nmaintenance_work_mem = '320 MB'\nhuge_pages = off\neffective_cache_size = '11 GB'\neffective_io_concurrency = 100 # concurrent IO only really activated if OS supports posix_fadvise function\nrandom_page_cost = 1.1 # speed of random disk access relative to sequential access (1.0)\n\n#Monitoring\nshared_preload_libraries = 'pg_stat_statements'    # per statement resource usage stats\ntrack_io_timing=on        # measure exact block IO times\ntrack_functions=pl        # track execution times of pl-language procedures if any\n\n#Replication\nwal_level = replica\t\t# consider using at least 'replica'\nmax_wal_senders = 0\nsynchronous_commit = on\n# Checkpointing: \ncheckpoint_timeout  = '15 min' \ncheckpoint_completion_target = 0.9\nmax_wal_size = '1024 MB'\nmin_wal_size = '512 MB'\n#WAL writing\nwal_compression = on\nwal_buffers = -1    # auto-tuned by Postgres till maximum of segment size (16MB by default)\nwal_writer_delay = 200ms\nwal_writer_flush_after = 1MB\n\n#Background writer\nbgwriter_delay = 200ms\nbgwriter_lru_maxpages = 100\nbgwriter_lru_multiplier = 2.0\nbgwriter_flush_after = 0\n# Parallel queries: \nmax_worker_processes = 4\nmax_parallel_workers_per_gather = 2\nmax_parallel_maintenance_workers = 2\nmax_parallel_workers = 4\nparallel_leader_participation = on\n\n#Advanced features \nenable_partitionwise_join = on \nenable_partitionwise_aggregate = on\njit = on\nmax_slot_wal_keep_size = '1000 MB'\ntrack_wal_io_timing = on\nmaintenance_io_concurrency = 100\nEOL<\/code><\/pre>\n\n\n\n<p>\u041f\u0435\u0440\u0435\u0437\u0430\u043f\u0443\u0441\u043a \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u0430:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>pg_ctlcluster 16 main stop &amp;&amp; pg_ctlcluster 16 main start<\/code><\/pre>\n\n\n\n<p>\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043c \u043c\u0438\u043d\u0438 \u0432\u0435\u0440\u0441\u0438\u044e <a href=\"https:\/\/github.com\/aeuge\/postgres16book\/tree\/main\/database\">\u043c\u043e\u0435\u0439 \u0431\u0430\u0437\u044b \u0434\u0430\u043d\u043d\u044b\u0445<\/a> \u0441 \u0442\u0430\u0439\u0441\u043a\u0438\u043c\u0438 \u043f\u0435\u0440\u0435\u0432\u043e\u0437\u043a\u0430\u043c\u0438:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>cd ~ &amp;&amp; wget https:\/\/storage.googleapis.com\/thaibus\/thai_small.tar.gz &amp;&amp; tar -xf thai_small.tar.gz &amp;&amp; psql &lt; thai.sql<\/code><\/pre>\n\n\n\n<p>\u041f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u0438\u043c \u043d\u0430\u0433\u0440\u0443\u0437\u043e\u0447\u043d\u044b\u0439 \u0441\u043a\u0440\u0438\u043f\u0442 (\u0432 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u043d\u043e\u0439 \u0431\u0430\u0437\u0435 \u0432\u044b\u0431\u0438\u0440\u0430\u0435\u043c \u043b\u044e\u0431\u0443\u044e \u043f\u043e\u0435\u0437\u0434\u043a\u0443):<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>cat &gt; ~\/workload.sql &lt;&lt; EOL\n\\set r random(1, 5000000)\nSELECT id, fkRide, fio, contact, fkSeat FROM book.tickets WHERE id = :r;\nEOL<\/code><\/pre>\n\n\n\n<p>\u0422\u0435\u0441\u0442\u0438\u0440\u0443\u0435\u043c:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\/usr\/lib\/postgresql\/16\/bin\/pgbench -c 8 -j 4 -T 10 -f ~\/workload.sql -n -U postgres thai<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"256\" src=\"https:\/\/aristov.tech\/blog\/wp-content\/uploads\/2024\/11\/image-19-1024x256.png\" alt=\"\" class=\"wp-image-1480\" srcset=\"https:\/\/aristov.tech\/blog\/wp-content\/uploads\/2024\/11\/image-19-1024x256.png 1024w, https:\/\/aristov.tech\/blog\/wp-content\/uploads\/2024\/11\/image-19-300x75.png 300w, https:\/\/aristov.tech\/blog\/wp-content\/uploads\/2024\/11\/image-19-768x192.png 768w, https:\/\/aristov.tech\/blog\/wp-content\/uploads\/2024\/11\/image-19.png 1158w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u0440\u0430\u0437\u0432\u0435\u0440\u043d\u0435\u043c pg_bouncer:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo DEBIAN_FRONTEND=noninteractive apt install -y pgbouncer<\/code><\/pre>\n\n\n\n<p>\u0421\u043c\u043e\u0442\u0440\u0438\u043c \u0441\u0442\u0430\u0442\u0443\u0441:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo systemctl status pgbouncer<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"247\" src=\"https:\/\/aristov.tech\/blog\/wp-content\/uploads\/2024\/11\/image-20-1024x247.png\" alt=\"\" class=\"wp-image-1481\" srcset=\"https:\/\/aristov.tech\/blog\/wp-content\/uploads\/2024\/11\/image-20-1024x247.png 1024w, https:\/\/aristov.tech\/blog\/wp-content\/uploads\/2024\/11\/image-20-300x72.png 300w, https:\/\/aristov.tech\/blog\/wp-content\/uploads\/2024\/11\/image-20-768x186.png 768w, https:\/\/aristov.tech\/blog\/wp-content\/uploads\/2024\/11\/image-20.png 1043w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043e\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo systemctl stop pgbouncer <\/code><\/pre>\n\n\n\n<p>\u041f\u0440\u043e\u043f\u0438\u0448\u0435\u043c config \u0444\u0430\u0439\u043b (\u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0442\u044c\u0441\u044f \u0431\u0443\u0434\u0435\u043c \u0442\u043e\u043b\u044c\u043a\u043e \u043a \u0411\u0414 thai, logfile, pidfile, listen_port, admin_users):<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>cat &gt; temp.cfg &lt;&lt; EOF \n&#91;databases]\nthai = host=127.0.0.1 port=5432 dbname=thai\n&#91;pgbouncer]\nlogfile = \/var\/log\/postgresql\/pgbouncer.log\npidfile = \/var\/run\/postgresql\/pgbouncer.pid\nlisten_addr = *\nlisten_port = 6432\n#auth_type = md5\nauth_type = scram-sha-256\nauth_file = \/etc\/pgbouncer\/userlist.txt\nadmin_users = admindb\nEOF\ncat temp.cfg | sudo tee -a \/etc\/pgbouncer\/pgbouncer.ini<\/code><\/pre>\n\n\n\n<p>\u041d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u043c \u043f\u0430\u0440\u043e\u043b\u0438:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>cat &gt; temp2.cfg &lt;&lt; EOF\n\"admindb\" \"admin123#\"\n\"admindb2\" \"md5a1edc6f635a68ce9926870fe752e8f2b\"\n\"postgres\" \"admin123#\"\n\"postgres2\" \"SCRAM-SHA-256$4096:eM1ToRH8QOewbDddWnxzBQ==$ktPLPRkEPtMr1epwtJv1HxVHAxjsM+KEbLaW7loiBQs=:UMtetDFOi30NB56aX4JBT3lXudOClkANX02Xxhjjg1U=\"\nEOF\ncat temp2.cfg | sudo tee -a \/etc\/pgbouncer\/userlist.txt<\/code><\/pre>\n\n\n\n<p>\u0421\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0442\u0440\u0435\u0445 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439, \u0430 \u0435\u0449\u0451 \u043e\u0434\u043d\u043e\u043c\u0443 \u0441\u043c\u0435\u043d\u0438\u043c \u043f\u0430\u0440\u043e\u043b\u044c:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo -u postgres psql -c \"ALTER USER postgres WITH PASSWORD 'admin123#';\";<br>sudo -u postgres psql -c \"create user postgres2 with password 'admin123#';\";<br>sudo -u postgres psql -c \"create user admindb with password 'admin123#';\";<br>sudo -u postgres psql -c \"create user admindb2 with password 'md5a1edc6f635a68ce9926870fe752e8f2b';\";<\/code><\/pre>\n\n\n\n<p>\u041f\u0440\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c pg_shadow:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo -u postgres psql -c \"select usename,passwd from pg_shadow;\"<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"306\" src=\"https:\/\/aristov.tech\/blog\/wp-content\/uploads\/2024\/11\/image-21-1024x306.png\" alt=\"\" class=\"wp-image-1482\" srcset=\"https:\/\/aristov.tech\/blog\/wp-content\/uploads\/2024\/11\/image-21-1024x306.png 1024w, https:\/\/aristov.tech\/blog\/wp-content\/uploads\/2024\/11\/image-21-300x90.png 300w, https:\/\/aristov.tech\/blog\/wp-content\/uploads\/2024\/11\/image-21-768x229.png 768w, https:\/\/aristov.tech\/blog\/wp-content\/uploads\/2024\/11\/image-21.png 1106w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>\u041c\u043e\u0436\u043d\u043e \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e \u043f\u0440\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0445\u044d\u0448\u0438 \u043f\u043e \u0448\u0438\u0444\u0440\u043e\u0432\u0430\u043d\u0438\u044e:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo -u postgres psql -c \"select sha256('pass');\"<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"949\" height=\"114\" src=\"https:\/\/aristov.tech\/blog\/wp-content\/uploads\/2024\/11\/image-22.png\" alt=\"\" class=\"wp-image-1483\" srcset=\"https:\/\/aristov.tech\/blog\/wp-content\/uploads\/2024\/11\/image-22.png 949w, https:\/\/aristov.tech\/blog\/wp-content\/uploads\/2024\/11\/image-22-300x36.png 300w, https:\/\/aristov.tech\/blog\/wp-content\/uploads\/2024\/11\/image-22-768x92.png 768w\" sizes=\"auto, (max-width: 949px) 100vw, 949px\" \/><\/figure>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo -u postgres psql -c \"select md5 ('pass');\"<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"790\" height=\"117\" src=\"https:\/\/aristov.tech\/blog\/wp-content\/uploads\/2024\/11\/image-23.png\" alt=\"\" class=\"wp-image-1484\" srcset=\"https:\/\/aristov.tech\/blog\/wp-content\/uploads\/2024\/11\/image-23.png 790w, https:\/\/aristov.tech\/blog\/wp-content\/uploads\/2024\/11\/image-23-300x44.png 300w, https:\/\/aristov.tech\/blog\/wp-content\/uploads\/2024\/11\/image-23-768x114.png 768w\" sizes=\"auto, (max-width: 790px) 100vw, 790px\" \/><\/figure>\n\n\n\n<p>\u0417\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c \u0432 .pgpass, \u0447\u0442\u043e\u0431\u044b \u043d\u0435 \u0432\u0432\u043e\u0434\u0438\u0442\u044c \u043f\u0430\u0440\u043e\u043b\u044c \u0434\u043b\u044f \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u043a \u0411\u0414:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>echo \"localhost:5432:thai:postgres:admin123#\" | sudo tee -a \/var\/lib\/postgresql\/.pgpass &amp;&amp; sudo chmod 600 \/var\/lib\/postgresql\/.pgpass<\/code><\/pre>\n\n\n\n<p>sudo chown postgres:postgres \/var\/lib\/postgresql\/.pgpass<\/p>\n\n\n\n<p>\u0421\u043c\u0435\u043d\u0438\u043c \u043f\u0440\u0430\u0432\u0430 \u043d\u0430 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f postgres:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo su postgres<\/code><\/pre>\n\n\n\n<p>\u0417\u0430\u0445\u043e\u0434\u0438\u043c \u0432 \u0431\u0430\u0437\u0443 postgres:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>psql -h localhost -U postgres<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"783\" height=\"68\" src=\"https:\/\/aristov.tech\/blog\/wp-content\/uploads\/2024\/11\/image-24.png\" alt=\"\" class=\"wp-image-1485\" srcset=\"https:\/\/aristov.tech\/blog\/wp-content\/uploads\/2024\/11\/image-24.png 783w, https:\/\/aristov.tech\/blog\/wp-content\/uploads\/2024\/11\/image-24-300x26.png 300w, https:\/\/aristov.tech\/blog\/wp-content\/uploads\/2024\/11\/image-24-768x67.png 768w\" sizes=\"auto, (max-width: 783px) 100vw, 783px\" \/><\/figure>\n\n\n\n<p>\u0422\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u043f\u0430\u0440\u043e\u043b\u044c<\/p>\n\n\n\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u0437\u0430\u0445\u043e\u0434\u0438\u043c \u0432 \u0431\u0430\u0437\u0443 thai:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>psql -h localhost -U postgres -d thai<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"953\" height=\"135\" src=\"https:\/\/aristov.tech\/blog\/wp-content\/uploads\/2024\/11\/image-25.png\" alt=\"\" class=\"wp-image-1486\" srcset=\"https:\/\/aristov.tech\/blog\/wp-content\/uploads\/2024\/11\/image-25.png 953w, https:\/\/aristov.tech\/blog\/wp-content\/uploads\/2024\/11\/image-25-300x42.png 300w, https:\/\/aristov.tech\/blog\/wp-content\/uploads\/2024\/11\/image-25-768x109.png 768w\" sizes=\"auto, (max-width: 953px) 100vw, 953px\" \/><\/figure>\n\n\n\n<p>\u041f\u0430\u0440\u043e\u043b\u044c \u043d\u0435 \u043d\u0443\u0436\u0435\u043d, \u0442\u0430\u043a \u043a\u0430\u043a \u0432 .pgpass \u0444\u0430\u0439\u043b\u0435 \u0443\u043a\u0430\u0437\u0430\u043d\u043e \u0438\u043c\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f, \u0431\u0430\u0437\u0430 \u0438 \u043f\u0430\u0440\u043e\u043b\u044c, \u0441 \u043a\u043e\u0442\u043e\u0440\u044b\u043c \u044d\u0442\u043e\u0442 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u0437\u0430\u0445\u043e\u0434\u0438\u0442 \u0432 \u044d\u0442\u0443 \u0431\u0430\u0437\u0443. \u041f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u0437\u0430\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u043f\u0430\u0440\u043e\u043b\u044c \u0432 .pgpass \u043d\u0435 \u0448\u0438\u0444\u0440\u0443\u0435\u0442\u0441\u044f.<\/p>\n\n\n\n<p>\u041d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u043c \u0432\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 pg_bouncer \u043f\u043e\u0441\u043b\u0435 \u043f\u0435\u0440\u0435\u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0430:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo systemctl enable pgbouncer<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"64\" src=\"https:\/\/aristov.tech\/blog\/wp-content\/uploads\/2024\/11\/image-26-1024x64.png\" alt=\"\" class=\"wp-image-1487\" srcset=\"https:\/\/aristov.tech\/blog\/wp-content\/uploads\/2024\/11\/image-26-1024x64.png 1024w, https:\/\/aristov.tech\/blog\/wp-content\/uploads\/2024\/11\/image-26-300x19.png 300w, https:\/\/aristov.tech\/blog\/wp-content\/uploads\/2024\/11\/image-26-768x48.png 768w, https:\/\/aristov.tech\/blog\/wp-content\/uploads\/2024\/11\/image-26.png 1144w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo systemctl start pgbouncer<\/code><\/pre>\n\n\n\n<p>\u0421\u043c\u043e\u0442\u0440\u0438\u043c \u0441\u0442\u0430\u0442\u0443\u0441:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo systemctl status pgbouncer<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"349\" src=\"https:\/\/aristov.tech\/blog\/wp-content\/uploads\/2024\/11\/image-27-1024x349.png\" alt=\"\" class=\"wp-image-1488\" srcset=\"https:\/\/aristov.tech\/blog\/wp-content\/uploads\/2024\/11\/image-27-1024x349.png 1024w, https:\/\/aristov.tech\/blog\/wp-content\/uploads\/2024\/11\/image-27-300x102.png 300w, https:\/\/aristov.tech\/blog\/wp-content\/uploads\/2024\/11\/image-27-768x262.png 768w, https:\/\/aristov.tech\/blog\/wp-content\/uploads\/2024\/11\/image-27.png 1344w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>\u041f\u0440\u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0435 \u0441 \u043a\u043b\u044e\u0447\u043e\u043c -d \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442\u0441\u044f \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0434\u0435\u043c\u043e\u043d\u0430, \u0430 \u043d\u0435 \u0441\u0435\u0440\u0432\u0438\u0441\u0430.<\/p>\n\n\n\n<p>\u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0435\u043c\u0441\u044f:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo -u postgres psql -p 6432 -h 127.0.0.1 -d thai -U postgres<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1016\" height=\"129\" src=\"https:\/\/aristov.tech\/blog\/wp-content\/uploads\/2024\/11\/image-28.png\" alt=\"\" class=\"wp-image-1489\" srcset=\"https:\/\/aristov.tech\/blog\/wp-content\/uploads\/2024\/11\/image-28.png 1016w, https:\/\/aristov.tech\/blog\/wp-content\/uploads\/2024\/11\/image-28-300x38.png 300w, https:\/\/aristov.tech\/blog\/wp-content\/uploads\/2024\/11\/image-28-768x98.png 768w\" sizes=\"auto, (max-width: 1016px) 100vw, 1016px\" \/><\/figure>\n\n\n\n<p>\u0422\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u043f\u0430\u0440\u043e\u043b\u044c, \u0442\u0430\u043a \u043a\u0430\u043a \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0435\u043c\u0441\u044f \u043a pg_bouncer.<\/p>\n\n\n\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043c\u044b \u043d\u0430\u0445\u043e\u0434\u0438\u043c\u0441\u044f \u0432 pg_bouncer, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d \u043a \u0411\u0414 thai. <\/p>\n\n\n\n<p>\u041e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435, \u0447\u0442\u043e \u0435\u0441\u043b\u0438 \u0432 \u0444\u0430\u0439\u043b\u0435 pg_hba.conf \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u043f\u0435\u0440\u0435\u0441\u0435\u043a\u0430\u044e\u0449\u0438\u0435\u0441\u044f \u0434\u0438\u0430\u043f\u0430\u0437\u043e\u043d\u044b \u0434\u043b\u044f \u0440\u0430\u0437\u043d\u044b\u0445 \u043c\u0435\u0442\u043e\u0434\u043e\u0432 \u0448\u0438\u0444\u0440\u043e\u0432\u0430\u043d\u0438\u044f, \u0442\u043e \u043f\u0440\u0438\u043e\u0440\u0438\u0442\u0435\u0442 \u0431\u0443\u0434\u0435\u0442 \u0438\u043c\u0435\u0442\u044c scram-sha-256. \u041f\u0440\u043e\u0441\u043c\u043e\u0442\u0440 \u0444\u0430\u0439\u043b\u0430:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>! nano \/etc\/postgresql\/16\/main\/pg_hba.conf<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"977\" height=\"437\" src=\"https:\/\/aristov.tech\/blog\/wp-content\/uploads\/2024\/11\/image-29.png\" alt=\"\" class=\"wp-image-1490\" srcset=\"https:\/\/aristov.tech\/blog\/wp-content\/uploads\/2024\/11\/image-29.png 977w, https:\/\/aristov.tech\/blog\/wp-content\/uploads\/2024\/11\/image-29-300x134.png 300w, https:\/\/aristov.tech\/blog\/wp-content\/uploads\/2024\/11\/image-29-768x344.png 768w\" sizes=\"auto, (max-width: 977px) 100vw, 977px\" \/><\/figure>\n\n\n\n<p>\u041f\u0440\u043e\u0432\u0435\u0440\u0438\u043c \u0444\u0430\u0439\u043b pgbouncer.ini:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>! nano \/etc\/pgbouncer\/pgbouncer.ini<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"831\" height=\"769\" src=\"https:\/\/aristov.tech\/blog\/wp-content\/uploads\/2024\/11\/image-31.png\" alt=\"\" class=\"wp-image-1492\" srcset=\"https:\/\/aristov.tech\/blog\/wp-content\/uploads\/2024\/11\/image-31.png 831w, https:\/\/aristov.tech\/blog\/wp-content\/uploads\/2024\/11\/image-31-300x278.png 300w, https:\/\/aristov.tech\/blog\/wp-content\/uploads\/2024\/11\/image-31-768x711.png 768w\" sizes=\"auto, (max-width: 831px) 100vw, 831px\" \/><\/figure>\n\n\n\n<figure class=\"wp-block-image aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"755\" height=\"452\" src=\"https:\/\/aristov.tech\/blog\/wp-content\/uploads\/2024\/11\/image-30.png\" alt=\"\" class=\"wp-image-1491\" srcset=\"https:\/\/aristov.tech\/blog\/wp-content\/uploads\/2024\/11\/image-30.png 755w, https:\/\/aristov.tech\/blog\/wp-content\/uploads\/2024\/11\/image-30-300x180.png 300w\" sizes=\"auto, (max-width: 755px) 100vw, 755px\" \/><\/figure>\n\n\n\n<p>Pg_bouncer \u0443\u043c\u0435\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0432 \u0442\u0440\u0435\u0445 \u0440\u0435\u0436\u0438\u043c\u0430\u0445 &#8212; \u0442\u0440\u0430\u043d\u0437\u0430\u043a\u0446\u0438\u044f, \u0441\u0435\u0441\u0441\u0438\u044f, statement. \u041f\u0440\u0438 \u043f\u0440\u043e\u0441\u0442\u0435\u0439\u0448\u0435\u043c \u0442\u0440\u0430\u0444\u0438\u043a\u0435 (\u043a\u043b\u0438\u0435\u043d\u0442 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u043b\u0441\u044f, \u043e\u0442\u043f\u0440\u0430\u0432\u0438\u043b \u0437\u0430\u043f\u0440\u043e\u0441, \u043e\u0442\u043a\u043b\u044e\u0447\u0438\u043b\u0441\u044f) \u0440\u0430\u0437\u043d\u0438\u0446\u044b \u043d\u0435\u0442. \u041e\u043d\u0430 \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u0442 \u043f\u0440\u043e\u044f\u0432\u043b\u044f\u0442\u044c\u0441\u044f \u043d\u0430 \u0434\u043e\u043b\u0433\u0438\u0445 \u0442\u0440\u0430\u043d\u0437\u0430\u043a\u0446\u0438\u044f\u0445 \u0438 \u0437\u0430\u043f\u0440\u043e\u0441\u0430\u0445.<\/p>\n\n\n\n<figure class=\"wp-block-image aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"687\" height=\"127\" src=\"https:\/\/aristov.tech\/blog\/wp-content\/uploads\/2024\/11\/image-32.png\" alt=\"\" class=\"wp-image-1493\" srcset=\"https:\/\/aristov.tech\/blog\/wp-content\/uploads\/2024\/11\/image-32.png 687w, https:\/\/aristov.tech\/blog\/wp-content\/uploads\/2024\/11\/image-32-300x55.png 300w\" sizes=\"auto, (max-width: 687px) 100vw, 687px\" \/><\/figure>\n\n\n\n<p>\u0417\u0430\u0439\u0442\u0438 \u0432 \u0430\u0434\u043c\u0438\u043d\u0438\u0441\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 pg_bouncer (\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u0434\u043e\u043b\u0436\u0435\u043d \u0431\u044b\u0442\u044c \u0443\u043a\u0430\u0437\u0430\u043d \u0432 user_list \u0438 \u0441\u043f\u0438\u0441\u043a\u0435 \u0430\u0434\u043c\u0438\u043d\u043e\u0432):<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>psql -p 6432 -h 127.0.0.1 -d pgbouncer -U admindb<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"805\" height=\"181\" src=\"https:\/\/aristov.tech\/blog\/wp-content\/uploads\/2024\/11\/image-33.png\" alt=\"\" class=\"wp-image-1494\" srcset=\"https:\/\/aristov.tech\/blog\/wp-content\/uploads\/2024\/11\/image-33.png 805w, https:\/\/aristov.tech\/blog\/wp-content\/uploads\/2024\/11\/image-33-300x67.png 300w, https:\/\/aristov.tech\/blog\/wp-content\/uploads\/2024\/11\/image-33-768x173.png 768w\" sizes=\"auto, (max-width: 805px) 100vw, 805px\" \/><\/figure>\n\n\n\n<p>\u041f\u0440\u043e\u0441\u043c\u043e\u0442\u0440 \u0442\u0435\u043a\u0443\u0449\u0438\u043c \u043a\u043b\u0438\u0435\u043d\u0442\u043e\u0432:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>show clients;<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"226\" src=\"https:\/\/aristov.tech\/blog\/wp-content\/uploads\/2024\/11\/image-34-1024x226.png\" alt=\"\" class=\"wp-image-1495\" srcset=\"https:\/\/aristov.tech\/blog\/wp-content\/uploads\/2024\/11\/image-34-1024x226.png 1024w, https:\/\/aristov.tech\/blog\/wp-content\/uploads\/2024\/11\/image-34-300x66.png 300w, https:\/\/aristov.tech\/blog\/wp-content\/uploads\/2024\/11\/image-34-768x170.png 768w, https:\/\/aristov.tech\/blog\/wp-content\/uploads\/2024\/11\/image-34.png 1354w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>\u041f\u0440\u043e\u0442\u0435\u0441\u0442\u0438\u0440\u0443\u0435\u043c \u0440\u0435\u0436\u0438\u043c \u043f\u0430\u0443\u0437\u044b:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>pause thai;<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"841\" height=\"212\" src=\"https:\/\/aristov.tech\/blog\/wp-content\/uploads\/2024\/11\/image-35.png\" alt=\"\" class=\"wp-image-1496\" srcset=\"https:\/\/aristov.tech\/blog\/wp-content\/uploads\/2024\/11\/image-35.png 841w, https:\/\/aristov.tech\/blog\/wp-content\/uploads\/2024\/11\/image-35-300x76.png 300w, https:\/\/aristov.tech\/blog\/wp-content\/uploads\/2024\/11\/image-35-768x194.png 768w\" sizes=\"auto, (max-width: 841px) 100vw, 841px\" \/><\/figure>\n\n\n\n<p>\u0417\u0430\u0445\u043e\u0434\u0438\u043c \u0432 \u043d\u043e\u0432\u043e\u043c \u0442\u0435\u0440\u043c\u0438\u043d\u0430\u043b\u0435:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\/usr\/lib\/postgresql\/16\/bin\/pgbench -c 8 -j 4 -T 10 -f ~\/workload.sql -n -U postgres -p 6432 -h localhost thai<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"533\" src=\"https:\/\/aristov.tech\/blog\/wp-content\/uploads\/2024\/11\/image-36-1024x533.png\" alt=\"\" class=\"wp-image-1497\" srcset=\"https:\/\/aristov.tech\/blog\/wp-content\/uploads\/2024\/11\/image-36-1024x533.png 1024w, https:\/\/aristov.tech\/blog\/wp-content\/uploads\/2024\/11\/image-36-300x156.png 300w, https:\/\/aristov.tech\/blog\/wp-content\/uploads\/2024\/11\/image-36-768x400.png 768w, https:\/\/aristov.tech\/blog\/wp-content\/uploads\/2024\/11\/image-36.png 1361w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<figure class=\"wp-block-image aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"253\" src=\"https:\/\/aristov.tech\/blog\/wp-content\/uploads\/2024\/11\/image-38-1024x253.png\" alt=\"\" class=\"wp-image-1499\" srcset=\"https:\/\/aristov.tech\/blog\/wp-content\/uploads\/2024\/11\/image-38-1024x253.png 1024w, https:\/\/aristov.tech\/blog\/wp-content\/uploads\/2024\/11\/image-38-300x74.png 300w, https:\/\/aristov.tech\/blog\/wp-content\/uploads\/2024\/11\/image-38-768x190.png 768w, https:\/\/aristov.tech\/blog\/wp-content\/uploads\/2024\/11\/image-38.png 1329w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>\u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>show clients;<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"577\" src=\"https:\/\/aristov.tech\/blog\/wp-content\/uploads\/2024\/11\/image-37-1024x577.png\" alt=\"\" class=\"wp-image-1498\" srcset=\"https:\/\/aristov.tech\/blog\/wp-content\/uploads\/2024\/11\/image-37-1024x577.png 1024w, https:\/\/aristov.tech\/blog\/wp-content\/uploads\/2024\/11\/image-37-300x169.png 300w, https:\/\/aristov.tech\/blog\/wp-content\/uploads\/2024\/11\/image-37-768x433.png 768w, https:\/\/aristov.tech\/blog\/wp-content\/uploads\/2024\/11\/image-37.png 1357w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>\u041e\u0431\u0440\u0430\u0442\u0438\u043c \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435, \u0447\u0442\u043e \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u043f\u0430\u0434\u0430\u0435\u0442 \u043f\u043e\u0447\u0442\u0438 \u0432 \u0434\u0432\u0430 \u0440\u0430\u0437\u0430 \u043f\u0440\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438 pg_bouncer.<\/p>\n\n\n\n<p>\u0417\u0430\u043f\u0443\u0441\u0442\u0438\u043c \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0435:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>resume thai;<\/code><\/pre>\n\n\n\n<p>\u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u043c\u0441\u044f \u0432\u043e \u0432\u0442\u043e\u0440\u043e\u043c \u0442\u0435\u0440\u043c\u0438\u043d\u0430\u043b\u0435:<\/p>\n\n\n\n<figure class=\"wp-block-image aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"84\" src=\"https:\/\/aristov.tech\/blog\/wp-content\/uploads\/2024\/11\/image-42-1024x84.png\" alt=\"\" class=\"wp-image-1503\" srcset=\"https:\/\/aristov.tech\/blog\/wp-content\/uploads\/2024\/11\/image-42-1024x84.png 1024w, https:\/\/aristov.tech\/blog\/wp-content\/uploads\/2024\/11\/image-42-300x25.png 300w, https:\/\/aristov.tech\/blog\/wp-content\/uploads\/2024\/11\/image-42-768x63.png 768w, https:\/\/aristov.tech\/blog\/wp-content\/uploads\/2024\/11\/image-42.png 1342w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>\u041f\u0440\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c htop:<\/p>\n\n\n\n<figure class=\"wp-block-image aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"165\" src=\"https:\/\/aristov.tech\/blog\/wp-content\/uploads\/2024\/11\/image-43-1024x165.png\" alt=\"\" class=\"wp-image-1504\" srcset=\"https:\/\/aristov.tech\/blog\/wp-content\/uploads\/2024\/11\/image-43-1024x165.png 1024w, https:\/\/aristov.tech\/blog\/wp-content\/uploads\/2024\/11\/image-43-300x48.png 300w, https:\/\/aristov.tech\/blog\/wp-content\/uploads\/2024\/11\/image-43-768x124.png 768w, https:\/\/aristov.tech\/blog\/wp-content\/uploads\/2024\/11\/image-43.png 1336w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>Pg_bouncer \u0437\u0430\u0431\u0438\u0440\u0430\u0435\u0442 \u0446\u0435\u043b\u043e\u0435 \u044f\u0434\u0440\u043e \u0438 \u0441\u043d\u0438\u0436\u0430\u0435\u0442 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c.<\/p>\n\n\n\n<p>\u0422\u0430\u043a\u0436\u0435 \u0435\u0441\u0442\u044c \u0440\u0430\u0437\u043d\u0438\u0446\u0430 \u043f\u0440\u0438 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0438 \u0447\u0435\u0440\u0435\u0437 unix socket \u0438 localhost &#8212; unix socket \u0431\u044b\u0441\u0442\u0440\u0435\u0435.<\/p>\n\n\n\n<p class=\"has-x-large-font-size\"><strong>idle VS idle in transaction<\/strong><\/p>\n\n\n\n<p>\u0412\u043e \u0438\u0437\u0431\u0435\u0436\u0430\u043d\u0438\u0435 \u043f\u0440\u043e\u0431\u043b\u0435\u043c \u0441 \u043e\u0442\u043a\u0440\u044b\u0442\u0438\u0435\u043c \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0439, \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0430 \u0434\u043e\u043b\u0433\u043e\u0433\u043e \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0430\u043d\u0438\u044f \u043e\u0442\u043a\u0440\u044b\u0442\u043e\u0439 \u0442\u0440\u0430\u043d\u0437\u0430\u043a\u0446\u0438\u0438.<\/p>\n\n\n\n<p>\u041e\u0442\u043a\u0440\u044b\u0442\u044b\u0439 \u0443\u0440\u043e\u043a \u043d\u0430 \u044d\u0442\u0443 \u0442\u0435\u043c\u0443:<\/p>\n\n\n\n<p><a href=\"https:\/\/www.youtube.com\/watch?v=wK8VSeDG_6I\">\u0417\u0430\u043f\u0438\u0441\u044c \u0432\u0438\u0434\u0435\u043e<\/a><\/p>\n\n\n\n<p><a href=\"https:\/\/aristov.tech\/blog\/idle-vs-idle-in-transaction\/\">\u0412 \u0432\u0438\u0434\u0435 \u0441\u0442\u0430\u0442\u044c\u0438<\/a><\/p>\n\n\n\n<p><a href=\"https:\/\/github.com\/aeuge\/aristov_tech\">\u0421\u043a\u0440\u0438\u043f\u0442\u044b \u043d\u0430 \u041f\u0438\u0442\u043e\u043d\u0435 \u0432\u044b\u043b\u043e\u0436\u0435\u043d\u044b \u043d\u0430 \u0433\u0438\u0442\u0445\u0430\u0431<\/a><\/p>\n\n\n\n<p class=\"has-x-large-font-size\"><strong>Checklist<\/strong><\/p>\n\n\n\n<p>\u0423\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u043c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043a\u043e\u043d\u043d\u0435\u043a\u0442\u043e\u0432 <\/p>\n\n\n\n<p>\u0415\u0441\u043b\u0438 \u0431\u043e\u043b\u044c\u0448\u0435 500 \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0439 &#8212; \u0432\u044b\u0431\u0438\u0440\u0430\u0435\u043c \u043f\u0443\u043b\u0435\u0440<\/p>\n\n\n\n<p>\u041e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u043d\u0430 \u0432\u0430\u0448\u0435\u043c \u0436\u0435\u043b\u0435\u0437\u0435, \u043e\u0431\u044a\u0435\u043c\u0435 \u0438 \u043f\u0440\u043e\u0444\u0438\u043b\u0435 \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u0438<\/p>\n\n\n\n<p>\u0423\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u043c \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0430\u0446\u0438\u0438 \u043f\u043e \u0441\u0435\u0442\u0435\u0432\u043e\u043c\u0443 \u043e\u0431\u043c\u0435\u043d\u0443<\/p>\n\n\n\n<p>\u0421\u043e\u0432\u043c\u0435\u0441\u0442\u043d\u043e \u0441 \u0421\u0411 \u0432\u044b\u0431\u0438\u0440\u0430\u0435\u043c \u043c\u043e\u0434\u0435\u043b\u044c SSL \u0438 \u0442\u0435\u0440\u043c\u0438\u043d\u0430\u0446\u0438\u0438 \u0442\u0440\u0430\u0444\u0438\u043a\u0430<\/p>\n\n\n\n<p>\u0412\u044b\u0431\u0438\u0440\u0430\u0435\u043c \u043c\u043e\u0434\u0435\u043b\u044c \u0431\u0430\u043b\u0430\u043d\u0441\u0438\u043d\u0433\u0430 \u0432 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u0438 \u0441 \u0432\u0430\u0448\u0438\u043c \u0436\u0435\u043b\u0435\u0437\u043e\u043c \u0438 \u0431\u0438\u0437\u043d\u0435\u0441 \u0437\u0430\u0434\u0430\u0447\u0430\u043c\u0438<\/p>\n\n\n\n<p>\u041f\u043e\u043c\u043d\u0438\u043c \u043e \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430\u0445 \u0434\u043e\u043b\u0433\u0438\u0445 \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0439<\/p>\n\n\n\n<p>\u0418\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043e \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0445 \u043e\u0442\u043a\u0440\u044b\u0442\u044b\u0445 \u0443\u0440\u043e\u043a\u0430\u0445 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u043d\u0430 <a href=\"https:\/\/aristov.tech\/\">\u0441\u0430\u0439\u0442\u0435 \u043f\u0440\u043e\u0435\u043a\u0442\u0430<\/a> \u0438\u043b\u0438 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0434\u043f\u0438\u0441\u0430\u0442\u044c\u0441\u044f \u043d\u0430 <a href=\"https:\/\/t.me\/aristov_tech\">\u043d\u043e\u0432\u043e\u0441\u0442\u043d\u043e\u0439 \u043a\u0430\u043d\u0430\u043b<\/a> \u0432 TG.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u0421\u0442\u0430\u0442\u044c\u044f \u043e\u0441\u043d\u043e\u0432\u0430\u043d\u0430 \u043d\u0430 \u043c\u0430\u0442\u0435\u0440\u0438\u0430\u043b\u0430\u0445 \u043e\u0442\u043a\u0440\u044b\u0442\u043e\u0433\u043e \u0432\u0435\u0431\u0438\u043d\u0430\u0440\u0430, \u043f\u0440\u043e\u0448\u0435\u0434\u0448\u0435\u0433\u043e 30.10. \u0417\u0430\u043f\u0438\u0441\u044c \u0437\u0430\u043d\u044f\u0442\u0438\u044f \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u0430 \u0432&nbsp;\u044e\u0442\u0443\u0431 \u0432\u0435\u0440\u0441\u0438\u0438, \u0440\u0443\u0442\u0443\u0431 \u0432\u0435\u0440\u0441\u0438\u0438 \u0438 VK \u0412\u0438\u0434\u0435\u043e. \u041f\u0440\u0435\u0437\u0435\u043d\u0442\u0430\u0446\u0438\u044f \u0438 \u0438\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u0438 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b \u043f\u043e \u0441\u0441\u044b\u043b\u043a\u0435. \u041f\u0440\u043e\u0431\u043b\u0435\u043c\u0430\u0442\u0438\u043a\u0430 \u041a\u043b\u0430\u0441\u0441\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0441\u0442\u0430\u0440\u0442 PostgreSQL: \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442\u0441\u044f \u0431\u0430\u0437\u043e\u0432\u044b\u0439 \u043f\u0440\u043e\u0446\u0435\u0441\u0441 postgres, \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0435\u0433\u043e fork (\u043a\u0430\u0436\u0434\u044b\u0439 fork \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430 \u0437\u0430\u043d\u0438\u043c\u0430\u0435\u0442\u0441\u044f \u0441\u0432\u043e\u0435\u0439 \u0437\u0430\u0434\u0430\u0447\u0435\u0439), \u0444\u043e\u0440\u043c\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0440\u0430\u0437\u0434\u0435\u043b\u044f\u0435\u043c\u0430\u044f \u043f\u0430\u043c\u044f\u0442\u044c, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043b\u0435\u0436\u0438\u0442 \u0431\u0443\u0444\u0435\u0440\u043d\u044b\u0439 \u043f\u0443\u043b \u0438 \u0434\u0440\u0443\u0433\u0438\u0435 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b. \u0414\u0430\u043b\u0435\u0435 \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442 \u043a\u043b\u0438\u0435\u043d\u0442 [&hellip;]<\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1,12,9],"tags":[358,250,361,363,357,360,16,362,118],"class_list":["post-1459","post","type-post","status-publish","format-standard","hentry","category-1","category-optimizacziya-postgresql","category-upravlenie-postgresql","tag-haproxy","tag-hba_file","tag-odyssey","tag-pgagroal","tag-pgbouncer","tag-pgpool","tag-postgresql","tag-ssl","tag-work_mem"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Pgbouncer - connecting clients \u0432 PostgreSQL - \u0411\u043b\u043e\u0433 \u043f\u043e \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0435 \u0438 \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0438 PostgreSQL \u043e\u0442 \u0410\u0440\u0438\u0441\u0442\u043e\u0432\u0430 \u0415\u0432\u0433\u0435\u043d\u0438\u044f<\/title>\n<meta name=\"description\" content=\"\u0412 \u0441\u0442\u0430\u0442\u044c\u0435 \u0440\u0430\u0437\u0431\u0438\u0440\u0430\u0435\u043c \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0435 \u0441\u0445\u0435\u043c\u044b \u0431\u0430\u043b\u0430\u043d\u0441\u0438\u0440\u043e\u0432\u043a\u0438 \u0442\u0440\u0430\u0444\u0438\u043a\u0430 \u0432 PostgreSQL, \u0430 \u0442\u0430\u043a\u0436\u0435 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0435 \u043f\u0443\u043b\u0435\u0440\u044b - pg_bouncer, Pgpool II, Odyssey.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/aristov.tech\/blog\/pgbouncer-connecting-clients-v-postgresql\/\" \/>\n<meta property=\"og:locale\" content=\"ru_RU\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Pgbouncer - connecting clients \u0432 PostgreSQL - \u0411\u043b\u043e\u0433 \u043f\u043e \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0435 \u0438 \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0438 PostgreSQL \u043e\u0442 \u0410\u0440\u0438\u0441\u0442\u043e\u0432\u0430 \u0415\u0432\u0433\u0435\u043d\u0438\u044f\" \/>\n<meta property=\"og:description\" content=\"\u0412 \u0441\u0442\u0430\u0442\u044c\u0435 \u0440\u0430\u0437\u0431\u0438\u0440\u0430\u0435\u043c \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0435 \u0441\u0445\u0435\u043c\u044b \u0431\u0430\u043b\u0430\u043d\u0441\u0438\u0440\u043e\u0432\u043a\u0438 \u0442\u0440\u0430\u0444\u0438\u043a\u0430 \u0432 PostgreSQL, \u0430 \u0442\u0430\u043a\u0436\u0435 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0435 \u043f\u0443\u043b\u0435\u0440\u044b - pg_bouncer, Pgpool II, Odyssey.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/aristov.tech\/blog\/pgbouncer-connecting-clients-v-postgresql\/\" \/>\n<meta property=\"og:site_name\" content=\"\u0411\u043b\u043e\u0433 \u043f\u043e \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0435 \u0438 \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0438 PostgreSQL \u043e\u0442 \u0410\u0440\u0438\u0441\u0442\u043e\u0432\u0430 \u0415\u0432\u0433\u0435\u043d\u0438\u044f\" \/>\n<meta property=\"article:published_time\" content=\"2024-11-08T13:31:12+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-12-13T13:19:09+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/aristov.tech\/blog\/wp-content\/uploads\/2024\/11\/image.png\" \/>\n\t<meta property=\"og:image:width\" content=\"800\" \/>\n\t<meta property=\"og:image:height\" content=\"450\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Maria\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u041d\u0430\u043f\u0438\u0441\u0430\u043d\u043e \u0430\u0432\u0442\u043e\u0440\u043e\u043c\" \/>\n\t<meta name=\"twitter:data1\" content=\"Maria\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u041f\u0440\u0438\u043c\u0435\u0440\u043d\u043e\u0435 \u0432\u0440\u0435\u043c\u044f \u0434\u043b\u044f \u0447\u0442\u0435\u043d\u0438\u044f\" \/>\n\t<meta name=\"twitter:data2\" content=\"20 \u043c\u0438\u043d\u0443\u0442\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/aristov.tech\\\/blog\\\/pgbouncer-connecting-clients-v-postgresql\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/aristov.tech\\\/blog\\\/pgbouncer-connecting-clients-v-postgresql\\\/\"},\"author\":{\"name\":\"Maria\",\"@id\":\"https:\\\/\\\/aristov.tech\\\/blog\\\/#\\\/schema\\\/person\\\/6a152749a3dde76f19cc30db676d2310\"},\"headline\":\"Pgbouncer &#8212; connecting clients \u0432 PostgreSQL\",\"datePublished\":\"2024-11-08T13:31:12+00:00\",\"dateModified\":\"2024-12-13T13:19:09+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/aristov.tech\\\/blog\\\/pgbouncer-connecting-clients-v-postgresql\\\/\"},\"wordCount\":2283,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/aristov.tech\\\/blog\\\/#\\\/schema\\\/person\\\/05f3a04bf720ae4bf25ac99c4248d5e7\"},\"image\":{\"@id\":\"https:\\\/\\\/aristov.tech\\\/blog\\\/pgbouncer-connecting-clients-v-postgresql\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/aristov.tech\\\/blog\\\/wp-content\\\/uploads\\\/2024\\\/11\\\/image.png\",\"keywords\":[\"haproxy\",\"hba_file\",\"Odyssey\",\"pgagroal\",\"pgbouncer\",\"Pgpool\",\"postgresql\",\"SSL\",\"work_mem\"],\"articleSection\":{\"1\":\"\u041e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u044f PostgreSQL\",\"2\":\"\u0423\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 PostgreSQL\"},\"inLanguage\":\"ru-RU\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/aristov.tech\\\/blog\\\/pgbouncer-connecting-clients-v-postgresql\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/aristov.tech\\\/blog\\\/pgbouncer-connecting-clients-v-postgresql\\\/\",\"url\":\"https:\\\/\\\/aristov.tech\\\/blog\\\/pgbouncer-connecting-clients-v-postgresql\\\/\",\"name\":\"Pgbouncer - connecting clients \u0432 PostgreSQL - \u0411\u043b\u043e\u0433 \u043f\u043e \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0435 \u0438 \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0438 PostgreSQL \u043e\u0442 \u0410\u0440\u0438\u0441\u0442\u043e\u0432\u0430 \u0415\u0432\u0433\u0435\u043d\u0438\u044f\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/aristov.tech\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/aristov.tech\\\/blog\\\/pgbouncer-connecting-clients-v-postgresql\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/aristov.tech\\\/blog\\\/pgbouncer-connecting-clients-v-postgresql\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/aristov.tech\\\/blog\\\/wp-content\\\/uploads\\\/2024\\\/11\\\/image.png\",\"datePublished\":\"2024-11-08T13:31:12+00:00\",\"dateModified\":\"2024-12-13T13:19:09+00:00\",\"description\":\"\u0412 \u0441\u0442\u0430\u0442\u044c\u0435 \u0440\u0430\u0437\u0431\u0438\u0440\u0430\u0435\u043c \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0435 \u0441\u0445\u0435\u043c\u044b \u0431\u0430\u043b\u0430\u043d\u0441\u0438\u0440\u043e\u0432\u043a\u0438 \u0442\u0440\u0430\u0444\u0438\u043a\u0430 \u0432 PostgreSQL, \u0430 \u0442\u0430\u043a\u0436\u0435 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0435 \u043f\u0443\u043b\u0435\u0440\u044b - pg_bouncer, Pgpool II, Odyssey.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/aristov.tech\\\/blog\\\/pgbouncer-connecting-clients-v-postgresql\\\/#breadcrumb\"},\"inLanguage\":\"ru-RU\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/aristov.tech\\\/blog\\\/pgbouncer-connecting-clients-v-postgresql\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"ru-RU\",\"@id\":\"https:\\\/\\\/aristov.tech\\\/blog\\\/pgbouncer-connecting-clients-v-postgresql\\\/#primaryimage\",\"url\":\"https:\\\/\\\/aristov.tech\\\/blog\\\/wp-content\\\/uploads\\\/2024\\\/11\\\/image.png\",\"contentUrl\":\"https:\\\/\\\/aristov.tech\\\/blog\\\/wp-content\\\/uploads\\\/2024\\\/11\\\/image.png\",\"width\":800,\"height\":450},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/aristov.tech\\\/blog\\\/pgbouncer-connecting-clients-v-postgresql\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u0413\u043b\u0430\u0432\u043d\u0430\u044f \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0430\",\"item\":\"https:\\\/\\\/aristov.tech\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Pgbouncer &#8211; connecting clients \u0432 PostgreSQL\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/aristov.tech\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/aristov.tech\\\/blog\\\/\",\"name\":\"\u0411\u043b\u043e\u0433 \u043f\u043e \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0435 \u0438 \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0438 PostgreSQL \u043e\u0442 \u0410\u0440\u0438\u0441\u0442\u043e\u0432\u0430 \u0415\u0432\u0433\u0435\u043d\u0438\u044f\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\\\/\\\/aristov.tech\\\/blog\\\/#\\\/schema\\\/person\\\/05f3a04bf720ae4bf25ac99c4248d5e7\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/aristov.tech\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"ru-RU\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\\\/\\\/aristov.tech\\\/blog\\\/#\\\/schema\\\/person\\\/05f3a04bf720ae4bf25ac99c4248d5e7\",\"name\":\"admin2\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"ru-RU\",\"@id\":\"https:\\\/\\\/aristov.tech\\\/blog\\\/wp-content\\\/uploads\\\/2023\\\/05\\\/blog-logo.png\",\"url\":\"https:\\\/\\\/aristov.tech\\\/blog\\\/wp-content\\\/uploads\\\/2023\\\/05\\\/blog-logo.png\",\"contentUrl\":\"https:\\\/\\\/aristov.tech\\\/blog\\\/wp-content\\\/uploads\\\/2023\\\/05\\\/blog-logo.png\",\"width\":180,\"height\":180,\"caption\":\"admin2\"},\"logo\":{\"@id\":\"https:\\\/\\\/aristov.tech\\\/blog\\\/wp-content\\\/uploads\\\/2023\\\/05\\\/blog-logo.png\"},\"sameAs\":[\"https:\\\/\\\/aristov.tech\\\/blog\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/aristov.tech\\\/blog\\\/#\\\/schema\\\/person\\\/6a152749a3dde76f19cc30db676d2310\",\"name\":\"Maria\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"ru-RU\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/a86c8edd49a73db805cc02e271f5fc126b109c146ad0d8976829c538b3b94ca4?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/a86c8edd49a73db805cc02e271f5fc126b109c146ad0d8976829c538b3b94ca4?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/a86c8edd49a73db805cc02e271f5fc126b109c146ad0d8976829c538b3b94ca4?s=96&d=mm&r=g\",\"caption\":\"Maria\"},\"url\":\"https:\\\/\\\/aristov.tech\\\/blog\\\/author\\\/maria\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Pgbouncer - connecting clients \u0432 PostgreSQL - \u0411\u043b\u043e\u0433 \u043f\u043e \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0435 \u0438 \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0438 PostgreSQL \u043e\u0442 \u0410\u0440\u0438\u0441\u0442\u043e\u0432\u0430 \u0415\u0432\u0433\u0435\u043d\u0438\u044f","description":"\u0412 \u0441\u0442\u0430\u0442\u044c\u0435 \u0440\u0430\u0437\u0431\u0438\u0440\u0430\u0435\u043c \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0435 \u0441\u0445\u0435\u043c\u044b \u0431\u0430\u043b\u0430\u043d\u0441\u0438\u0440\u043e\u0432\u043a\u0438 \u0442\u0440\u0430\u0444\u0438\u043a\u0430 \u0432 PostgreSQL, \u0430 \u0442\u0430\u043a\u0436\u0435 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0435 \u043f\u0443\u043b\u0435\u0440\u044b - pg_bouncer, Pgpool II, Odyssey.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/aristov.tech\/blog\/pgbouncer-connecting-clients-v-postgresql\/","og_locale":"ru_RU","og_type":"article","og_title":"Pgbouncer - connecting clients \u0432 PostgreSQL - \u0411\u043b\u043e\u0433 \u043f\u043e \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0435 \u0438 \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0438 PostgreSQL \u043e\u0442 \u0410\u0440\u0438\u0441\u0442\u043e\u0432\u0430 \u0415\u0432\u0433\u0435\u043d\u0438\u044f","og_description":"\u0412 \u0441\u0442\u0430\u0442\u044c\u0435 \u0440\u0430\u0437\u0431\u0438\u0440\u0430\u0435\u043c \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0435 \u0441\u0445\u0435\u043c\u044b \u0431\u0430\u043b\u0430\u043d\u0441\u0438\u0440\u043e\u0432\u043a\u0438 \u0442\u0440\u0430\u0444\u0438\u043a\u0430 \u0432 PostgreSQL, \u0430 \u0442\u0430\u043a\u0436\u0435 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0435 \u043f\u0443\u043b\u0435\u0440\u044b - pg_bouncer, Pgpool II, Odyssey.","og_url":"https:\/\/aristov.tech\/blog\/pgbouncer-connecting-clients-v-postgresql\/","og_site_name":"\u0411\u043b\u043e\u0433 \u043f\u043e \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0435 \u0438 \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0438 PostgreSQL \u043e\u0442 \u0410\u0440\u0438\u0441\u0442\u043e\u0432\u0430 \u0415\u0432\u0433\u0435\u043d\u0438\u044f","article_published_time":"2024-11-08T13:31:12+00:00","article_modified_time":"2024-12-13T13:19:09+00:00","og_image":[{"width":800,"height":450,"url":"https:\/\/aristov.tech\/blog\/wp-content\/uploads\/2024\/11\/image.png","type":"image\/png"}],"author":"Maria","twitter_card":"summary_large_image","twitter_misc":{"\u041d\u0430\u043f\u0438\u0441\u0430\u043d\u043e \u0430\u0432\u0442\u043e\u0440\u043e\u043c":"Maria","\u041f\u0440\u0438\u043c\u0435\u0440\u043d\u043e\u0435 \u0432\u0440\u0435\u043c\u044f \u0434\u043b\u044f \u0447\u0442\u0435\u043d\u0438\u044f":"20 \u043c\u0438\u043d\u0443\u0442"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/aristov.tech\/blog\/pgbouncer-connecting-clients-v-postgresql\/#article","isPartOf":{"@id":"https:\/\/aristov.tech\/blog\/pgbouncer-connecting-clients-v-postgresql\/"},"author":{"name":"Maria","@id":"https:\/\/aristov.tech\/blog\/#\/schema\/person\/6a152749a3dde76f19cc30db676d2310"},"headline":"Pgbouncer &#8212; connecting clients \u0432 PostgreSQL","datePublished":"2024-11-08T13:31:12+00:00","dateModified":"2024-12-13T13:19:09+00:00","mainEntityOfPage":{"@id":"https:\/\/aristov.tech\/blog\/pgbouncer-connecting-clients-v-postgresql\/"},"wordCount":2283,"commentCount":0,"publisher":{"@id":"https:\/\/aristov.tech\/blog\/#\/schema\/person\/05f3a04bf720ae4bf25ac99c4248d5e7"},"image":{"@id":"https:\/\/aristov.tech\/blog\/pgbouncer-connecting-clients-v-postgresql\/#primaryimage"},"thumbnailUrl":"https:\/\/aristov.tech\/blog\/wp-content\/uploads\/2024\/11\/image.png","keywords":["haproxy","hba_file","Odyssey","pgagroal","pgbouncer","Pgpool","postgresql","SSL","work_mem"],"articleSection":{"1":"\u041e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u044f PostgreSQL","2":"\u0423\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 PostgreSQL"},"inLanguage":"ru-RU","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/aristov.tech\/blog\/pgbouncer-connecting-clients-v-postgresql\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/aristov.tech\/blog\/pgbouncer-connecting-clients-v-postgresql\/","url":"https:\/\/aristov.tech\/blog\/pgbouncer-connecting-clients-v-postgresql\/","name":"Pgbouncer - connecting clients \u0432 PostgreSQL - \u0411\u043b\u043e\u0433 \u043f\u043e \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0435 \u0438 \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0438 PostgreSQL \u043e\u0442 \u0410\u0440\u0438\u0441\u0442\u043e\u0432\u0430 \u0415\u0432\u0433\u0435\u043d\u0438\u044f","isPartOf":{"@id":"https:\/\/aristov.tech\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/aristov.tech\/blog\/pgbouncer-connecting-clients-v-postgresql\/#primaryimage"},"image":{"@id":"https:\/\/aristov.tech\/blog\/pgbouncer-connecting-clients-v-postgresql\/#primaryimage"},"thumbnailUrl":"https:\/\/aristov.tech\/blog\/wp-content\/uploads\/2024\/11\/image.png","datePublished":"2024-11-08T13:31:12+00:00","dateModified":"2024-12-13T13:19:09+00:00","description":"\u0412 \u0441\u0442\u0430\u0442\u044c\u0435 \u0440\u0430\u0437\u0431\u0438\u0440\u0430\u0435\u043c \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0435 \u0441\u0445\u0435\u043c\u044b \u0431\u0430\u043b\u0430\u043d\u0441\u0438\u0440\u043e\u0432\u043a\u0438 \u0442\u0440\u0430\u0444\u0438\u043a\u0430 \u0432 PostgreSQL, \u0430 \u0442\u0430\u043a\u0436\u0435 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0435 \u043f\u0443\u043b\u0435\u0440\u044b - pg_bouncer, Pgpool II, Odyssey.","breadcrumb":{"@id":"https:\/\/aristov.tech\/blog\/pgbouncer-connecting-clients-v-postgresql\/#breadcrumb"},"inLanguage":"ru-RU","potentialAction":[{"@type":"ReadAction","target":["https:\/\/aristov.tech\/blog\/pgbouncer-connecting-clients-v-postgresql\/"]}]},{"@type":"ImageObject","inLanguage":"ru-RU","@id":"https:\/\/aristov.tech\/blog\/pgbouncer-connecting-clients-v-postgresql\/#primaryimage","url":"https:\/\/aristov.tech\/blog\/wp-content\/uploads\/2024\/11\/image.png","contentUrl":"https:\/\/aristov.tech\/blog\/wp-content\/uploads\/2024\/11\/image.png","width":800,"height":450},{"@type":"BreadcrumbList","@id":"https:\/\/aristov.tech\/blog\/pgbouncer-connecting-clients-v-postgresql\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u0413\u043b\u0430\u0432\u043d\u0430\u044f \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0430","item":"https:\/\/aristov.tech\/blog\/"},{"@type":"ListItem","position":2,"name":"Pgbouncer &#8211; connecting clients \u0432 PostgreSQL"}]},{"@type":"WebSite","@id":"https:\/\/aristov.tech\/blog\/#website","url":"https:\/\/aristov.tech\/blog\/","name":"\u0411\u043b\u043e\u0433 \u043f\u043e \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0435 \u0438 \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0438 PostgreSQL \u043e\u0442 \u0410\u0440\u0438\u0441\u0442\u043e\u0432\u0430 \u0415\u0432\u0433\u0435\u043d\u0438\u044f","description":"","publisher":{"@id":"https:\/\/aristov.tech\/blog\/#\/schema\/person\/05f3a04bf720ae4bf25ac99c4248d5e7"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/aristov.tech\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"ru-RU"},{"@type":["Person","Organization"],"@id":"https:\/\/aristov.tech\/blog\/#\/schema\/person\/05f3a04bf720ae4bf25ac99c4248d5e7","name":"admin2","image":{"@type":"ImageObject","inLanguage":"ru-RU","@id":"https:\/\/aristov.tech\/blog\/wp-content\/uploads\/2023\/05\/blog-logo.png","url":"https:\/\/aristov.tech\/blog\/wp-content\/uploads\/2023\/05\/blog-logo.png","contentUrl":"https:\/\/aristov.tech\/blog\/wp-content\/uploads\/2023\/05\/blog-logo.png","width":180,"height":180,"caption":"admin2"},"logo":{"@id":"https:\/\/aristov.tech\/blog\/wp-content\/uploads\/2023\/05\/blog-logo.png"},"sameAs":["https:\/\/aristov.tech\/blog"]},{"@type":"Person","@id":"https:\/\/aristov.tech\/blog\/#\/schema\/person\/6a152749a3dde76f19cc30db676d2310","name":"Maria","image":{"@type":"ImageObject","inLanguage":"ru-RU","@id":"https:\/\/secure.gravatar.com\/avatar\/a86c8edd49a73db805cc02e271f5fc126b109c146ad0d8976829c538b3b94ca4?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/a86c8edd49a73db805cc02e271f5fc126b109c146ad0d8976829c538b3b94ca4?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/a86c8edd49a73db805cc02e271f5fc126b109c146ad0d8976829c538b3b94ca4?s=96&d=mm&r=g","caption":"Maria"},"url":"https:\/\/aristov.tech\/blog\/author\/maria\/"}]}},"_links":{"self":[{"href":"https:\/\/aristov.tech\/blog\/wp-json\/wp\/v2\/posts\/1459","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/aristov.tech\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/aristov.tech\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/aristov.tech\/blog\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/aristov.tech\/blog\/wp-json\/wp\/v2\/comments?post=1459"}],"version-history":[{"count":8,"href":"https:\/\/aristov.tech\/blog\/wp-json\/wp\/v2\/posts\/1459\/revisions"}],"predecessor-version":[{"id":1556,"href":"https:\/\/aristov.tech\/blog\/wp-json\/wp\/v2\/posts\/1459\/revisions\/1556"}],"wp:attachment":[{"href":"https:\/\/aristov.tech\/blog\/wp-json\/wp\/v2\/media?parent=1459"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/aristov.tech\/blog\/wp-json\/wp\/v2\/categories?post=1459"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/aristov.tech\/blog\/wp-json\/wp\/v2\/tags?post=1459"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}