{"id":471902,"date":"2025-08-23T21:00:16","date_gmt":"2025-08-23T21:00:16","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=471902"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=471902","title":{"rendered":"<span>\u0417\u0430\u043c\u0435\u0434\u043b\u044f\u044e Postgres \u0432 42\u00a0000 \u0440\u0430\u0437, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u043c\u043d\u0435 \u043d\u0435\u0447\u0435\u043c \u0431\u043e\u043b\u044c\u0448\u0435 \u0437\u0430\u043d\u044f\u0442\u044c\u0441\u044f<\/span>"},"content":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<figure class=\"\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/\/post_images\/92a\/488\/e64\/92a488e6437d556556e795060be06cb2.jpg\" sizes=\"(max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/r\/w780\/getpro\/habr\/\/post_images\/92a\/488\/e64\/92a488e6437d556556e795060be06cb2.jpg 780w,&#10;       https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/\/post_images\/92a\/488\/e64\/92a488e6437d556556e795060be06cb2.jpg 781w\" loading=\"lazy\" decode=\"async\"\/><\/figure>\n<p>\u041a\u0440\u0443\u0433\u043e\u043c \u0442\u043e\u043b\u044c\u043a\u043e \u0438 \u0440\u0430\u0437\u0433\u043e\u0432\u043e\u0440\u043e\u0432 \u043e \u0442\u043e\u043c, \u043a\u0430\u043a \u0431\u044b \u0437\u0430\u0441\u0442\u0430\u0432\u0438\u0442\u044c Postgres \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0431\u044b\u0441\u0442\u0440\u0435\u0435, \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u0435\u0435, \u0438 \u0442\u0430\u043a \u0434\u0430\u043b\u0435\u0435. \u041d\u043e \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u043d\u0438\u043a\u0442\u043e \u0434\u0430\u0436\u0435 \u043d\u0435 \u0437\u0430\u0434\u0443\u043c\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043e \u0442\u043e\u043c, \u043a\u0430\u043a \u0431\u044b \u0435\u0433\u043e <em>\u0437\u0430\u043c\u0435\u0434\u043b\u0438\u0442\u044c<\/em>. \u0421\u0430\u043c\u043e \u0441\u043e\u0431\u043e\u0439, \u043e \u043f\u0440\u043e\u0434\u0443\u043a\u0442\u0438\u0432\u043d\u043e\u0441\u0442\u0438 \u0438 \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u043e\u0441\u0442\u0438 \u043f\u0430\u0440\u044f\u0442\u0441\u044f \u0432 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u043c \u0442\u0435, \u043a\u043e\u043c\u0443 \u0437\u0430 \u044d\u0442\u043e \u043f\u043b\u0430\u0442\u044f\u0442. \u042f \u043d\u0435 \u0438\u0437 \u0438\u0437 \u0447\u0438\u0441\u043b\u0430 (\u043c\u043e\u0436\u0435\u0442\u0435 \u044d\u0442\u043e \u0438\u0441\u043f\u0440\u0430\u0432\u0438\u0442\u044c &#8212; \u0434\u0430\u0439\u0442\u0435 \u043c\u043d\u0435 \u0437\u043d\u0430\u0442\u044c). \u041d\u0430 \u0434\u043d\u044f\u0445 \u044f \u0440\u0430\u0431\u043e\u0442\u0430\u043b \u043d\u0430\u0434 <a href=\"https:\/\/byteofdev.com\/posts\/tuning-postgres-intro\/\" rel=\"noopener noreferrer nofollow\">\u0447\u0443\u0442\u044c \u0431\u043e\u043b\u0435\u0435 \u043f\u043e\u043b\u0435\u0437\u043d\u044b\u043c \u0440\u0443\u043a\u043e\u0432\u043e\u0434\u0441\u0442\u0432\u043e\u043c (EN)<\/a> \u0438 \u0432 \u043a\u0430\u043a\u043e\u0439-\u0442\u043e \u043c\u043e\u043c\u0435\u043d\u0442 \u0440\u0435\u0448\u0438\u043b, \u0447\u0442\u043e \u044d\u0442\u043e\u043c\u0443 \u043c\u0438\u0440\u0443 \u043d\u0443\u0436\u043d\u0430 \u0442\u0430\u043a\u0430\u044f \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044f Postgres, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e \u043c\u0435\u0434\u043b\u0435\u043d\u043d\u043e. \u041d\u0430\u0445\u0440\u0435\u043d\u0430? \u0427\u0435\u0440\u0442 \u0437\u043d\u0430\u0435\u0442, \u043d\u043e \u0432\u043e\u0442 \u0447\u0442\u043e \u0443 \u043c\u0435\u043d\u044f \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u043e\u0441\u044c.<\/p>\n<h3>\u041f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b<\/h3>\n<p>\u041c\u044b \u043d\u0435 \u0438\u0449\u0435\u043c \u043f\u0440\u043e\u0441\u0442\u044b\u0445 \u043f\u0443\u0442\u0435\u0439, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0437\u0430\u043c\u0435\u0434\u043b\u044f\u0442\u044c \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440 \u0438 \u0432\u0430\u0439\u043f\u0430\u0442\u044c \u0438\u043d\u0434\u0435\u043a\u0441\u044b \u043c\u044b \u043d\u0435 \u0431\u0443\u0434\u0435\u043c. \u042f \u0431\u0443\u0434\u0443 \u0442\u0440\u043e\u0433\u0430\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u0432 <code>postgresql.conf<\/code>. \u041f\u0440\u0438 \u044d\u0442\u043e\u043c \u0411\u0414 \u0434\u043e\u043b\u0436\u043d\u0430 \u0441\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0442\u044c \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u0432 \u0440\u0430\u0437\u0443\u043c\u043d\u043e\u0435 \u0432\u0440\u0435\u043c\u044f &#8212; \u0445\u043e\u0442\u044f \u0431\u044b \u043f\u043e \u043e\u0434\u043d\u043e\u043c\u0443. \u0417\u0430\u0442\u043e\u0440\u043c\u043e\u0437\u0438\u0442\u044c Postgres \u0432 \u043d\u043e\u043b\u044c \u0441\u043b\u0438\u0448\u043a\u043e\u043c \u043f\u0440\u043e\u0441\u0442\u043e. \u0410 \u0432\u043e\u0442 \u0437\u0430\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0435\u0451 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u043c\u0435\u0434\u043b\u0435\u043d\u043d\u043e, \u043d\u043e \u0432\u0441\u0451 \u0436\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c &#8212; \u0437\u0430\u0434\u0430\u0447\u0430 \u043d\u0435\u0442\u0440\u0438\u0432\u0438\u0430\u043b\u044c\u043d\u0430\u044f. Postgres \u0434\u0435\u043b\u0430\u0435\u0442 \u0432\u0441\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0435, \u0447\u0442\u043e\u0431\u044b \u044d\u0442\u043e\u0433\u043e \u043d\u0435 \u0434\u043e\u043f\u0443\u0441\u0442\u0438\u0442\u044c: \u0432\u0432\u043e\u0434\u0438\u0442 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u044f \u043d\u0430 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432, \u043d\u0435 \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0435 \u043a\u043e\u043d\u0444\u0438\u0433\u0440\u0443\u0440\u0430\u0446\u0438\u0438, \u0438 \u0442\u0430\u043a \u0434\u0430\u043b\u0435\u0435.<\/p>\n<p>\u0414\u043b\u044f \u0438\u0437\u043c\u0435\u0440\u0435\u043d\u0438\u044f \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u044f \u0432\u044b\u0431\u0440\u0430\u043b TPC-C \u0432 \u0431\u0435\u043d\u0447\u043c\u0430\u0440\u043a\u0435 Benchbase. \u041f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b:<\/p>\n<ul>\n<li>\n<p>128 warehouses<\/p>\n<\/li>\n<li>\n<p>100 \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0439 \u043a\u0430\u0436\u0434\u044b\u0439<\/p>\n<\/li>\n<li>\n<p>10 000 \u043f\u043e\u043f\u044b\u0442\u043e\u043a \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0442\u0440\u0430\u043d\u0437\u0430\u043a\u0446\u0438\u0439 \u0432 \u0441\u0435\u043a\u0443\u043d\u0434\u0443<\/p>\n<\/li>\n<\/ul>\n<p>\u0421\u043e\u0444\u0442:<\/p>\n<ul>\n<li>\n<p>Postgres 19devel (\u0441\u0431\u043e\u0440\u043a\u0430 \u043e\u0442 7\/14\/2025) \u043d\u0430 Linux 6.15.6<\/p>\n<\/li>\n<\/ul>\n<p>\u0416\u0435\u043b\u0435\u0437\u043e:<\/p>\n<ul>\n<li>\n<p>Ryzen 7950x<\/p>\n<\/li>\n<li>\n<p>32GB RAM<\/p>\n<\/li>\n<li>\n<p>2TB SSD<\/p>\n<\/li>\n<\/ul>\n<p>\u041a\u0430\u0436\u0434\u044b\u0439 \u0442\u0435\u0441\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f 120 \u0441\u0435\u043a\u0443\u043d\u0434, \u0434\u0432\u0430\u0436\u0434\u044b: \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u0434\u043b\u044f \u043f\u0440\u043e\u0433\u0440\u0435\u0432\u0430 \u043a\u044d\u0448\u0430, \u043f\u043e\u0442\u043e\u043c \u043f\u043e-\u0441\u0435\u0440\u044c\u0435\u0437\u043d\u043e\u043c\u0443.<\/p>\n<p>\u0421 \u0447\u0435\u043c \u0441\u0440\u0430\u0432\u043d\u0438\u0432\u0430\u044e: \u0434\u0435\u0444\u043e\u043b\u0442\u043d\u044b\u0439 <code>postgresql.conf<\/code>, \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u043e\u0434\u043d\u044f\u043b <code>shared_buffers<\/code>, <code>work_mem<\/code> \u0438 \u0447\u0438\u0441\u043b\u043e \u0440\u0430\u0431\u043e\u0447\u0438\u0445 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0432. \u041d\u0430 \u0442\u0430\u043a\u043e\u0439 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 \u043f\u043e\u043b\u0443\u0447\u0430\u044e 7082 TPS. \u0410 \u0442\u0435\u043f\u0435\u0440\u044c \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c, \u043a\u0430\u043a \u0441\u0438\u043b\u044c\u043d\u043e \u043c\u044b \u0441\u043c\u043e\u0436\u0435\u043c \u0435\u0433\u043e \u043e\u0442\u0440\u0438\u0446\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u0440\u0430\u0437\u043e\u0433\u043d\u0430\u0442\u044c.<\/p>\n<h3>\u041a\u044d\u0448\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435? \u041a \u0447\u0435\u0440\u0442\u0443!<\/h3>\n<p>Postgres \u043e\u0447\u0435\u043d\u044c \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u043e \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u0442 \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u043d\u0430 \u0447\u0442\u0435\u043d\u0438\u0435 &#8212; \u0432 \u0442\u043e\u043c \u0447\u0438\u0441\u043b\u0435 \u0431\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044f \u0440\u0430\u0437\u0432\u0438\u0442\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u0435 \u043a\u044d\u0448\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f. \u0427\u0438\u0442\u0430\u0442\u044c \u0441 \u0434\u0438\u0441\u043a\u0430 \u0434\u043e\u043b\u0433\u043e, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043a\u043e\u0433\u0434\u0430 Postgres \u0447\u0438\u0442\u0430\u0435\u0442 \u0431\u043b\u043e\u043a \u0434\u0430\u043d\u043d\u044b\u0445 \u0441 \u0434\u0438\u0441\u043a\u0430, \u043e\u043d \u0441\u0440\u0430\u0437\u0443 \u043a\u043b\u0430\u0434\u0435\u0442 \u0435\u0433\u043e \u0432 \u043e\u043f\u0435\u0440\u0430\u0442\u0438\u0432\u043d\u0443\u044e \u043f\u0430\u043c\u044f\u0442\u044c, \u0447\u0442\u043e\u0431\u044b \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u0437\u0430\u043f\u0440\u043e\u0441 \u043a \u044d\u0442\u043e\u043c\u0443 \u0436\u0435 \u0441\u0430\u043c\u043e\u043c\u0443 \u0431\u043b\u043e\u043a\u0443 \u043b\u0438\u0448\u043d\u0438\u0439 \u0440\u0430\u0437 \u043d\u0435 \u043b\u0430\u0437\u0430\u043b \u043d\u0430 \u0434\u0438\u0441\u043a. \u0421\u0430\u043c\u043e \u0441\u043e\u0431\u043e\u0439, \u044f \u044d\u0442\u043e\u0433\u043e \u0442\u0430\u043a \u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u043d\u0435 \u043c\u043e\u0433\u0443. \u0427\u0442\u043e\u0431\u044b \u0431\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u043e \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u0447\u0438\u0442\u0430\u043b\u0438 \u0434\u0430\u043d\u043d\u044b\u0435 \u0441 \u0434\u0438\u0441\u043a\u0430, \u043c\u043d\u0435 \u043d\u0430\u0434\u043e \u0443\u0436\u0430\u0442\u044c \u0440\u0430\u0437\u043c\u0435\u0440 \u043a\u044d\u0448\u0430 \u043a\u0430\u043a \u043c\u043e\u0436\u043d\u043e \u043c\u0435\u043d\u044c\u0448\u0435. \u0417\u0434\u0435\u0441\u044c \u043c\u043d\u0435 \u043d\u0430 \u043f\u043e\u043c\u043e\u0449\u044c \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442 \u0437\u0430\u043c\u0435\u0447\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 <code>shared_buffers<\/code>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043e\u0442\u0432\u0435\u0447\u0430\u0435\u0442 \u0437\u0430 \u0440\u0430\u0437\u043c\u0435\u0440 \u0431\u0443\u0444\u0435\u0440\u0430 \u043a\u044d\u0448\u0430 \u0438 \u043f\u0440\u043e\u0447\u0438\u0435 \u043a\u0443\u0441\u043a\u0438 \u0432\u044b\u0434\u0435\u043b\u044f\u0435\u043c\u043e\u0439 \u043e\u0431\u0449\u0435\u0439 \u043f\u0430\u043c\u044f\u0442\u0438. \u041a \u043c\u043e\u0435\u043c\u0443 \u0432\u0435\u043b\u0438\u043a\u043e\u043c\u0443 \u0441\u043e\u0436\u0430\u043b\u0435\u043d\u0438\u044e, \u043f\u0440\u043e\u0441\u0442\u043e \u0437\u0430\u0434\u0430\u0442\u044c <code>shared_buffers = 0<\/code> \u043d\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u0441\u044f: Postgres \u043a\u043e \u0432\u0441\u0435\u043c\u0443 \u043f\u0440\u043e\u0447\u0435\u043c\u0443 \u0445\u0440\u0430\u043d\u0438\u0442 \u0437\u0434\u0435\u0441\u044c \u0430\u043a\u0442\u0438\u0432\u043d\u044b\u0435 \u0438 \u043d\u0435\u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u043c\u044b\u0435 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b \u0411\u0414. \u041e\u0434\u043d\u0430\u043a\u043e \u044f \u043c\u043e\u0433\u0443 \u0443\u0436\u0430\u0442\u044c \u0435\u0433\u043e \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u0441\u0435\u0440\u044c\u0435\u0437\u043d\u043e.<\/p>\n<p>\u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u044f \u0441\u043a\u0430\u043a\u043d\u0443\u043b \u0441 <code>10\u0413\u0411<\/code> \u0434\u043e <code>8\u041c\u0411<\/code>.<\/p>\n<pre><code>shared_buffers = 8MB <\/code><\/pre>\n<figure class=\"\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/\/post_images\/f87\/770\/853\/f87770853e5890318245c56c3dd4cd5a.jpg\" sizes=\"(max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/r\/w780\/getpro\/habr\/\/post_images\/f87\/770\/853\/f87770853e5890318245c56c3dd4cd5a.jpg 780w,&#10;       https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/\/post_images\/f87\/770\/853\/f87770853e5890318245c56c3dd4cd5a.jpg 781w\" loading=\"lazy\" decode=\"async\"\/><\/figure>\n<p>\u0418 \u0432\u043e\u0442 \u0443\u0436\u0435 Postgres \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0432 \u0441\u0435\u043c\u044c \u0440\u0430\u0437 \u043c\u0435\u0434\u043b\u0435\u043d\u043d\u0435\u0435! \u041c\u0435\u043d\u044c\u0448\u0435 \u0431\u0443\u0444\u0435\u0440 &#8212; \u043c\u0435\u043d\u044c\u0448\u0435 \u0441\u0442\u0440\u0430\u043d\u0438\u0446 \u0445\u0440\u0430\u043d\u0438\u0442\u0441\u044f \u0432 \u043e\u043f\u0435\u0440\u0430\u0442\u0438\u0432\u043a\u0435. \u041f\u0440\u043e\u0446\u0435\u043d\u0442 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432, \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u043c\u044b\u0445 \u0431\u0435\u0437 \u043e\u0431\u0440\u0430\u0449\u0435\u043d\u0438\u044f \u043a \u041e\u0421, \u0440\u0443\u0445\u043d\u0443\u043b \u0441 99.90% \u0434\u043e 70.52%, \u0430 \u0447\u0438\u0441\u043b\u043e \u0446\u0438\u043a\u043b\u043e\u0432 \u0447\u0442\u0435\u043d\u0438\u044f \u0441 \u0434\u0438\u0441\u043a\u0430 \u0432\u044b\u0440\u043e\u0441\u043b\u043e \u0432 300 \u0440\u0430\u0437.<\/p>\n<p>\u041d\u043e \u044d\u0442\u043e \u0442\u043e\u043b\u044c\u043a\u043e \u043d\u0430\u0447\u0430\u043b\u043e. 70% &#8212; \u044d\u0442\u043e \u0432\u0441\u0435 \u0435\u0449\u0435 \u0441\u043b\u0438\u0448\u043a\u043e\u043c \u043c\u043d\u043e\u0433\u043e \u043a\u044d\u0448\u0430. \u0412\u0442\u043e\u0440\u0430\u044f \u043f\u043e\u043f\u044b\u0442\u043a\u0430: 128\u043a\u0411.<\/p>\n<figure class=\"\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/\/post_images\/106\/ba0\/1c7\/106ba01c75c3f65b9d4bb507836a2efc.png\" sizes=\"(max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/r\/w780\/getpro\/habr\/\/post_images\/106\/ba0\/1c7\/106ba01c75c3f65b9d4bb507836a2efc.png 780w,&#10;       https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/\/post_images\/106\/ba0\/1c7\/106ba01c75c3f65b9d4bb507836a2efc.png 781w\" loading=\"lazy\" decode=\"async\"\/><\/figure>\n<p>\u041c-\u0434\u0430. 128\u043a\u0411 \u043a\u044d\u0448\u0430 \u0432\u043c\u0435\u0449\u0430\u044e\u0442 \u043c\u0430\u043a\u0441\u0438\u043c\u0443\u043c 16 \u0441\u0442\u0440\u0430\u043d\u0438\u0446 \u0414\u0411 (\u044d\u0442\u043e \u0431\u0435\u0437 \u0443\u0447\u0435\u0442\u0430 \u0432\u0441\u0435\u0433\u043e \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u043e\u0433\u043e, \u0447\u0442\u043e Postgres \u0445\u043e\u0447\u0435\u0442 \u0442\u0430\u043c \u0445\u0440\u0430\u043d\u0438\u0442\u044c). \u0410 \u043d\u0430\u0448\u0430 \u0421\u0423\u0411\u0414 \u0431\u0443\u0434\u0442\u043e \u0431\u044b \u0445\u043e\u0447\u0435\u0442 \u0432\u0438\u0434\u0435\u0442\u044c \u0431\u043e\u043b\u044c\u0448\u0435 \u0447\u0435\u043c 16 \u0441\u0442\u0440\u0430\u043d\u0438\u0446 \u043e\u0434\u043d\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e. \u042f \u043f\u043e\u043a\u043e\u0432\u044b\u0440\u044f\u043b\u0441\u044f \u0435\u0449\u0435 \u0438 \u0432 \u0438\u0442\u043e\u0433\u0435 \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043b\u0441\u044f \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u043d\u0430 2\u041c\u0411 &#8212; \u043d\u0438\u0436\u0435 \u0443\u0436\u0435 \u043d\u0438\u043a\u0430\u043a. \u041f\u0440\u044f\u043c\u043e \u0441\u0435\u0439\u0447\u0430\u0441 \u0443 \u043c\u0435\u043d\u044f Postgres \u0432\u044b\u0442\u044f\u0433\u0438\u0432\u0430\u0435\u0442 500 TPS.<\/p>\n<pre><code>shared_buffers = 2MB <\/code><\/pre>\n<figure class=\"\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/\/post_images\/7ea\/d26\/d54\/7ead26d541fb93429abe1c73e4921323.jpg\" sizes=\"(max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/r\/w780\/getpro\/habr\/\/post_images\/7ea\/d26\/d54\/7ead26d541fb93429abe1c73e4921323.jpg 780w,&#10;       https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/\/post_images\/7ea\/d26\/d54\/7ead26d541fb93429abe1c73e4921323.jpg 781w\" loading=\"lazy\" decode=\"async\"\/><\/figure>\n<h3>\u0417\u0430\u0433\u0440\u0443\u0436\u0430\u0435\u043c Postgres \u0431\u0435\u0437\u0443\u043c\u043d\u044b\u043c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e\u043c \u0444\u043e\u043d\u043e\u0432\u044b\u0445 \u0437\u0430\u0434\u0430\u0447<\/h3>\n<p>\u041a\u0440\u043e\u043c\u0435 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0442\u0440\u0430\u043d\u0437\u0430\u043a\u0446\u0438\u0439, Postgres \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442 \u0435\u0449\u0435 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0432\u044b\u0447\u0438\u0441\u043b\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0434\u043e\u0440\u043e\u0433\u0438\u0445 \u0437\u0430\u0434\u0430\u0447. \u0417\u0430\u0434\u0430\u0447, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0432 \u043c\u043e\u0438\u0445 \u0446\u0435\u043b\u044f\u0445. \u041f\u0440\u043e\u0446\u0435\u0441\u0441 \u0430\u0432\u0442\u043e\u043e\u0447\u0438\u0441\u0442\u043a\u0438 &#8212; autovacuum &#8212; \u0438\u0449\u0435\u0442 \u043f\u0443\u0441\u0442\u044b\u0435 \u043c\u0435\u0441\u0442\u0430 \u0432 \u043f\u0430\u043c\u044f\u0442\u0438, \u043e\u0441\u0442\u0430\u0432\u0448\u0438\u0435\u0441\u044f \u043f\u043e\u0441\u043b\u0435 \u0443\u0434\u0430\u043b\u0435\u043d\u0438\u044f \u0438 \u0434\u0440\u0443\u0433\u0438\u0445 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0439, \u0438 \u043d\u0430\u043f\u043e\u043b\u043d\u044f\u0435\u0442 \u0438\u0445 \u0430\u043a\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u043c\u0438 \u0432\u0435\u0440\u0441\u0438\u044f\u043c\u0438 \u0441\u0442\u0440\u043e\u043a. \u041e\u0431\u044b\u0447\u043d\u043e \u044d\u0442\u043e\u0442 \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442\u0441\u044f \u0441\u043f\u0443\u0441\u0442\u044f \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0432\u0440\u0435\u043c\u044f, \u043a\u043e\u0433\u0434\u0430 \u0432 \u0442\u0430\u0431\u043b\u0438\u0446\u0435 \u043f\u0440\u043e\u0438\u0437\u043e\u0448\u043b\u043e \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0439 &#8212; \u0447\u0442\u043e\u0431\u044b \u043d\u0435 \u0442\u0440\u0430\u0442\u0438\u0442\u044c \u0440\u0435\u0441\u0443\u0440\u0441\u044b \u043d\u0430 \u0447\u0442\u0435\u043d\u0438\u0435 \u0438 \u0437\u0430\u043f\u0438\u0441\u044c \u043f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u043e. \u042f \u043c\u043e\u0433\u0443 \u044d\u0442\u043e \u0432\u0440\u0435\u043c\u044f \u043c\u0435\u0436\u0434\u0443 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u043c\u0438 \u0441\u043e\u043a\u0440\u0430\u0442\u0438\u0442\u044c.<\/p>\n<pre><code>autovacuum_vacuum_insert_threshold = 1 # autovacuum \u0441\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u0442 \u043d\u0430 \u043a\u0430\u0436\u0434\u044b\u0439 insert autovacuum_vacuum_threshold = 0 # \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e insert, update \u0438\u043b\u0438 deletes \u0434\u043b\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430 autovacuum autovacuum_vacuum_scale_factor = 0 # \u0434\u043e\u043b\u044f \u043d\u0435\u0437\u0430\u043c\u043e\u0440\u043e\u0436\u0435\u043d\u043d\u043e\u0439 \u0447\u0430\u0441\u0442\u0438 \u0442\u0430\u0431\u043b\u0438\u0446\u044b, \u043d\u0430\u0434\u043e \u0434\u043b\u044f \u0440\u0430\u0441\u0447\u0435\u0442\u0430 \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u044f autovacuum autovacuum_vacuum_max_threshold = 1 # \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e insert, update \u0438\u043b\u0438 deletes \u0434\u043b\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430 autovacuum autovacuum_naptime = 1 # \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u0430\u044f \u0437\u0430\u0434\u0435\u0440\u0436\u043a\u0430 \u043c\u0435\u0436\u0443 \u0437\u0430\u043f\u0443\u0441\u043a\u043e\u043c autovacuum, \u0441\u0435\u043a; \u043a \u0441\u043e\u0436\u0430\u043b\u0435\u043d\u0438\u044e, \u043d\u0438\u0436\u0435 1 \u0441\u0435\u043a \u043d\u0435 \u0441\u0442\u0430\u0432\u0438\u0442\u0441\u044f vacuum_cost_limit = 10000 # \u043b\u0438\u043c\u0438\u0442 \u0441\u0442\u043e\u0438\u043c\u043e\u0441\u0442\u0438 \u0437\u0430\u043f\u0440\u043e\u0441\u0430, \u043f\u0440\u0438 \u043f\u0440\u0438\u0432\u044b\u0448\u0435\u043d\u0438\u0438 \u043e\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u0442 \u043e\u0447\u0438\u0441\u0442\u043a\u0443; \u044f \u043d\u0435 \u0445\u043e\u0447\u0443 \u043e\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0442\u044c \u043e\u0447\u0438\u0441\u0442\u043a\u0443, \u0442\u0430\u043a \u0447\u0442\u043e \u0441\u0442\u0430\u0432\u043b\u044e \u043c\u0430\u043a\u0441\u0438\u043c\u0443\u043c vacuum_cost_page_dirty = 0 vacuum_cost_page_hit = 0 vacuum_cost_page_miss = 0 # \u044d\u0442\u0438 \u0442\u0440\u0438 \u0448\u0442\u0443\u043a\u0438 \u0441\u043d\u0438\u0436\u0430\u044e\u0442 \u0441\u0442\u043e\u0438\u043c\u043e\u0441\u0442\u044c \u043f\u0440\u0438 \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0438 `vacuum_cost_limit` <\/code><\/pre>\n<p>\u0423 \u0430\u0432\u0442\u043e\u043e\u0447\u0438\u0441\u0442\u043a\u0438 \u0435\u0441\u0442\u044c \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440 &#8212; \u043e\u043d \u0441\u043e\u0431\u0438\u0440\u0430\u0435\u0442 \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0443, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043f\u043e\u0442\u043e\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0434\u043b\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u0430\u0432\u0442\u043e\u043e\u0447\u0438\u0441\u0442\u043a\u0438, \u0430 \u0435\u0449\u0435 \u0432 \u043f\u043b\u0430\u043d\u0438\u0440\u043e\u0432\u0449\u0438\u043a\u0435 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432. \u0415\u0433\u043e \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u044f \u0442\u043e\u0436\u0435 \u043c\u043e\u0433\u0443 \u043f\u043e\u0434\u043f\u043e\u0440\u0442\u0438\u0442\u044c. (\u0410 \u043f\u0440\u043e \u043f\u043b\u0430\u043d\u0438\u0440\u043e\u0432\u0449\u0438\u043a \u043f\u043e\u0433\u043e\u0432\u043e\u0440\u0438\u043c \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e &#8212; \u0435\u043c\u0443 \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u0430\u044f \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0430 \u043e\u0442 \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u0430 \u0443\u0436\u0435 \u043d\u0435 \u043f\u043e\u043c\u043e\u0436\u0435\u0442.)<\/p>\n<pre><code>autovacuum_analyze_threshold = 0 # \u0442\u043e \u0436\u0435, \u0447\u0442\u043e \u0438 autovacuum_vacuum_threshold, \u043d\u043e \u0434\u043b\u044f ANALYZE autovacuum_analyze_scale_factor = 0 # \u0442\u043e \u0436\u0435, \u0447\u0442\u043e \u0438 autovacuum_vacuum_scale_factor <\/code><\/pre>\n<p>\u041d\u0443 \u0438 \u043f\u043e\u043f\u044b\u0442\u0430\u0435\u043c\u0441\u044f \u0437\u0430\u043c\u0435\u0434\u043b\u0438\u0442\u044c \u0441\u0430\u043c \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u0430\u0432\u0442\u043e\u043e\u0447\u0438\u0441\u0442\u043a\u0438:<\/p>\n<pre><code>maintenance_work_mem = 128kB # \u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043f\u0430\u043c\u044f\u0442\u0438 \u0432\u044b\u0434\u0435\u043b\u044f\u0435\u0442\u0441\u044f \u043d\u0430 \u043e\u0447\u0438\u0441\u0442\u043a\u0443 log_autovacuum_min_duration = 0 # \u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0434\u043e\u043b\u0436\u043d\u0430 \u0434\u043b\u0438\u0442\u044c\u0441\u044f \u043e\u0447\u0438\u0441\u0442\u043a\u0430 (\u043c\u0441), \u0447\u0442\u043e\u0431\u044b \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u043f\u0440\u043e \u043d\u0435\u0435 \u0432 \u0436\u0443\u0440\u043d\u0430\u043b; \u044f \u0445\u043e\u0447\u0443 \u043f\u0438\u0441\u0430\u0442\u044c \u0432\u0441\u0451 logging_collector = on # \u0432\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u0436\u0443\u0440\u043d\u0430\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0432 \u043f\u0440\u0438\u043d\u0446\u0438\u043f\u0435 log_destination = stderr,jsonlog # \u0444\u043e\u0440\u043c\u0430\u0442 \u0437\u0430\u043f\u0438\u0441\u0438 \u0444\u0430\u0439\u043b\u043e\u0432 \u0436\u0443\u0440\u043d\u0430\u043b\u0430 <\/code><\/pre>\n<p>\u0422\u0443\u0442 \u0441\u0442\u043e\u0438\u0442 \u0437\u0430\u043c\u0435\u0442\u0438\u0442\u044c, \u0447\u0442\u043e \u043f\u0440\u043e\u0442\u0438\u0432\u043e\u043f\u043e\u043b\u043e\u0436\u043d\u044b\u0439 \u043f\u043e\u0434\u0445\u043e\u0434 \u0442\u043e\u0436\u0435 \u0438\u043c\u0435\u0435\u0442 \u043f\u0440\u0430\u0432\u043e \u043d\u0430 \u0436\u0438\u0437\u043d\u044c: \u0435\u0441\u043b\u0438 \u043e\u0442\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u0430\u0432\u0442\u043e\u043e\u0447\u0438\u0441\u0442\u043a\u0443 <em>\u0432\u043e\u043e\u0431\u0449\u0435<\/em>, \u0442\u043e \u043f\u0430\u043c\u044f\u0442\u044c \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u0441\u0442\u0435\u043f\u0435\u043d\u043d\u043e \u0437\u0430\u0431\u0438\u0432\u0430\u0442\u044c\u0441\u044f \u0441\u0442\u0430\u0440\u044b\u043c\u0438 \u0432\u0435\u0440\u0441\u0438\u044f\u043c\u0438 \u0441\u0442\u0440\u043e\u043a, \u0441\u0432\u043e\u0434\u044f \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u0421\u0423\u0411\u0414 \u043d\u0430 \u043d\u0435\u0442. \u041e\u0434\u043d\u0430\u043a\u043e \u0432 \u043c\u043e\u0435\u043c \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u0435 \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u0430 &#8212; \u0432 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u043c \u043d\u0430 \u0437\u0430\u043f\u0438\u0441\u044c, \u0434\u0430 \u0438 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0434\u0432\u0435 \u043c\u0438\u043d\u0443\u0442\u044b, \u0442\u0430\u043a \u0447\u0442\u043e \u044d\u0442\u043e\u0442 \u0432\u0430\u0440\u0438\u0430\u043d\u0442 \u044f \u0441\u0435\u0440\u044c\u0435\u0437\u043d\u043e \u043d\u0435 \u0440\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u043b.<\/p>\n<figure class=\"\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/\/post_images\/76c\/27d\/509\/76c27d509baa022362e18cb242ab43b3.jpg\" sizes=\"(max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/r\/w780\/getpro\/habr\/\/post_images\/76c\/27d\/509\/76c27d509baa022362e18cb242ab43b3.jpg 780w,&#10;       https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/\/post_images\/76c\/27d\/509\/76c27d509baa022362e18cb242ab43b3.jpg 781w\" loading=\"lazy\" decode=\"async\"\/><\/figure>\n<p>\u0421\u0435\u0439\u0447\u0430\u0441 \u043c\u043e\u0439 Postgres \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0432 20 \u0440\u0430\u0437 \u043c\u0435\u0434\u043b\u0435\u043d\u043d\u0435\u0435 \u043e\u0431\u044b\u0447\u043d\u043e\u0433\u043e. \u041f\u043e\u0447\u0435\u043c\u0443 &#8212; \u0432\u0438\u0434\u043d\u043e \u0432 \u043b\u043e\u0433\u0430\u0445:<\/p>\n<pre><code>2025-07-20 09:10:20.455 EDT [25210] LOG:  automatic vacuum of table \"benchbase.public.warehouse\": index scans: 0  pages: 0 removed, 222 remain, 222 scanned (100.00% of total), 0 eagerly scanned  tuples: 0 removed, 354 remain, 226 are dead but not yet removable  removable cutoff: 41662928, which was 523 XIDs old when operation ended  frozen: 0 pages from table (0.00% of total) had 0 tuples frozen  visibility map: 0 pages set all-visible, 0 pages set all-frozen (0 were all-visible)  index scan not needed: 0 pages from table (0.00% of total) had 0 dead item identifiers removed  avg read rate: 116.252 MB\/s, avg write rate: 4.824 MB\/s  buffer usage: 254 hits, 241 reads, 10 dirtied  WAL usage: 2 records, 2 full page images, 16336 bytes, 1 buffers full  system usage: CPU: user: 0.00 s, system: 0.00 s, elapsed: 0.01 s 2025-07-20 09:10:20.773 EDT [25210] LOG:  automatic analyze of table \"benchbase.public.warehouse\"  avg read rate: 8.332 MB\/s, avg write rate: 0.717 MB\/s  buffer usage: 311 hits, 337 reads, 29 dirtied  WAL usage: 36 records, 5 full page images, 42524 bytes, 4 buffers full  system usage: CPU: user: 0.00 s, system: 0.00 s, elapsed: 0.31 s 2025-07-20 09:10:20.933 EDT [25210] LOG:  automatic vacuum of table \"benchbase.public.district\": index scans: 0  pages: 0 removed, 1677 remain, 1008 scanned (60.11% of total), 0 eagerly scanned  tuples: 4 removed, 2047 remain, 557 are dead but not yet removable  removable cutoff: 41662928, which was 686 XIDs old when operation ended  frozen: 0 pages from table (0.00% of total) had 0 tuples frozen  visibility map: 0 pages set all-visible, 0 pages set all-frozen (0 were all-visible)  index scan bypassed: 2 pages from table (0.12% of total) have 9 dead item identifiers  avg read rate: 50.934 MB\/s, avg write rate: 9.945 MB\/s  buffer usage: 1048 hits, 1009 reads, 197 dirtied  WAL usage: 6 records, 1 full page images, 8707 bytes, 0 buffers full  system usage: CPU: user: 0.00 s, system: 0.00 s, elapsed: 0.15 s 2025-07-20 09:10:21.220 EDT [25210] LOG:  automatic analyze of table \"benchbase.public.district\"  avg read rate: 47.235 MB\/s, avg write rate: 1.330 MB\/s  buffer usage: 115 hits, 1705 reads, 48 dirtied  WAL usage: 30 records, 1 full page images, 17003 bytes, 1 buffers full  system usage: CPU: user: 0.00 s, system: 0.00 s, elapsed: 0.28 s 2025-07-20 09:10:21.543 EDT [25212] LOG:  automatic vacuum of table \"benchbase.public.warehouse\": index scans: 0  pages: 0 removed, 222 remain, 222 scanned (100.00% of total), 0 eagerly scanned  tuples: 0 removed, 503 remain, 375 are dead but not yet removable  removable cutoff: 41662928, which was 845 XIDs old when operation ended  frozen: 0 pages from table (0.00% of total) had 0 tuples frozen  visibility map: 0 pages set all-visible, 0 pages set all-frozen (0 were all-visible)  index scan not needed: 0 pages from table (0.00% of total) had 0 dead item identifiers removed  avg read rate: 131.037 MB\/s, avg write rate: 5.083 MB\/s  buffer usage: 268 hits, 232 reads, 9 dirtied  WAL usage: 1 records, 0 full page images, 258 bytes, 0 buffers full  system usage: CPU: user: 0.00 s, system: 0.00 s, elapsed: 0.01 s 2025-07-20 09:10:21.813 EDT [25212] LOG:  automatic analyze of table \"benchbase.public.warehouse\"  avg read rate: 10.244 MB\/s, avg write rate: 0.851 MB\/s  buffer usage: 307 hits, 337 reads, 28 dirtied  WAL usage: 33 records, 3 full page images, 30864 bytes, 2 buffers full  system usage: CPU: user: 0.00 s, system: 0.00 s, elapsed: 0.25 s ... \u0418 \u0442\u0430\u043a \u0434\u0430\u043b\u0435\u0435 <\/code><\/pre>\n<p>Postgres \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442 \u0430\u0432\u0442\u043e\u043e\u0447\u0438\u0441\u0442\u043a\u0443 \u0438 \u0430\u043d\u0430\u043b\u0438\u0437 \u043d\u0430 \u0433\u043e\u0440\u044f\u0447\u0438\u0445 \u0442\u0430\u0431\u043b\u0438\u0446\u0430\u0445 \u0440\u0430\u0437 \u0432 \u0441\u0435\u043a\u0443\u043d\u0434\u0443. \u042f \u0443\u0440\u0435\u0437\u0430\u043b \u043a\u044d\u0448, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0441\u0442\u0440\u0430\u043d\u0438\u0446 \u0432 \u043e\u043f\u0435\u0440\u0430\u0442\u0438\u0432\u043a\u0435 \u043e\u0447\u0435\u043d\u044c \u043c\u0430\u043b\u043e, \u0438 \u0441\u0438\u0441\u0442\u0435\u043c\u0435 \u043f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u043e \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0447\u0438\u0442\u0430\u0442\u044c \u0434\u0438\u0441\u043a. \u0421\u0430\u043c\u043e\u0435 \u043f\u0440\u0438\u043a\u043e\u043b\u044c\u043d\u043e\u0435 &#8212; \u0432\u0441\u0435 \u044d\u0442\u0438 \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u043d\u0430 \u0447\u0442\u0435\u043d\u0438\u0435 \u0441\u043e\u0432\u0435\u0440\u0448\u0435\u043d\u043d\u043e \u0431\u0435\u0441\u043f\u043e\u043b\u0435\u0437\u043d\u044b, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u0434\u0430\u043d\u043d\u044b\u0435 \u043c\u0435\u0436\u0434\u0443 \u043f\u0440\u043e\u0433\u043e\u043d\u0430\u043c\u0438 \u043d\u0435 \u043c\u0435\u043d\u044f\u044e\u0442\u0441\u044f! \u041e\u0434\u043d\u0430\u043a\u043e 293 TPS &#8212; \u044d\u0442\u043e \u0432\u0441\u0451 \u0435\u0449\u0435 \u0441\u043b\u0438\u0448\u043a\u043e\u043c \u043c\u043d\u043e\u0433\u043e.<\/p>\n<h3>\u041f\u0440\u0435\u0432\u0440\u0430\u0449\u0430\u0435\u043c Postgres \u0432 \u0414\u0430\u0440\u044c\u044e \u0414\u043e\u043d\u0446\u043e\u0432\u0443<\/h3>\n<p><a href=\"https:\/\/ru.wikipedia.org\/wiki\/%D0%94%D0%BE%D0%BD%D1%86%D0%BE%D0%B2%D0%B0,_%D0%94%D0%B0%D1%80%D1%8C%D1%8F#%D0%A2%D0%B8%D1%80%D0%B0%D0%B6%D0%B8_%D0%B8_%D1%87%D0%B8%D1%81%D0%BB%D0%BE_%D0%B8%D0%B7%D0%B4%D0%B0%D0%BD%D0%BD%D1%8B%D1%85_%D0%BA%D0%BD%D0%B8%D0%B3\" rel=\"noopener noreferrer nofollow\">\u0414\u0430\u0440\u044c\u044f \u0414\u043e\u043d\u0446\u043e\u0432\u0430 \u043f\u0438\u0448\u0435\u0442 \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u043c\u043d\u043e\u0433\u043e<\/a>. \u0417\u043d\u0430\u0435\u0442\u0435, \u043a\u0442\u043e \u0435\u0449\u0435 \u043c\u043d\u043e\u0433\u043e \u043f\u0438\u0448\u0435\u0442? Postgres \u043f\u043e\u0441\u043b\u0435 \u043c\u043e\u0438\u0445 \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u043e\u0432 \u0441 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0435\u0439 WAL. \u041f\u0440\u0435\u0436\u0434\u0435 \u0447\u0435\u043c \u0432\u043d\u0435\u0441\u0442\u0438 \u0434\u0430\u043d\u043d\u044b\u0435 \u0432 \u0444\u0430\u0439\u043b\u044b \u0411\u0414, Postgres \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442 \u0438\u0437 \u0432 \u0436\u0443\u0440\u043d\u0430\u043b \u043f\u0440\u0435\u0434\u0432\u0430\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0439 \u0437\u0430\u043f\u0438\u0441\u0438 (WAL, Write Ahead Log), \u0438 \u0432\u0440\u0435\u043c\u044f \u043e\u0442 \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u0442 \u0438\u0445 \u0432 \u043f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u0443\u044e \u043f\u0430\u043c\u044f\u0442\u044c, \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u044f \u0447\u0435\u043a\u043f\u043e\u0438\u043d\u0442\u044b. \u042d\u0442\u043e\u0442 \u0441\u0430\u043c\u044b\u0439 \u0436\u0443\u0440\u043d\u0430\u043b \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u0433\u0438\u0431\u043a\u043e \u043d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u0442\u0441\u044f, \u043a \u0435\u0433\u043e \u0441\u043e\u0436\u0430\u043b\u0435\u043d\u0438\u044e. \u0412\u043e-\u043f\u0435\u0440\u0432\u044b\u0445, Postgres \u043e\u0431\u044b\u0447\u043d\u043e \u0445\u0440\u0430\u043d\u0438\u0442 \u0447\u0430\u0441\u0442\u044c WAL \u0432 \u043f\u0430\u043c\u044f\u0442\u0438, \u043f\u0440\u0435\u0436\u0434\u0435 \u0447\u0435\u043c \u0437\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u043d\u0430 \u0434\u0438\u0441\u043a. \u041d\u0435\u0434\u043e\u043f\u0443\u0441\u0442\u0438\u043c\u043e!<\/p>\n<pre><code>wal_writer_flush_after = 0 # \u041c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u0439 \u043e\u0431\u044a\u0435\u043c WAL \u0434\u043b\u044f \u0437\u0430\u043f\u0438\u0441\u0438 wal_writer_delay = 1 # \u041c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u0430\u044f \u043f\u0430\u0443\u0437\u0430 \u043c\u0435\u0436\u0434\u0443 \u0437\u0430\u043f\u0438\u0441\u044c\u044e WAL <\/code><\/pre>\n<p>\u0410 \u0435\u0449\u0435 \u043f\u0443\u0441\u043a\u0430\u0439 WAL \u0434\u0435\u043b\u0430\u0435\u0442 \u0447\u0435\u043a\u043f\u043e\u0438\u043d\u0442\u044b \u043a\u0430\u043a \u043c\u043e\u0436\u043d\u043e \u0447\u0430\u0449\u0435!<\/p>\n<pre><code>min_wal_size = 32MB # \u041c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u0439 \u0440\u0430\u0437\u043c\u0435\u0440 WAL \u043f\u043e\u0441\u043b\u0435 \u0447\u0435\u043a\u043f\u043e\u0438\u043d\u0442\u0430; \u044f \u0445\u043e\u0447\u0443 \u043a\u0430\u043a \u043c\u043e\u0436\u043d\u043e \u0447\u0430\u0449\u0435 \u0447\u0435\u043a\u043f\u043e\u0438\u043d\u0442\u0438\u0442\u044c max_wal_size = 32MB # \u041c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u0439 \u0440\u0430\u0437\u043c\u0435\u0440 WAL, \u043f\u043e\u0441\u043b\u0435 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0447\u0435\u043a\u043f\u043e\u0438\u043d\u0442.  <\/code><\/pre>\n<p>\u041a \u0441\u043e\u0436\u0430\u043b\u0435\u043d\u0438\u044e, \u043e\u0431\u0430 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043f\u0440\u0438\u0434\u0435\u0442\u0441\u044f \u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u043d\u0435 \u043d\u0438\u0436\u0435 32\u041c\u0411 &#8212; \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u0439 \u0440\u0430\u0437\u043c\u0435\u0440 \u0434\u043b\u044f \u0434\u0432\u0443\u0445 \u0441\u0435\u0433\u043c\u0435\u043d\u0442\u043e\u0432 WAL<\/p>\n<pre><code>checkpoint_timeout = 30 # \u041c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u0430\u044f \u043f\u0430\u0443\u0437\u0430 \u043c\u0435\u0436\u0434\u0443 \u0447\u0435\u043a\u043f\u043e\u0438\u043d\u0442\u0430\u043c\u0438; \u043c\u0435\u043d\u044c\u0448\u0435 30 \u0441\u0435\u043a\u0443\u043d\u0434 \u043d\u0435 \u0434\u0430\u0451\u0442 checkpoint_flush_after = 1 # \u041f\u0438\u0441\u0430\u0442\u044c \u043d\u0430 \u0434\u0438\u0441\u043a \u043a\u0430\u0436\u0434\u044b\u0435 8kB <\/code><\/pre>\n<p>\u0418, \u0441\u0430\u043c\u043e \u0441\u043e\u0431\u043e\u0439, WAL \u0434\u043e\u043b\u0436\u0435\u043d \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0442\u044c\u0441\u044f \u043d\u0430 \u0434\u0438\u0441\u043a \u043a\u0430\u043a \u043c\u043e\u0436\u043d\u043e \u0447\u0430\u0449\u0435.<\/p>\n<pre><code>wal_sync_method = open_datasync # \u041a\u0430\u043a \u043f\u0438\u0441\u0430\u0442\u044c \u043d\u0430 \u0434\u0438\u0441\u043a; \u0432\u044b\u0431\u0438\u0440\u0430\u0435\u043c \u0441\u0430\u043c\u044b\u0439 \u043c\u0435\u0434\u043b\u0435\u043d\u043d\u044b\u0439 wal_level = logical # \u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0442\u044c \u0432 \u0436\u0443\u0440\u043d\u0430\u043b \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u0443\u044e \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u0434\u043b\u044f \u0440\u0435\u043f\u043b\u0438\u043a\u0430\u0446\u0438\u0438; \u041d\u0430\u043c \u044d\u0442\u0430 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u0430\u044f \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u0431\u0435\u0437 \u043d\u0430\u0434\u043e\u0431\u043d\u043e\u0441\u0442\u0438, \u043d\u043e \u0441 \u043d\u0435\u0439 \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u043f\u0438\u0441\u0430\u0442\u044c \u0431\u043e\u043b\u044c\u0448\u0435 wal_log_hints = on # \u041f\u0438\u0441\u0430\u0442\u044c \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u043d\u044b\u0435 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b \u0446\u0435\u043b\u0438\u043a\u043e\u043c summarize_wal = on # \u0415\u0449\u0435 \u043e\u0434\u0438\u043d \u043b\u0438\u0448\u043d\u0438\u0439 \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u0434\u043b\u044f \u0431\u0435\u043a\u0430\u043f\u043e\u0432 track_wal_io_timing = on # \u0421\u043e\u0431\u0438\u0440\u0430\u0435\u043c \u0431\u043e\u043b\u044c\u0448\u0435 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 checkpoint_completion_target = 0 # \u041d\u0435 \u0440\u0430\u0437\u0434\u0430\u0432\u0430\u0442\u044c I\/O \u0432\u0441\u0435\u043c \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430\u043c <\/code><\/pre>\n<figure class=\"\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/\/post_images\/be0\/caa\/bf2\/be0caabf2402bcb36183771b9abc6cfb.jpg\" sizes=\"(max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/r\/w780\/getpro\/habr\/\/post_images\/be0\/caa\/bf2\/be0caabf2402bcb36183771b9abc6cfb.jpg 780w,&#10;       https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/\/post_images\/be0\/caa\/bf2\/be0caabf2402bcb36183771b9abc6cfb.jpg 781w\" loading=\"lazy\" decode=\"async\"\/><\/figure>\n<p>\u041f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c Postgres \u0443\u043f\u0430\u043b\u0430 \u043d\u0438\u0436\u0435 \u0441\u043e\u0442\u043d\u0438 \u0442\u0440\u0430\u043d\u0437\u0430\u043a\u0446\u0438\u0439 \u0432 \u0441\u0435\u043a\u0443\u043d\u0434\u0443: \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u0432 70 \u0440\u0430\u0437 \u043d\u0438\u0436\u0435 \u0434\u0435\u0444\u043e\u043b\u0442\u043d\u043e\u0439. \u0416\u0443\u0440\u043d\u0430\u043b \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0435\u0442, \u0447\u0442\u043e \u043c\u043e\u0438 \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u044b \u0441 WAL \u043d\u0435 \u043f\u0440\u043e\u0448\u043b\u0438 \u0437\u0440\u044f:<\/p>\n<pre><code>2025-07-20 12:33:17.211 EDT [68697] LOG:  checkpoint complete: wrote 19 buffers (7.4%), wrote 2 SLRU buffers; 0 WAL file(s) added, 3 removed, 0 recycled; write=0.094 s, sync=0.042 s, total=0.207 s; sync files=57, longest=0.004 s, average=0.001 s; distance=31268 kB, estimate=31268 kB; lsn=1B7\/3CDC1B80, redo lsn=1B7\/3C11CD48 2025-07-20 12:33:17.458 EDT [68697] LOG:  checkpoints are occurring too frequently (0 seconds apart) 2025-07-20 12:33:17.458 EDT [68697] HINT:  Consider increasing the configuration parameter \"max_wal_size\". 2025-07-20 12:33:17.494 EDT [68697] LOG:  checkpoint starting: wal 2025-07-20 12:33:17.738 EDT [68697] LOG:  checkpoint complete: wrote 18 buffers (7.0%), wrote 1 SLRU buffers; 0 WAL file(s) added, 2 removed, 0 recycled; write=0.089 s, sync=0.047 s, total=0.280 s; sync files=50, longest=0.009 s, average=0.001 s; distance=34287 kB, estimate=34287 kB; lsn=1B7\/3F1F7B18, redo lsn=1B7\/3E298BA0 2025-07-20 12:33:17.923 EDT [68697] LOG:  checkpoints are occurring too frequently (0 seconds apart) 2025-07-20 12:33:17.923 EDT [68697] HINT:  Consider increasing the configuration parameter \"max_wal_size\". 2025-07-20 12:33:17.971 EDT [68697] LOG:  checkpoint starting: wal <\/code><\/pre>\n<p>\u0414\u0430, \u043e\u0431\u044b\u0447\u043d\u043e WAL \u043d\u0435 \u0447\u0435\u043a\u043f\u043e\u0438\u043d\u0442\u0438\u0442\u0441\u044f \u043a\u0430\u0436\u0434\u044b\u0435 *487 \u043c\u0438\u043b\u043b\u0438\u0441\u0435\u043a\u0443\u043d\u0434*. But I am still not done.<\/p>\n<h3>(\u041f\u043e \u0441\u0443\u0442\u0438) \u0443\u0434\u0430\u043b\u044f\u0435\u043c \u0438\u043d\u0434\u0435\u043a\u0441\u044b<\/h3>\n<p>\u0414\u0430, \u0432 \u043d\u0430\u0447\u0430\u043b\u0435 \u0441\u0442\u0430\u0442\u044c\u0438 \u044f \u043e\u0431\u0435\u0449\u0430\u043b, \u0447\u0442\u043e \u044f \u043d\u0435 \u0431\u0443\u0434\u0443 \u0442\u0440\u043e\u0433\u0430\u0442\u044c \u0438\u043d\u0434\u0435\u043a\u0441\u044b. \u0422\u0430\u043a \u044f \u0438 \u043d\u0435 \u0431\u0443\u0434\u0443. \u041a\u043e\u0433\u0434\u0430 Postgres \u0441\u0442\u0440\u043e\u0438\u0442 \u043f\u043b\u0430\u043d\u044b \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432, \u043e\u043d \u0441\u0447\u0438\u0442\u0430\u0435\u0442, \u0447\u0442\u043e \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0430\u043c, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0440\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u044b \u043d\u0430 \u0434\u0438\u0441\u043a\u0435 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e, \u0434\u0435\u0448\u0435\u0432\u043b\u0435, \u0447\u0435\u043c \u043a \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0430\u043c, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0440\u0430\u0441\u043a\u0438\u0434\u0430\u043d\u044b \u0432 \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u043e\u043c \u043f\u043e\u0440\u044f\u0434\u043a\u0435. \u042d\u0442\u043e \u043b\u043e\u0433\u0438\u0447\u043d\u043e, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u043d\u0430 \u0436\u0435\u0441\u0442\u043a\u043e\u043c \u0434\u0438\u0441\u043a\u0435 \u0447\u0438\u0442\u0430\u0442\u044c \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u0431\u044b\u0441\u0442\u0440\u0435\u0435, \u0447\u0435\u043c \u0441\u043a\u0430\u043a\u0430\u0442\u044c \u0442\u0443\u0434\u0430-\u0441\u044e\u0434\u0430. \u041a\u043e\u0433\u0434\u0430 \u043a \u0442\u0430\u0431\u043b\u0438\u0446\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u0437\u0430\u043f\u0440\u043e\u0441 \u043f\u043e \u0438\u043d\u0434\u0435\u043a\u0441\u0443, \u0442\u043e \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b \u043d\u0430 \u0434\u0438\u0441\u043a\u0435 \u043e\u0431\u044b\u0447\u043d\u043e \u0440\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u044b \u0432 \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u043e\u043c \u043f\u043e\u0440\u044f\u0434\u043a\u0435. \u041f\u0440\u0438 \u0447\u0442\u0435\u043d\u0438\u0438 \u0436\u0435 \u0432\u0441\u0435\u0439 \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b \u0447\u0438\u0442\u0430\u044e\u0442\u0441\u044f \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e. \u041f\u043b\u0430\u043d\u0438\u0440\u043e\u0432\u0449\u0438\u043a \u044d\u0442\u043e \u043f\u043e\u043d\u0438\u043c\u0430\u0435\u0442 \u0438 \u0443\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u0442 \u043f\u0440\u0438 \u0440\u0430\u0441\u0447\u0435\u0442\u0435 \u0441\u0442\u043e\u0438\u043c\u043e\u0441\u0442\u0438 \u0437\u0430\u043f\u0440\u043e\u0441\u0430.<\/p>\n<pre><code>random_page_cost = 1e300 # sets the cost of accessing a random page cpu_index_tuple_cost = 1e300 # sets the cost of processing one tuple from an index <\/code><\/pre>\n<p>\u0418\u0437\u043c\u0435\u043d\u0438\u0432 \u044d\u0442\u0438 \u0434\u0432\u0430 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430, \u044f \u0444\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u043e\u0442\u043a\u043b\u044e\u0447\u0438\u043b \u0438\u043d\u0434\u0435\u043a\u0441\u044b. \u041c\u043d\u0435 \u043f\u0440\u0438\u0448\u043b\u043e\u0441\u044c \u043f\u043e\u0434\u043d\u044f\u0442\u044c <code>shared_buffers<\/code> \u043e\u0431\u0440\u0430\u0442\u043d\u043e \u0434\u043e <code>8\u041c\u0411<\/code>, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u0438\u043d\u0430\u0447\u0435 \u0432\u044b\u0445\u043e\u0434\u0438\u043b\u0438 \u043e\u0448\u0438\u0431\u043a\u0438 \u043f\u0440\u0438 \u0441\u043a\u0430\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0438 \u0442\u0430\u0431\u043b\u0438\u0446, \u043d\u043e \u043d\u0430 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u044d\u0442\u043e \u0432 \u0438\u0442\u043e\u0433\u0435 \u043e\u0441\u043e\u0431\u043e \u043d\u0435 \u0441\u043a\u0430\u0437\u0430\u043b\u043e\u0441\u044c.<\/p>\n<figure class=\"\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/\/post_images\/e01\/aa1\/746\/e01aa174634c47bb1467102f9bc0af17.jpg\" sizes=\"(max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/r\/w780\/getpro\/habr\/\/post_images\/e01\/aa1\/746\/e01aa174634c47bb1467102f9bc0af17.jpg 780w,&#10;       https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/\/post_images\/e01\/aa1\/746\/e01aa174634c47bb1467102f9bc0af17.jpg 781w\" loading=\"lazy\" decode=\"async\"\/><\/figure>\n<p> \u041c\u043e\u0439 Postgres \u0442\u0435\u043f\u0435\u0440\u044c \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u0442 \u043c\u0435\u043d\u044c\u0448\u0435 \u043e\u0434\u043d\u043e\u0439 \u0442\u0440\u0430\u043d\u0437\u0430\u043a\u0446\u0438\u0438 \u0432 \u0441\u0435\u043a\u0443\u043d\u0434\u0443, \u0432 7000 \u043c\u0435\u0434\u043b\u0435\u043d\u043d\u0435\u0435 \u0432\u0435\u0440\u0441\u0438\u0438 \u0438\u0437 \u043a\u043e\u0440\u043e\u0431\u043a\u0438, \u0438 \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u044f \u043d\u0435 \u0442\u0440\u043e\u0433\u0430\u043b \u043d\u0438\u0447\u0435\u0433\u043e \u043a\u0440\u043e\u043c\u0435 <code>postgresql.conf<\/code>. \u041e\u0434\u043d\u0430\u043a\u043e \u0443 \u043c\u0435\u043d\u044f \u0435\u0441\u0442\u044c \u0435\u0449\u0435 \u043e\u0434\u0438\u043d \u0442\u0443\u0437 \u0432 \u0440\u0443\u043a\u0430\u0432\u0435. <\/p>\n<h3>\u041f\u0440\u0438\u043d\u0443\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u0432\u044b\u0432\u043e\u0434 \u0432\u0441\u0435\u0433\u043e I\/O \u0432 \u043e\u0434\u0438\u043d \u043f\u043e\u0442\u043e\u043a<\/h3>\n<p>Postgres \u043e\u0434\u043d\u043e\u043f\u043e\u0442\u043e\u0447\u043d\u044b\u043c \u043d\u0435 \u0441\u0434\u0435\u043b\u0430\u0442\u044c, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u043a\u0430\u0436\u0434\u043e\u0435 \u0438\u0437 \u0441\u043e\u0442\u043d\u0438 \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0439 &#8212; \u044d\u0442\u043e \u0441\u0432\u043e\u0439 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0439 \u043f\u0440\u043e\u0446\u0435\u0441\u0441. \u041d\u043e \u0441\u0432\u0435\u0436\u0435\u043d\u044c\u043a\u0438\u0439 Postgres 18 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043c\u043d\u0435 \u0441\u0432\u0435\u0441\u0442\u0438 \u0432 \u043e\u0434\u0438\u043d \u043f\u043e\u0442\u043e\u043a \u0432\u0435\u0441\u044c \u0432\u0432\u043e\u0434-\u0432\u044b\u0432\u043e\u0434. \u0412 18-\u0439 \u0432\u0435\u0440\u0441\u0438\u0438 \u043f\u043e\u044f\u0432\u0438\u043b\u0441\u044f \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 <code>io_method<\/code>. \u041e\u043d \u043e\u0442\u0432\u0435\u0447\u0430\u0435\u0442 \u0437\u0430 \u0442\u043e, \u043a\u0430\u043a \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u044b\u0435 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442 \u0432\u044b\u0437\u043e\u0432\u044b \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u0432\u0432\u043e\u0434\u0430-\u0432\u044b\u0432\u043e\u0434\u0430: \u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u043e (<code>io_method = sync<\/code>), \u0430\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u043e \u043f\u0440\u043e\u0441\u044f\u0442 \u0441\u0435\u0440\u0432\u0435\u0440\u043d\u044b\u0435 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u044b \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0442\u044c \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u044b\u0435 \u0437\u0430\u043f\u0440\u043e\u0441\u044b (<code>io_method = worker<\/code>) \u0438\u043b\u0438 \u0436\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442 \u0441\u0432\u0435\u0436\u0435\u0438\u0441\u043f\u0435\u0447\u0435\u043d\u043d\u044b\u0439 API Linux <code>io_uring<\/code> (<code>io_method = io_uring<\/code>). \u041f\u0440\u0438 \u044d\u0442\u043e\u043c \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 <code>io_workers<\/code> \u0432\u0441\u0451 \u0435\u0449\u0435 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0437\u0430\u0434\u0430\u0442\u044c \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0440\u0430\u0431\u043e\u0447\u0438\u0445 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0432. \u0415\u0441\u043b\u0438 \u0443\u043a\u0430\u0437\u0430\u0442\u044c <code>io_method=worker<\/code> \u0438 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0438\u0442\u044c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0440\u0430\u0431\u043e\u0447\u0438\u0445 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0432 \u0434\u043e \u043e\u0434\u043d\u043e\u0433\u043e, \u0442\u043e \u0432\u0435\u0441\u044c \u0432\u0432\u043e\u0434-\u0432\u044b\u0432\u043e\u0434 \u0431\u0443\u0434\u0435\u0442 \u0438\u0434\u0442\u0438 \u0447\u0435\u0440\u0435\u0437 \u043e\u0434\u0438\u043d-\u0435\u0434\u0438\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0439 \u043f\u0440\u043e\u0446\u0435\u0441\u0441.<\/p>\n<pre><code>io_method = worker io_workers = 1 <\/code><\/pre>\n<figure class=\"\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/\/post_images\/148\/a14\/569\/148a14569e6fcd7e5e3fd47dae45ecdc.jpg\" sizes=\"(max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/r\/w780\/getpro\/habr\/\/post_images\/148\/a14\/569\/148a14569e6fcd7e5e3fd47dae45ecdc.jpg 780w,&#10;       https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/\/post_images\/148\/a14\/569\/148a14569e6fcd7e5e3fd47dae45ecdc.jpg 781w\" loading=\"lazy\" decode=\"async\"\/><\/figure>\n<p>\u041d\u0443 \u0432\u043e\u0442, Postgres \u0442\u0435\u043f\u0435\u0440\u044c \u043d\u0435 \u0434\u043e\u0442\u044f\u0433\u0438\u0432\u0430\u0435\u0442 \u0434\u0430\u0436\u0435 \u0434\u043e 0.1 TPS: \u0432 42 000 \u0440\u0430\u0437 \u043c\u0435\u0434\u043b\u0435\u043d\u043d\u0435\u0435, \u0447\u0435\u043c \u043d\u0430 \u0441\u0442\u0430\u0440\u0442\u0435. \u0415\u0441\u043b\u0438 \u0438\u0441\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u0442\u0440\u0430\u043d\u0437\u0430\u043a\u0446\u0438\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u043e\u043f\u0430\u043b\u0438 \u0432\u043e \u0432\u0437\u0430\u0438\u043c\u043d\u044b\u0435 \u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u043a\u0438, \u0442\u043e \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u044f \u0435\u0449\u0435 \u0445\u0443\u0436\u0435 (\u043b\u0443\u0447\u0448\u0435?): \u043d\u0430 100 \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0439 \u0438 \u0437\u0430 120 \u0441\u0435\u043a\u0443\u043d\u0434 \u0431\u044b\u043b\u043e \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0430\u043d\u043e \u0432\u0441\u0435\u0433\u043e-\u0442\u043e 11 \u0442\u0440\u0430\u043d\u0437\u0430\u043a\u0446\u0438\u0439.<\/p>\n<h3>\u0417\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435<\/h3>\n<p>\u0428\u0442\u043e\u0448. \u041d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0447\u0430\u0441\u043e\u0432 \u0440\u0430\u0431\u043e\u0442\u044b \u0438 32 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u043d\u044b\u0445 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 &#8212; \u0438 Postgres \u0443\u0431\u0438\u0442. \u041a\u0442\u043e \u0431\u044b \u043c\u043e\u0433 \u043f\u043e\u0434\u0443\u043c\u0430\u0442\u044c, \u0447\u0442\u043e \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0442\u0432\u043e\u0440\u0438\u0442\u044c \u0442\u0430\u043a\u0438\u0445 \u0434\u0435\u043b, \u043d\u0435 \u0432\u044b\u043b\u0435\u0437\u0430\u044f \u0438\u0437 <code>postgresql.conf<\/code>? \u041a\u043e\u0433\u0434\u0430 \u044f \u043d\u0430\u0447\u0438\u043d\u0430\u043b \u044d\u0442\u043e\u0442 \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442, \u044f \u043d\u0430\u0434\u0435\u044f\u043b\u0441\u044f \u0437\u0430\u043c\u0435\u0434\u043b\u0438\u0442\u044c \u0441\u0438\u0441\u0442\u0435\u043c\u0443 \u0445\u043e\u0442\u044f \u0431\u044b \u0434\u043e \u0434\u0435\u0441\u044f\u0442\u0438 \u0442\u0440\u0430\u043d\u0437\u0430\u043a\u0446\u0438\u0439 \u0432 \u0441\u0435\u043a\u0443\u043d\u0434\u0443. \u0427\u0442\u043e \u0437\u0430 \u0434\u0435\u043b\u0430 Postgres? \u0412\u043e\u0442 \u043c\u043e\u044f \u0444\u0438\u043d\u0430\u043b\u044c\u043d\u0430\u044f \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044f \u0434\u043b\u044f \u0436\u0435\u043b\u0430\u044e\u0449\u0438\u0445 \u043f\u043e\u0432\u0442\u043e\u0440\u0438\u0442\u044c \u044d\u0442\u043e \u0432\u0441\u0451 \u0441\u0430\u043c\u043e\u0441\u0442\u043e\u044f\u0442\u0435\u043b\u044c\u043d\u043e:<\/p>\n<pre><code>shared_buffers = 8MB autovacuum_vacuum_insert_threshold = 1 autovacuum_vacuum_threshold = 0 autovacuum_vacuum_scale_factor = 0 autovacuum_vacuum_max_threshold = 1 autovacuum_naptime = 1 vacuum_cost_limit = 10000 vacuum_cost_page_dirty = 0 vacuum_cost_page_hit = 0 vacuum_cost_page_miss = 0 autovacuum_analyze_threshold = 0 autovacuum_analyze_scale_factor = 0 maintenance_work_mem = 128kB log_autovacuum_min_duration = 0 logging_collector = on log_destination = stderr,jsonlog wal_writer_flush_after = 0 wal_writer_delay = 1 min_wal_size = 32MB max_wal_size = 32MB checkpoint_timeout = 30 checkpoint_flush_after = 1 wal_sync_method = open_datasync wal_level = logical wal_log_hints = on summarize_wal = on track_wal_io_timing = on checkpoint_completion_target = 0 random_page_cost = 1e300 cpu_index_tuple_cost = 1e300 io_method = worker io_workers = 1 <\/code><\/pre>\n<p>\u0414\u043b\u044f \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0430\u0441\u044c <a href=\"https:\/\/github.com\/cmu-db\/benchbase\" rel=\"noopener noreferrer nofollow\">BenchBase Postgres<\/a> \u0441 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0435\u0439 TPC-C: 120 \u0441\u0435\u043a\u0443\u043d\u0434 \u0442\u0435\u0441\u0442, 120 \u0440\u0430\u0437\u0433\u043e\u043d, 128 warehouses, 100 \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0439, \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u0430\u044f \u043f\u0440\u043e\u043f\u0443\u0441\u043a\u043d\u0430\u044f \u0441\u043f\u043e\u0441\u043e\u0431\u043d\u043e\u0441\u0442\u044c 50k TPS. \u041c\u043e\u0436\u0435\u0442\u0435 \u043f\u043e\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u0442\u044c \u0437\u0430\u043c\u0435\u0434\u043b\u0438\u0442\u044c \u0441\u0438\u0441\u0442\u0435\u043c\u0443 \u0438 \u0431\u043e\u043b\u044c\u0448\u0435. \u042f \u043a\u043e\u0432\u044b\u0440\u044f\u043b \u0442\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u043e \u043c\u043e\u0435\u043c\u0443 \u043e\u043f\u044b\u0442\u0443 \u0431\u043e\u043b\u044c\u0448\u0435 \u0432\u0441\u0435\u0433\u043e \u0432\u043b\u0438\u044f\u044e\u0442 \u043d\u0430 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u0421\u0423\u0411\u0414, \u0430 \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u0435 \u043d\u0435 \u0442\u0440\u043e\u0433\u0430\u043b.<\/p>\n<p>\u0410 \u0442\u0435\u043f\u0435\u0440\u044c \u044f \u0437\u0430\u0434\u043e\u043b\u0431\u0430\u043b\u0441\u044f \u044d\u0442\u043e \u0432\u0441\u0451 \u043f\u0438\u0441\u0430\u0442\u044c, \u0438 \u0432\u043e\u043e\u0431\u0449\u0435 \u0443 \u043c\u0435\u043d\u044f \u0441\u043f\u0438\u043d\u0430 \u0431\u043e\u043b\u0438\u0442. \u041f\u043e\u0439\u0434\u0443 \u0433\u0443\u043b\u044f\u0442\u044c.<\/p>\n<hr\/>\n<p>\u0410\u0432\u0442\u043e\u0440 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b\u0430: <a href=\"https:\/\/byteofdev.com\/author\/asyncbanana\/\" rel=\"noopener noreferrer nofollow\">\u0414\u0436\u0435\u0439\u043a\u043e\u0431 \u0414\u0436\u0435\u043a\u0441\u043e\u043d<\/a> <br \/> 27 \u0438\u044e\u043b\u044f 2025 \u0433.<\/p>\n<\/div>\n<\/div>\n<\/div>\n<p><!----><!----><\/div>\n<p><!----><!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/articles\/940006\/\"> https:\/\/habr.com\/ru\/articles\/940006\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<figure class=\"\"><\/figure>\n<p>\u041a\u0440\u0443\u0433\u043e\u043c \u0442\u043e\u043b\u044c\u043a\u043e \u0438 \u0440\u0430\u0437\u0433\u043e\u0432\u043e\u0440\u043e\u0432 \u043e \u0442\u043e\u043c, \u043a\u0430\u043a \u0431\u044b \u0437\u0430\u0441\u0442\u0430\u0432\u0438\u0442\u044c Postgres \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0431\u044b\u0441\u0442\u0440\u0435\u0435, \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u0435\u0435, \u0438 \u0442\u0430\u043a \u0434\u0430\u043b\u0435\u0435. \u041d\u043e \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u043d\u0438\u043a\u0442\u043e \u0434\u0430\u0436\u0435 \u043d\u0435 \u0437\u0430\u0434\u0443\u043c\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043e \u0442\u043e\u043c, \u043a\u0430\u043a \u0431\u044b \u0435\u0433\u043e <em>\u0437\u0430\u043c\u0435\u0434\u043b\u0438\u0442\u044c<\/em>. \u0421\u0430\u043c\u043e \u0441\u043e\u0431\u043e\u0439, \u043e \u043f\u0440\u043e\u0434\u0443\u043a\u0442\u0438\u0432\u043d\u043e\u0441\u0442\u0438 \u0438 \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u043e\u0441\u0442\u0438 \u043f\u0430\u0440\u044f\u0442\u0441\u044f \u0432 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u043c \u0442\u0435, \u043a\u043e\u043c\u0443 \u0437\u0430 \u044d\u0442\u043e \u043f\u043b\u0430\u0442\u044f\u0442. \u042f \u043d\u0435 \u0438\u0437 \u0438\u0437 \u0447\u0438\u0441\u043b\u0430 (\u043c\u043e\u0436\u0435\u0442\u0435 \u044d\u0442\u043e \u0438\u0441\u043f\u0440\u0430\u0432\u0438\u0442\u044c &#8212; \u0434\u0430\u0439\u0442\u0435 \u043c\u043d\u0435 \u0437\u043d\u0430\u0442\u044c). \u041d\u0430 \u0434\u043d\u044f\u0445 \u044f \u0440\u0430\u0431\u043e\u0442\u0430\u043b \u043d\u0430\u0434 <a href=\"https:\/\/byteofdev.com\/posts\/tuning-postgres-intro\/\" rel=\"noopener noreferrer nofollow\">\u0447\u0443\u0442\u044c \u0431\u043e\u043b\u0435\u0435 \u043f\u043e\u043b\u0435\u0437\u043d\u044b\u043c \u0440\u0443\u043a\u043e\u0432\u043e\u0434\u0441\u0442\u0432\u043e\u043c (EN)<\/a> \u0438 \u0432 \u043a\u0430\u043a\u043e\u0439-\u0442\u043e \u043c\u043e\u043c\u0435\u043d\u0442 \u0440\u0435\u0448\u0438\u043b, \u0447\u0442\u043e \u044d\u0442\u043e\u043c\u0443 \u043c\u0438\u0440\u0443 \u043d\u0443\u0436\u043d\u0430 \u0442\u0430\u043a\u0430\u044f \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044f Postgres, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e \u043c\u0435\u0434\u043b\u0435\u043d\u043d\u043e. \u041d\u0430\u0445\u0440\u0435\u043d\u0430? \u0427\u0435\u0440\u0442 \u0437\u043d\u0430\u0435\u0442, \u043d\u043e \u0432\u043e\u0442 \u0447\u0442\u043e \u0443 \u043c\u0435\u043d\u044f \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u043e\u0441\u044c.<\/p>\n<h3>\u041f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b<\/h3>\n<p>\u041c\u044b \u043d\u0435 \u0438\u0449\u0435\u043c \u043f\u0440\u043e\u0441\u0442\u044b\u0445 \u043f\u0443\u0442\u0435\u0439, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0437\u0430\u043c\u0435\u0434\u043b\u044f\u0442\u044c \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440 \u0438 \u0432\u0430\u0439\u043f\u0430\u0442\u044c \u0438\u043d\u0434\u0435\u043a\u0441\u044b \u043c\u044b \u043d\u0435 \u0431\u0443\u0434\u0435\u043c. \u042f \u0431\u0443\u0434\u0443 \u0442\u0440\u043e\u0433\u0430\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u0432 <code>postgresql.conf<\/code>. \u041f\u0440\u0438 \u044d\u0442\u043e\u043c \u0411\u0414 \u0434\u043e\u043b\u0436\u043d\u0430 \u0441\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0442\u044c \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u0432 \u0440\u0430\u0437\u0443\u043c\u043d\u043e\u0435 \u0432\u0440\u0435\u043c\u044f &#8212; \u0445\u043e\u0442\u044f \u0431\u044b \u043f\u043e \u043e\u0434\u043d\u043e\u043c\u0443. \u0417\u0430\u0442\u043e\u0440\u043c\u043e\u0437\u0438\u0442\u044c Postgres \u0432 \u043d\u043e\u043b\u044c \u0441\u043b\u0438\u0448\u043a\u043e\u043c \u043f\u0440\u043e\u0441\u0442\u043e. \u0410 \u0432\u043e\u0442 \u0437\u0430\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0435\u0451 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u043c\u0435\u0434\u043b\u0435\u043d\u043d\u043e, \u043d\u043e \u0432\u0441\u0451 \u0436\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c &#8212; \u0437\u0430\u0434\u0430\u0447\u0430 \u043d\u0435\u0442\u0440\u0438\u0432\u0438\u0430\u043b\u044c\u043d\u0430\u044f. Postgres \u0434\u0435\u043b\u0430\u0435\u0442 \u0432\u0441\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0435, \u0447\u0442\u043e\u0431\u044b \u044d\u0442\u043e\u0433\u043e \u043d\u0435 \u0434\u043e\u043f\u0443\u0441\u0442\u0438\u0442\u044c: \u0432\u0432\u043e\u0434\u0438\u0442 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u044f \u043d\u0430 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432, \u043d\u0435 \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0435 \u043a\u043e\u043d\u0444\u0438\u0433\u0440\u0443\u0440\u0430\u0446\u0438\u0438, \u0438 \u0442\u0430\u043a \u0434\u0430\u043b\u0435\u0435.<\/p>\n<p>\u0414\u043b\u044f \u0438\u0437\u043c\u0435\u0440\u0435\u043d\u0438\u044f \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u044f \u0432\u044b\u0431\u0440\u0430\u043b TPC-C \u0432 \u0431\u0435\u043d\u0447\u043c\u0430\u0440\u043a\u0435 Benchbase. \u041f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b:<\/p>\n<ul>\n<li>\n<p>128 warehouses<\/p>\n<\/li>\n<li>\n<p>100 \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0439 \u043a\u0430\u0436\u0434\u044b\u0439<\/p>\n<\/li>\n<li>\n<p>10 000 \u043f\u043e\u043f\u044b\u0442\u043e\u043a \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0442\u0440\u0430\u043d\u0437\u0430\u043a\u0446\u0438\u0439 \u0432 \u0441\u0435\u043a\u0443\u043d\u0434\u0443<\/p>\n<\/li>\n<\/ul>\n<p>\u0421\u043e\u0444\u0442:<\/p>\n<ul>\n<li>\n<p>Postgres 19devel (\u0441\u0431\u043e\u0440\u043a\u0430 \u043e\u0442 7\/14\/2025) \u043d\u0430 Linux 6.15.6<\/p>\n<\/li>\n<\/ul>\n<p>\u0416\u0435\u043b\u0435\u0437\u043e:<\/p>\n<ul>\n<li>\n<p>Ryzen 7950x<\/p>\n<\/li>\n<li>\n<p>32GB RAM<\/p>\n<\/li>\n<li>\n<p>2TB SSD<\/p>\n<\/li>\n<\/ul>\n<p>\u041a\u0430\u0436\u0434\u044b\u0439 \u0442\u0435\u0441\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f 120 \u0441\u0435\u043a\u0443\u043d\u0434, \u0434\u0432\u0430\u0436\u0434\u044b: \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u0434\u043b\u044f \u043f\u0440\u043e\u0433\u0440\u0435\u0432\u0430 \u043a\u044d\u0448\u0430, \u043f\u043e\u0442\u043e\u043c \u043f\u043e-\u0441\u0435\u0440\u044c\u0435\u0437\u043d\u043e\u043c\u0443.<\/p>\n<p>\u0421 \u0447\u0435\u043c \u0441\u0440\u0430\u0432\u043d\u0438\u0432\u0430\u044e: \u0434\u0435\u0444\u043e\u043b\u0442\u043d\u044b\u0439 <code>postgresql.conf<\/code>, \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u043e\u0434\u043d\u044f\u043b <code>shared_buffers<\/code>, <code>work_mem<\/code> \u0438 \u0447\u0438\u0441\u043b\u043e \u0440\u0430\u0431\u043e\u0447\u0438\u0445 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0432. \u041d\u0430 \u0442\u0430\u043a\u043e\u0439 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 \u043f\u043e\u043b\u0443\u0447\u0430\u044e 7082 TPS. \u0410 \u0442\u0435\u043f\u0435\u0440\u044c \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c, \u043a\u0430\u043a \u0441\u0438\u043b\u044c\u043d\u043e \u043c\u044b \u0441\u043c\u043e\u0436\u0435\u043c \u0435\u0433\u043e \u043e\u0442\u0440\u0438\u0446\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u0440\u0430\u0437\u043e\u0433\u043d\u0430\u0442\u044c.<\/p>\n<h3>\u041a\u044d\u0448\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435? \u041a \u0447\u0435\u0440\u0442\u0443!<\/h3>\n<p>Postgres \u043e\u0447\u0435\u043d\u044c \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u043e \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u0442 \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u043d\u0430 \u0447\u0442\u0435\u043d\u0438\u0435 &#8212; \u0432 \u0442\u043e\u043c \u0447\u0438\u0441\u043b\u0435 \u0431\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044f \u0440\u0430\u0437\u0432\u0438\u0442\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u0435 \u043a\u044d\u0448\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f. \u0427\u0438\u0442\u0430\u0442\u044c \u0441 \u0434\u0438\u0441\u043a\u0430 \u0434\u043e\u043b\u0433\u043e, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043a\u043e\u0433\u0434\u0430 Postgres \u0447\u0438\u0442\u0430\u0435\u0442 \u0431\u043b\u043e\u043a \u0434\u0430\u043d\u043d\u044b\u0445 \u0441 \u0434\u0438\u0441\u043a\u0430, \u043e\u043d \u0441\u0440\u0430\u0437\u0443 \u043a\u043b\u0430\u0434\u0435\u0442 \u0435\u0433\u043e \u0432 \u043e\u043f\u0435\u0440\u0430\u0442\u0438\u0432\u043d\u0443\u044e \u043f\u0430\u043c\u044f\u0442\u044c, \u0447\u0442\u043e\u0431\u044b \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u0437\u0430\u043f\u0440\u043e\u0441 \u043a \u044d\u0442\u043e\u043c\u0443 \u0436\u0435 \u0441\u0430\u043c\u043e\u043c\u0443 \u0431\u043b\u043e\u043a\u0443 \u043b\u0438\u0448\u043d\u0438\u0439 \u0440\u0430\u0437 \u043d\u0435 \u043b\u0430\u0437\u0430\u043b \u043d\u0430 \u0434\u0438\u0441\u043a. \u0421\u0430\u043c\u043e \u0441\u043e\u0431\u043e\u0439, \u044f \u044d\u0442\u043e\u0433\u043e \u0442\u0430\u043a \u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u043d\u0435 \u043c\u043e\u0433\u0443. \u0427\u0442\u043e\u0431\u044b \u0431\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u043e \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u0447\u0438\u0442\u0430\u043b\u0438 \u0434\u0430\u043d\u043d\u044b\u0435 \u0441 \u0434\u0438\u0441\u043a\u0430, \u043c\u043d\u0435 \u043d\u0430\u0434\u043e \u0443\u0436\u0430\u0442\u044c \u0440\u0430\u0437\u043c\u0435\u0440 \u043a\u044d\u0448\u0430 \u043a\u0430\u043a \u043c\u043e\u0436\u043d\u043e \u043c\u0435\u043d\u044c\u0448\u0435. \u0417\u0434\u0435\u0441\u044c \u043c\u043d\u0435 \u043d\u0430 \u043f\u043e\u043c\u043e\u0449\u044c \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442 \u0437\u0430\u043c\u0435\u0447\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 <code>shared_buffers<\/code>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043e\u0442\u0432\u0435\u0447\u0430\u0435\u0442 \u0437\u0430 \u0440\u0430\u0437\u043c\u0435\u0440 \u0431\u0443\u0444\u0435\u0440\u0430 \u043a\u044d\u0448\u0430 \u0438 \u043f\u0440\u043e\u0447\u0438\u0435 \u043a\u0443\u0441\u043a\u0438 \u0432\u044b\u0434\u0435\u043b\u044f\u0435\u043c\u043e\u0439 \u043e\u0431\u0449\u0435\u0439 \u043f\u0430\u043c\u044f\u0442\u0438. \u041a \u043c\u043e\u0435\u043c\u0443 \u0432\u0435\u043b\u0438\u043a\u043e\u043c\u0443 \u0441\u043e\u0436\u0430\u043b\u0435\u043d\u0438\u044e, \u043f\u0440\u043e\u0441\u0442\u043e \u0437\u0430\u0434\u0430\u0442\u044c <code>shared_buffers = 0<\/code> \u043d\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u0441\u044f: Postgres \u043a\u043e \u0432\u0441\u0435\u043c\u0443 \u043f\u0440\u043e\u0447\u0435\u043c\u0443 \u0445\u0440\u0430\u043d\u0438\u0442 \u0437\u0434\u0435\u0441\u044c \u0430\u043a\u0442\u0438\u0432\u043d\u044b\u0435 \u0438 \u043d\u0435\u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u043c\u044b\u0435 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b \u0411\u0414. \u041e\u0434\u043d\u0430\u043a\u043e \u044f \u043c\u043e\u0433\u0443 \u0443\u0436\u0430\u0442\u044c \u0435\u0433\u043e \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u0441\u0435\u0440\u044c\u0435\u0437\u043d\u043e.<\/p>\n<p>\u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u044f \u0441\u043a\u0430\u043a\u043d\u0443\u043b \u0441 <code>10\u0413\u0411<\/code> \u0434\u043e <code>8\u041c\u0411<\/code>.<\/p>\n<pre><code>shared_buffers = 8MB <\/code><\/pre>\n<figure class=\"\"><\/figure>\n<p>\u0418 \u0432\u043e\u0442 \u0443\u0436\u0435 Postgres \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0432 \u0441\u0435\u043c\u044c \u0440\u0430\u0437 \u043c\u0435\u0434\u043b\u0435\u043d\u043d\u0435\u0435! \u041c\u0435\u043d\u044c\u0448\u0435 \u0431\u0443\u0444\u0435\u0440 &#8212; \u043c\u0435\u043d\u044c\u0448\u0435 \u0441\u0442\u0440\u0430\u043d\u0438\u0446 \u0445\u0440\u0430\u043d\u0438\u0442\u0441\u044f \u0432 \u043e\u043f\u0435\u0440\u0430\u0442\u0438\u0432\u043a\u0435. \u041f\u0440\u043e\u0446\u0435\u043d\u0442 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432, \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u043c\u044b\u0445 \u0431\u0435\u0437 \u043e\u0431\u0440\u0430\u0449\u0435\u043d\u0438\u044f \u043a \u041e\u0421, \u0440\u0443\u0445\u043d\u0443\u043b \u0441 99.90% \u0434\u043e 70.52%, \u0430 \u0447\u0438\u0441\u043b\u043e \u0446\u0438\u043a\u043b\u043e\u0432 \u0447\u0442\u0435\u043d\u0438\u044f \u0441 \u0434\u0438\u0441\u043a\u0430 \u0432\u044b\u0440\u043e\u0441\u043b\u043e \u0432 300 \u0440\u0430\u0437.<\/p>\n<p>\u041d\u043e \u044d\u0442\u043e \u0442\u043e\u043b\u044c\u043a\u043e \u043d\u0430\u0447\u0430\u043b\u043e. 70% &#8212; \u044d\u0442\u043e \u0432\u0441\u0435 \u0435\u0449\u0435 \u0441\u043b\u0438\u0448\u043a\u043e\u043c \u043c\u043d\u043e\u0433\u043e \u043a\u044d\u0448\u0430. \u0412\u0442\u043e\u0440\u0430\u044f \u043f\u043e\u043f\u044b\u0442\u043a\u0430: 128\u043a\u0411.<\/p>\n<figure class=\"\"><\/figure>\n<p>\u041c-\u0434\u0430. 128\u043a\u0411 \u043a\u044d\u0448\u0430 \u0432\u043c\u0435\u0449\u0430\u044e\u0442 \u043c\u0430\u043a\u0441\u0438\u043c\u0443\u043c 16 \u0441\u0442\u0440\u0430\u043d\u0438\u0446 \u0414\u0411 (\u044d\u0442\u043e \u0431\u0435\u0437 \u0443\u0447\u0435\u0442\u0430 \u0432\u0441\u0435\u0433\u043e \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u043e\u0433\u043e, \u0447\u0442\u043e Postgres \u0445\u043e\u0447\u0435\u0442 \u0442\u0430\u043c \u0445\u0440\u0430\u043d\u0438\u0442\u044c). \u0410 \u043d\u0430\u0448\u0430 \u0421\u0423\u0411\u0414 \u0431\u0443\u0434\u0442\u043e \u0431\u044b \u0445\u043e\u0447\u0435\u0442 \u0432\u0438\u0434\u0435\u0442\u044c \u0431\u043e\u043b\u044c\u0448\u0435 \u0447\u0435\u043c 16 \u0441\u0442\u0440\u0430\u043d\u0438\u0446 \u043e\u0434\u043d\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e. \u042f \u043f\u043e\u043a\u043e\u0432\u044b\u0440\u044f\u043b\u0441\u044f \u0435\u0449\u0435 \u0438 \u0432 \u0438\u0442\u043e\u0433\u0435 \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043b\u0441\u044f \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u043d\u0430 2\u041c\u0411 &#8212; \u043d\u0438\u0436\u0435 \u0443\u0436\u0435 \u043d\u0438\u043a\u0430\u043a. \u041f\u0440\u044f\u043c\u043e \u0441\u0435\u0439\u0447\u0430\u0441 \u0443 \u043c\u0435\u043d\u044f Postgres \u0432\u044b\u0442\u044f\u0433\u0438\u0432\u0430\u0435\u0442 500 TPS.<\/p>\n<pre><code>shared_buffers = 2MB <\/code><\/pre>\n<figure class=\"\"><\/figure>\n<h3>\u0417\u0430\u0433\u0440\u0443\u0436\u0430\u0435\u043c Postgres \u0431\u0435\u0437\u0443\u043c\u043d\u044b\u043c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e\u043c \u0444\u043e\u043d\u043e\u0432\u044b\u0445 \u0437\u0430\u0434\u0430\u0447<\/h3>\n<p>\u041a\u0440\u043e\u043c\u0435 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0442\u0440\u0430\u043d\u0437\u0430\u043a\u0446\u0438\u0439, Postgres \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442 \u0435\u0449\u0435 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0432\u044b\u0447\u0438\u0441\u043b\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0434\u043e\u0440\u043e\u0433\u0438\u0445 \u0437\u0430\u0434\u0430\u0447. \u0417\u0430\u0434\u0430\u0447, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0432 \u043c\u043e\u0438\u0445 \u0446\u0435\u043b\u044f\u0445. \u041f\u0440\u043e\u0446\u0435\u0441\u0441 \u0430\u0432\u0442\u043e\u043e\u0447\u0438\u0441\u0442\u043a\u0438 &#8212; autovacuum &#8212; \u0438\u0449\u0435\u0442 \u043f\u0443\u0441\u0442\u044b\u0435 \u043c\u0435\u0441\u0442\u0430 \u0432 \u043f\u0430\u043c\u044f\u0442\u0438, \u043e\u0441\u0442\u0430\u0432\u0448\u0438\u0435\u0441\u044f \u043f\u043e\u0441\u043b\u0435 \u0443\u0434\u0430\u043b\u0435\u043d\u0438\u044f \u0438 \u0434\u0440\u0443\u0433\u0438\u0445 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0439, \u0438 \u043d\u0430\u043f\u043e\u043b\u043d\u044f\u0435\u0442 \u0438\u0445 \u0430\u043a\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u043c\u0438 \u0432\u0435\u0440\u0441\u0438\u044f\u043c\u0438 \u0441\u0442\u0440\u043e\u043a. \u041e\u0431\u044b\u0447\u043d\u043e \u044d\u0442\u043e\u0442 \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442\u0441\u044f \u0441\u043f\u0443\u0441\u0442\u044f \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0432\u0440\u0435\u043c\u044f, \u043a\u043e\u0433\u0434\u0430 \u0432 \u0442\u0430\u0431\u043b\u0438\u0446\u0435 \u043f\u0440\u043e\u0438\u0437\u043e\u0448\u043b\u043e \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0439 &#8212; \u0447\u0442\u043e\u0431\u044b \u043d\u0435 \u0442\u0440\u0430\u0442\u0438\u0442\u044c \u0440\u0435\u0441\u0443\u0440\u0441\u044b \u043d\u0430 \u0447\u0442\u0435\u043d\u0438\u0435 \u0438 \u0437\u0430\u043f\u0438\u0441\u044c \u043f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u043e. \u042f \u043c\u043e\u0433\u0443 \u044d\u0442\u043e \u0432\u0440\u0435\u043c\u044f \u043c\u0435\u0436\u0434\u0443 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u043c\u0438 \u0441\u043e\u043a\u0440\u0430\u0442\u0438\u0442\u044c.<\/p>\n<pre><code>autovacuum_vacuum_insert_threshold = 1 # autovacuum \u0441\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u0442 \u043d\u0430 \u043a\u0430\u0436\u0434\u044b\u0439 insert autovacuum_vacuum_threshold = 0 # \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e insert, update \u0438\u043b\u0438 deletes \u0434\u043b\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430 autovacuum autovacuum_vacuum_scale_factor = 0 # \u0434\u043e\u043b\u044f \u043d\u0435\u0437\u0430\u043c\u043e\u0440\u043e\u0436\u0435\u043d\u043d\u043e\u0439 \u0447\u0430\u0441\u0442\u0438 \u0442\u0430\u0431\u043b\u0438\u0446\u044b, \u043d\u0430\u0434\u043e \u0434\u043b\u044f \u0440\u0430\u0441\u0447\u0435\u0442\u0430 \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u044f autovacuum autovacuum_vacuum_max_threshold = 1 # \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e insert, update \u0438\u043b\u0438 deletes \u0434\u043b\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430 autovacuum autovacuum_naptime = 1 # \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u0430\u044f \u0437\u0430\u0434\u0435\u0440\u0436\u043a\u0430 \u043c\u0435\u0436\u0443 \u0437\u0430\u043f\u0443\u0441\u043a\u043e\u043c autovacuum, \u0441\u0435\u043a; \u043a \u0441\u043e\u0436\u0430\u043b\u0435\u043d\u0438\u044e, \u043d\u0438\u0436\u0435 1 \u0441\u0435\u043a \u043d\u0435 \u0441\u0442\u0430\u0432\u0438\u0442\u0441\u044f vacuum_cost_limit = 10000 # \u043b\u0438\u043c\u0438\u0442 \u0441\u0442\u043e\u0438\u043c\u043e\u0441\u0442\u0438 \u0437\u0430\u043f\u0440\u043e\u0441\u0430, \u043f\u0440\u0438 \u043f\u0440\u0438\u0432\u044b\u0448\u0435\u043d\u0438\u0438 \u043e\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u0442 \u043e\u0447\u0438\u0441\u0442\u043a\u0443; \u044f \u043d\u0435 \u0445\u043e\u0447\u0443 \u043e\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0442\u044c \u043e\u0447\u0438\u0441\u0442\u043a\u0443, \u0442\u0430\u043a \u0447\u0442\u043e \u0441\u0442\u0430\u0432\u043b\u044e \u043c\u0430\u043a\u0441\u0438\u043c\u0443\u043c vacuum_cost_page_dirty = 0 vacuum_cost_page_hit = 0 vacuum_cost_page_miss = 0 # \u044d\u0442\u0438 \u0442\u0440\u0438 \u0448\u0442\u0443\u043a\u0438 \u0441\u043d\u0438\u0436\u0430\u044e\u0442 \u0441\u0442\u043e\u0438\u043c\u043e\u0441\u0442\u044c \u043f\u0440\u0438 \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0438 `vacuum_cost_limit` <\/code><\/pre>\n<p>\u0423 \u0430\u0432\u0442\u043e\u043e\u0447\u0438\u0441\u0442\u043a\u0438 \u0435\u0441\u0442\u044c \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440 &#8212; \u043e\u043d \u0441\u043e\u0431\u0438\u0440\u0430\u0435\u0442 \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0443, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043f\u043e\u0442\u043e\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0434\u043b\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u0430\u0432\u0442\u043e\u043e\u0447\u0438\u0441\u0442\u043a\u0438, \u0430 \u0435\u0449\u0435 \u0432 \u043f\u043b\u0430\u043d\u0438\u0440\u043e\u0432\u0449\u0438\u043a\u0435 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432. \u0415\u0433\u043e \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u044f \u0442\u043e\u0436\u0435 \u043c\u043e\u0433\u0443 \u043f\u043e\u0434\u043f\u043e\u0440\u0442\u0438\u0442\u044c. (\u0410 \u043f\u0440\u043e \u043f\u043b\u0430\u043d\u0438\u0440\u043e\u0432\u0449\u0438\u043a \u043f\u043e\u0433\u043e\u0432\u043e\u0440\u0438\u043c \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e &#8212; \u0435\u043c\u0443 \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u0430\u044f \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0430 \u043e\u0442 \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u0430 \u0443\u0436\u0435 \u043d\u0435 \u043f\u043e\u043c\u043e\u0436\u0435\u0442.)<\/p>\n<pre><code>autovacuum_analyze_threshold = 0 # \u0442\u043e \u0436\u0435, \u0447\u0442\u043e \u0438 autovacuum_vacuum_threshold, \u043d\u043e \u0434\u043b\u044f ANALYZE autovacuum_analyze_scale_factor = 0 # \u0442\u043e \u0436\u0435, \u0447\u0442\u043e \u0438 autovacuum_vacuum_scale_factor <\/code><\/pre>\n<p>\u041d\u0443 \u0438 \u043f\u043e\u043f\u044b\u0442\u0430\u0435\u043c\u0441\u044f \u0437\u0430\u043c\u0435\u0434\u043b\u0438\u0442\u044c \u0441\u0430\u043c \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u0430\u0432\u0442\u043e\u043e\u0447\u0438\u0441\u0442\u043a\u0438:<\/p>\n<pre><code>maintenance_work_mem = 128kB # \u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043f\u0430\u043c\u044f\u0442\u0438 \u0432\u044b\u0434\u0435\u043b\u044f\u0435\u0442\u0441\u044f \u043d\u0430 \u043e\u0447\u0438\u0441\u0442\u043a\u0443 log_autovacuum_min_duration = 0 # \u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0434\u043e\u043b\u0436\u043d\u0430 \u0434\u043b\u0438\u0442\u044c\u0441\u044f \u043e\u0447\u0438\u0441\u0442\u043a\u0430 (\u043c\u0441), \u0447\u0442\u043e\u0431\u044b \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u043f\u0440\u043e \u043d\u0435\u0435 \u0432 \u0436\u0443\u0440\u043d\u0430\u043b; \u044f \u0445\u043e\u0447\u0443 \u043f\u0438\u0441\u0430\u0442\u044c \u0432\u0441\u0451 logging_collector = on # \u0432\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u0436\u0443\u0440\u043d\u0430\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0432 \u043f\u0440\u0438\u043d\u0446\u0438\u043f\u0435 log_destination = stderr,jsonlog # \u0444\u043e\u0440\u043c\u0430\u0442 \u0437\u0430\u043f\u0438\u0441\u0438 \u0444\u0430\u0439\u043b\u043e\u0432 \u0436\u0443\u0440\u043d\u0430\u043b\u0430 <\/code><\/pre>\n<p>\u0422\u0443\u0442 \u0441\u0442\u043e\u0438\u0442 \u0437\u0430\u043c\u0435\u0442\u0438\u0442\u044c, \u0447\u0442\u043e \u043f\u0440\u043e\u0442\u0438\u0432\u043e\u043f\u043e\u043b\u043e\u0436\u043d\u044b\u0439 \u043f\u043e\u0434\u0445\u043e\u0434 \u0442\u043e\u0436\u0435 \u0438\u043c\u0435\u0435\u0442 \u043f\u0440\u0430\u0432\u043e \u043d\u0430 \u0436\u0438\u0437\u043d\u044c: \u0435\u0441\u043b\u0438 \u043e\u0442\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u0430\u0432\u0442\u043e\u043e\u0447\u0438\u0441\u0442\u043a\u0443 <em>\u0432\u043e\u043e\u0431\u0449\u0435<\/em>, \u0442\u043e \u043f\u0430\u043c\u044f\u0442\u044c \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u0441\u0442\u0435\u043f\u0435\u043d\u043d\u043e \u0437\u0430\u0431\u0438\u0432\u0430\u0442\u044c\u0441\u044f \u0441\u0442\u0430\u0440\u044b\u043c\u0438 \u0432\u0435\u0440\u0441\u0438\u044f\u043c\u0438 \u0441\u0442\u0440\u043e\u043a, \u0441\u0432\u043e\u0434\u044f \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u0421\u0423\u0411\u0414 \u043d\u0430 \u043d\u0435\u0442. \u041e\u0434\u043d\u0430\u043a\u043e \u0432 \u043c\u043e\u0435\u043c \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u0435 \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u0430 &#8212; \u0432 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u043c \u043d\u0430 \u0437\u0430\u043f\u0438\u0441\u044c, \u0434\u0430 \u0438 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0434\u0432\u0435 \u043c\u0438\u043d\u0443\u0442\u044b, \u0442\u0430\u043a \u0447\u0442\u043e \u044d\u0442\u043e\u0442 \u0432\u0430\u0440\u0438\u0430\u043d\u0442 \u044f \u0441\u0435\u0440\u044c\u0435\u0437\u043d\u043e \u043d\u0435 \u0440\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u043b.<\/p>\n<figure class=\"\"><\/figure>\n<p>\u0421\u0435\u0439\u0447\u0430\u0441 \u043c\u043e\u0439 Postgres \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0432 20 \u0440\u0430\u0437 \u043c\u0435\u0434\u043b\u0435\u043d\u043d\u0435\u0435 \u043e\u0431\u044b\u0447\u043d\u043e\u0433\u043e. \u041f\u043e\u0447\u0435\u043c\u0443 &#8212; \u0432\u0438\u0434\u043d\u043e \u0432 \u043b\u043e\u0433\u0430\u0445:<\/p>\n<pre><code>2025-07-20 09:10:20.455 EDT [25210] LOG:  automatic vacuum of table \"benchbase.public.warehouse\": index scans: 0  pages: 0 removed, 222 remain, 222 scanned (100.00% of total), 0 eagerly scanned  tuples: 0 removed, 354 remain, 226 are dead but not yet removable  removable cutoff: 41662928, which was 523 XIDs old when operation ended  frozen: 0 pages from table (0.00% of total) had 0 tuples frozen  visibility map: 0 pages set all-visible, 0 pages set all-frozen (0 were all-visible)  index scan not needed: 0 pages from table (0.00% of total) had 0 dead item identifiers removed  avg read rate: 116.252 MB\/s, avg write rate: 4.824 MB\/s  buffer usage: 254 hits, 241 reads, 10 dirtied  WAL usage: 2 records, 2 full page images, 16336 bytes, 1 buffers full  system usage: CPU: user: 0.00 s, system: 0.00 s, elapsed: 0.01 s 2025-07-20 09:10:20.773 EDT [25210] LOG:  automatic analyze of table \"benchbase.public.warehouse\"  avg read rate: 8.332 MB\/s, avg write rate: 0.717 MB\/s  buffer usage: 311 hits, 337 reads, 29 dirtied  WAL usage: 36 records, 5 full page images, 42524 bytes, 4 buffers full  system usage: CPU: user: 0.00 s, system: 0.00 s, elapsed: 0.31 s 2025-07-20 09:10:20.933 EDT [25210] LOG:  automatic vacuum of table \"benchbase.public.district\": index scans: 0  pages: 0 removed, 1677 remain, 1008 scanned (60.11% of total), 0 eagerly scanned  tuples: 4 removed, 2047 remain, 557 are dead but not yet removable  removable cutoff: 41662928, which was 686 XIDs old when operation ended  frozen: 0 pages from table (0.00% of total) had 0 tuples frozen  visibility map: 0 pages set all-visible, 0 pages set all-frozen (0 were all-visible)  index scan bypassed: 2 pages from table (0.12% of total) have 9 dead item identifiers  avg read rate: 50.934 MB\/s, avg write rate: 9.945 MB\/s  buffer usage: 1048 hits, 1009 reads, 197 dirtied  WAL usage: 6 records, 1 full page images, 8707 bytes, 0 buffers full  system usage: CPU: user: 0.00 s, system: 0.00 s, elapsed: 0.15 s 2025-07-20 09:10:21.220 EDT [25210] LOG:  automatic analyze of table \"benchbase.public.district\"  avg read rate: 47.235 MB\/s, avg write rate: 1.330 MB\/s  buffer usage: 115 hits, 1705 reads, 48 dirtied  WAL usage: 30 records, 1 full page images, 17003 bytes, 1 buffers full  system usage: CPU: user: 0.00 s, system: 0.00 s, elapsed: 0.28 s 2025-07-20 09:10:21.543 EDT [25212] LOG:  automatic vacuum of table \"benchbase.public.warehouse\": index scans: 0  pages: 0 removed, 222 remain, 222 scanned (100.00% of total), 0 eagerly scanned  tuples: 0 removed, 503 remain, 375 are dead but not yet removable  removable cutoff: 41662928, which was 845 XIDs old when operation ended  frozen: 0 pages from table (0.00% of total) had 0 tuples frozen  visibility map: 0 pages set all-visible, 0 pages set all-frozen (0 were all-visible)  index scan not needed: 0 pages from table (0.00% of total) had 0 dead item identifiers removed  avg read rate: 131.037 MB\/s, avg write rate: 5.083 MB\/s  buffer usage: 268 hits, 232 reads, 9 dirtied  WAL usage: 1 records, 0 full page images, 258 bytes, 0 buffers full  system usage: CPU: user: 0.00 s, system: 0.00 s, elapsed: 0.01 s 2025-07-20 09:10:21.813 EDT [25212] LOG:  automatic analyze of table \"benchbase.public.warehouse\"  avg read rate: 10.244 MB\/s, avg write rate: 0.851 MB\/s  buffer usage: 307 hits, 337 reads, 28 dirtied  WAL usage: 33 records, 3 full page images, 30864 bytes, 2 buffers full  system usage: CPU: user: 0.00 s, system: 0.00 s, elapsed: 0.25 s ... \u0418 \u0442\u0430\u043a \u0434\u0430\u043b\u0435\u0435 <\/code><\/pre>\n<p>Postgres \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442 \u0430\u0432\u0442\u043e\u043e\u0447\u0438\u0441\u0442\u043a\u0443 \u0438 \u0430\u043d\u0430\u043b\u0438\u0437 \u043d\u0430 \u0433\u043e\u0440\u044f\u0447\u0438\u0445 \u0442\u0430\u0431\u043b\u0438\u0446\u0430\u0445 \u0440\u0430\u0437 \u0432 \u0441\u0435\u043a\u0443\u043d\u0434\u0443. \u042f \u0443\u0440\u0435\u0437\u0430\u043b \u043a\u044d\u0448, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0441\u0442\u0440\u0430\u043d\u0438\u0446 \u0432 \u043e\u043f\u0435\u0440\u0430\u0442\u0438\u0432\u043a\u0435 \u043e\u0447\u0435\u043d\u044c \u043c\u0430\u043b\u043e, \u0438 \u0441\u0438\u0441\u0442\u0435\u043c\u0435 \u043f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u043e \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0447\u0438\u0442\u0430\u0442\u044c \u0434\u0438\u0441\u043a. \u0421\u0430\u043c\u043e\u0435 \u043f\u0440\u0438\u043a\u043e\u043b\u044c\u043d\u043e\u0435 &#8212; \u0432\u0441\u0435 \u044d\u0442\u0438 \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u043d\u0430 \u0447\u0442\u0435\u043d\u0438\u0435 \u0441\u043e\u0432\u0435\u0440\u0448\u0435\u043d\u043d\u043e \u0431\u0435\u0441\u043f\u043e\u043b\u0435\u0437\u043d\u044b, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u0434\u0430\u043d\u043d\u044b\u0435 \u043c\u0435\u0436\u0434\u0443 \u043f\u0440\u043e\u0433\u043e\u043d\u0430\u043c\u0438 \u043d\u0435 \u043c\u0435\u043d\u044f\u044e\u0442\u0441\u044f! \u041e\u0434\u043d\u0430\u043a\u043e 293 TPS &#8212; \u044d\u0442\u043e \u0432\u0441\u0451 \u0435\u0449\u0435 \u0441\u043b\u0438\u0448\u043a\u043e\u043c \u043c\u043d\u043e\u0433\u043e.<\/p>\n<h3>\u041f\u0440\u0435\u0432\u0440\u0430\u0449\u0430\u0435\u043c Postgres \u0432 \u0414\u0430\u0440\u044c\u044e \u0414\u043e\u043d\u0446\u043e\u0432\u0443<\/h3>\n<p><a href=\"https:\/\/ru.wikipedia.org\/wiki\/%D0%94%D0%BE%D0%BD%D1%86%D0%BE%D0%B2%D0%B0,_%D0%94%D0%B0%D1%80%D1%8C%D1%8F#%D0%A2%D0%B8%D1%80%D0%B0%D0%B6%D0%B8_%D0%B8_%D1%87%D0%B8%D1%81%D0%BB%D0%BE_%D0%B8%D0%B7%D0%B4%D0%B0%D0%BD%D0%BD%D1%8B%D1%85_%D0%BA%D0%BD%D0%B8%D0%B3\" rel=\"noopener noreferrer nofollow\">\u0414\u0430\u0440\u044c\u044f \u0414\u043e\u043d\u0446\u043e\u0432\u0430 \u043f\u0438\u0448\u0435\u0442 \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u043c\u043d\u043e\u0433\u043e<\/a>. \u0417\u043d\u0430\u0435\u0442\u0435, \u043a\u0442\u043e \u0435\u0449\u0435 \u043c\u043d\u043e\u0433\u043e \u043f\u0438\u0448\u0435\u0442? Postgres \u043f\u043e\u0441\u043b\u0435 \u043c\u043e\u0438\u0445 \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u043e\u0432 \u0441 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0435\u0439 WAL. \u041f\u0440\u0435\u0436\u0434\u0435 \u0447\u0435\u043c \u0432\u043d\u0435\u0441\u0442\u0438 \u0434\u0430\u043d\u043d\u044b\u0435 \u0432 \u0444\u0430\u0439\u043b\u044b \u0411\u0414, Postgres \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442 \u0438\u0437 \u0432 \u0436\u0443\u0440\u043d\u0430\u043b \u043f\u0440\u0435\u0434\u0432\u0430\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0439<\/p>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-471902","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/471902","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=471902"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/471902\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=471902"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=471902"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=471902"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}