{"id":7564,"date":"2023-06-26T17:04:31","date_gmt":"2023-06-26T08:04:31","guid":{"rendered":"https:\/\/www.lancard.com\/blog\/?p=7564"},"modified":"2025-03-12T11:22:15","modified_gmt":"2025-03-12T02:22:15","slug":"postgresql-max_connections-and-rolconnlimit","status":"publish","type":"post","link":"https:\/\/www.lancard.com\/blog\/2023\/06\/26\/postgresql-max_connections-and-rolconnlimit\/","title":{"rendered":"PostgreSQL\u306emax_connections\u3068\u30e6\u30fc\u30b6\u3054\u3068\u306e\u5236\u9650"},"content":{"rendered":"\n\n<div class=\"wp-block-columns is-layout-flex wp-container-core-columns-is-layout-9d6595d7 wp-block-columns-is-layout-flex\">\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\" style=\"flex-basis:100%\">\nPostgreSQL\u3067\u306fmax_connections\u3067\u5168\u4f53\u306e\u63a5\u7d9a\u6570\u3092\u5236\u9650\u51fa\u6765\u307e\u3059\u304c\u3001\u30e6\u30fc\u30b6\u3054\u3068\u306b\u3082\u5236\u9650\u3092\u3059\u308b\u4e8b\u304c\u51fa\u6765\u307e\u3059\u3002\n<\/div>\n<\/div>\n\n\n\n\n\n<pre class=\"wp-block-code\"><code>ALTER ROLE dbuser CONNECTION LIMIT 10;\n-- \u78ba\u8a8d\nSELECT rolconnlimit FROM pg_roles WHERE rolname = 'dbuser';<\/code><\/pre>\n\n\n\n\n\n<div class=\"wp-block-columns is-layout-flex wp-container-core-columns-is-layout-9d6595d7 wp-block-columns-is-layout-flex\">\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\" style=\"flex-basis:100%\">\n\u3053\u308c\u3067dbuser\u306f10\u4ee5\u4e0a\u63a5\u7d9a\u3059\u308b\u4e8b\u304c\u51fa\u6765\u306a\u304f\u306a\u308a\u307e\u3059\u3002<br>\u5236\u9650\u3092\u306a\u304f\u3059\u5834\u5408\u306f\u3001CONNECTION LIMIT \u3092 \u30c7\u30d5\u30a9\u30eb\u30c8\u306e -1 \u306b\u623b\u3057\u307e\u3059\u3002\n<\/div>\n<\/div>\n\n\n\n\n\n<div class=\"wp-block-columns is-layout-flex wp-container-core-columns-is-layout-9d6595d7 wp-block-columns-is-layout-flex\">\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\" style=\"flex-basis:100%\">\n\u3067\u306frolconnlimit > max_connections\u3060\u3063\u305f\u5834\u5408\u306f\u3069\u3046\u306a\u308b\u304b\u3068\u8a00\u3046\u3068\u3001max_connections\u304c\u512a\u5148\u3055\u308c\u307e\u3059\uff08\u8a2d\u5b9a\u81ea\u4f53\u306f\u51fa\u6765\u3066\u3057\u307e\u3044\u307e\u3059\u304c\uff09\u3002<br>\u306a\u306e\u3067\u5b9f\u969b\u306f\u3001\u6b63\u306erolconnlimit\u306e\u5408\u8a08 &lt;= max_connections &#8211; superuser_reserved_connections \u3067\u8a2d\u5b9a\u3059\u308b\u5fc5\u8981\u304c\u6709\u308a\u305d\u3046\u3067\u3059\u3002<br>\n<\/div>\n<\/div>\n\n<a class=\"synved-social-button synved-social-button-share synved-social-size-24 synved-social-resolution-single synved-social-provider-facebook nolightbox\" data-provider=\"facebook\" target=\"_blank\" rel=\"nofollow\" title=\"Share on Facebook\" href=\"https:\/\/www.facebook.com\/sharer.php?u=https%3A%2F%2Fwww.lancard.com%2Fblog%2Fwp-json%2Fwp%2Fv2%2Fposts%2F7564&#038;t=PostgreSQL%E3%81%AEmax_connections%E3%81%A8%E3%83%A6%E3%83%BC%E3%82%B6%E3%81%94%E3%81%A8%E3%81%AE%E5%88%B6%E9%99%90&#038;s=100&#038;p&#091;url&#093;=https%3A%2F%2Fwww.lancard.com%2Fblog%2Fwp-json%2Fwp%2Fv2%2Fposts%2F7564&#038;p&#091;images&#093;&#091;0&#093;=&#038;p&#091;title&#093;=PostgreSQL%E3%81%AEmax_connections%E3%81%A8%E3%83%A6%E3%83%BC%E3%82%B6%E3%81%94%E3%81%A8%E3%81%AE%E5%88%B6%E9%99%90\" style=\"font-size: 0px;width:24px;height:24px;margin:0;margin-bottom:5px;margin-right:5px\"><img loading=\"lazy\" decoding=\"async\" alt=\"Facebook\" title=\"Share on Facebook\" class=\"synved-share-image synved-social-image synved-social-image-share\" width=\"24\" height=\"24\" style=\"display: inline;width:24px;height:24px;margin: 0;padding: 0;border: none;box-shadow: none\" src=\"https:\/\/www.lancard.com\/blog\/wp-content\/plugins\/social-media-feather\/synved-social\/image\/social\/regular\/48x48\/facebook.png\" \/><\/a><a class=\"synved-social-button synved-social-button-share synved-social-size-24 synved-social-resolution-single synved-social-provider-twitter nolightbox\" data-provider=\"twitter\" target=\"_blank\" rel=\"nofollow\" title=\"Share on Twitter\" href=\"http:\/\/twitter.com\/share?url=https%3A%2F%2Fwww.lancard.com%2Fblog%2Fwp-json%2Fwp%2Fv2%2Fposts%2F7564&#038;text=PostgreSQL%E3%81%AEmax_connections%E3%81%A8%E3%83%A6%E3%83%BC%E3%82%B6%E3%81%94%E3%81%A8%E3%81%AE%E5%88%B6%E9%99%90\" style=\"font-size: 0px;width:24px;height:24px;margin:0;margin-bottom:5px;margin-right:5px\"><img loading=\"lazy\" decoding=\"async\" alt=\"twitter\" title=\"Share on Twitter\" class=\"synved-share-image synved-social-image synved-social-image-share\" width=\"24\" height=\"24\" style=\"display: inline;width:24px;height:24px;margin: 0;padding: 0;border: none;box-shadow: none\" src=\"https:\/\/www.lancard.com\/blog\/wp-content\/plugins\/social-media-feather\/synved-social\/image\/social\/regular\/48x48\/twitter.png\" \/><\/a><a class=\"synved-social-button synved-social-button-share synved-social-size-24 synved-social-resolution-single synved-social-provider-linkedin nolightbox\" data-provider=\"linkedin\" target=\"_blank\" rel=\"nofollow\" title=\"Share on Linkedin\" href=\"https:\/\/www.linkedin.com\/shareArticle?mini=true&#038;url=https%3A%2F%2Fwww.lancard.com%2Fblog%2Fwp-json%2Fwp%2Fv2%2Fposts%2F7564&#038;title=PostgreSQL%E3%81%AEmax_connections%E3%81%A8%E3%83%A6%E3%83%BC%E3%82%B6%E3%81%94%E3%81%A8%E3%81%AE%E5%88%B6%E9%99%90\" style=\"font-size: 0px;width:24px;height:24px;margin:0;margin-bottom:5px;margin-right:5px\"><img loading=\"lazy\" decoding=\"async\" alt=\"linkedin\" title=\"Share on Linkedin\" class=\"synved-share-image synved-social-image synved-social-image-share\" width=\"24\" height=\"24\" style=\"display: inline;width:24px;height:24px;margin: 0;padding: 0;border: none;box-shadow: none\" src=\"https:\/\/www.lancard.com\/blog\/wp-content\/plugins\/social-media-feather\/synved-social\/image\/social\/regular\/48x48\/linkedin.png\" \/><\/a><a class=\"synved-social-button synved-social-button-share synved-social-size-24 synved-social-resolution-single synved-social-provider-tumblr nolightbox\" data-provider=\"tumblr\" target=\"_blank\" rel=\"nofollow\" title=\"Share on tumblr\" href=\"https:\/\/tumblr.com\/share?s=&#038;v=3&#038;t=PostgreSQL%E3%81%AEmax_connections%E3%81%A8%E3%83%A6%E3%83%BC%E3%82%B6%E3%81%94%E3%81%A8%E3%81%AE%E5%88%B6%E9%99%90&#038;u=https%3A%2F%2Fwww.lancard.com%2Fblog%2Fwp-json%2Fwp%2Fv2%2Fposts%2F7564\" style=\"font-size: 0px;width:24px;height:24px;margin:0;margin-bottom:5px;margin-right:5px\"><img loading=\"lazy\" decoding=\"async\" alt=\"tumblr\" title=\"Share on tumblr\" class=\"synved-share-image synved-social-image synved-social-image-share\" width=\"24\" height=\"24\" style=\"display: inline;width:24px;height:24px;margin: 0;padding: 0;border: none;box-shadow: none\" src=\"https:\/\/www.lancard.com\/blog\/wp-content\/plugins\/social-media-feather\/synved-social\/image\/social\/regular\/48x48\/tumblr.png\" \/><\/a><a class=\"synved-social-button synved-social-button-share synved-social-size-24 synved-social-resolution-single synved-social-provider-mail nolightbox\" data-provider=\"mail\" rel=\"nofollow\" title=\"Share by email\" href=\"mailto:?subject=PostgreSQL%E3%81%AEmax_connections%E3%81%A8%E3%83%A6%E3%83%BC%E3%82%B6%E3%81%94%E3%81%A8%E3%81%AE%E5%88%B6%E9%99%90&#038;body=%E3%82%B7%E3%82%A7%E3%82%A2%E3%81%99%E3%82%8B%EF%BC%9A:%20https%3A%2F%2Fwww.lancard.com%2Fblog%2Fwp-json%2Fwp%2Fv2%2Fposts%2F7564\" style=\"font-size: 0px;width:24px;height:24px;margin:0;margin-bottom:5px\"><img loading=\"lazy\" decoding=\"async\" alt=\"mail\" title=\"Share by email\" class=\"synved-share-image synved-social-image synved-social-image-share\" width=\"24\" height=\"24\" style=\"display: inline;width:24px;height:24px;margin: 0;padding: 0;border: none;box-shadow: none\" src=\"https:\/\/www.lancard.com\/blog\/wp-content\/plugins\/social-media-feather\/synved-social\/image\/social\/regular\/48x48\/mail.png\" \/><\/a>","protected":false},"excerpt":{"rendered":"<p>PostgreSQL\u3067\u306fmax_connections\u3067\u5168\u4f53\u306e\u63a5\u7d9a\u6570\u3092\u5236\u9650\u51fa\u6765\u307e\u3059\u304c\u3001\u30e6\u30fc\u30b6\u3054\u3068\u306b\u3082\u5236\u9650\u3092\u3059\u308b\u4e8b\u304c\u51fa\u6765\u307e\u3059\u3002 \u3053\u308c\u3067dbuser\u306f10\u4ee5\u4e0a\u63a5\u7d9a\u3059\u308b\u4e8b\u304c\u51fa\u6765\u306a\u304f\u306a\u308a\u307e\u3059\u3002\u5236\u9650\u3092\u306a\u304f\u3059\u5834\u5408\u306f\u3001CONNECTI [&hellip;]<\/p>\n","protected":false},"author":17,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-7564","post","type-post","status-publish","format-standard","hentry","category-1"],"_links":{"self":[{"href":"https:\/\/www.lancard.com\/blog\/wp-json\/wp\/v2\/posts\/7564","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.lancard.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.lancard.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.lancard.com\/blog\/wp-json\/wp\/v2\/users\/17"}],"replies":[{"embeddable":true,"href":"https:\/\/www.lancard.com\/blog\/wp-json\/wp\/v2\/comments?post=7564"}],"version-history":[{"count":26,"href":"https:\/\/www.lancard.com\/blog\/wp-json\/wp\/v2\/posts\/7564\/revisions"}],"predecessor-version":[{"id":7590,"href":"https:\/\/www.lancard.com\/blog\/wp-json\/wp\/v2\/posts\/7564\/revisions\/7590"}],"wp:attachment":[{"href":"https:\/\/www.lancard.com\/blog\/wp-json\/wp\/v2\/media?parent=7564"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.lancard.com\/blog\/wp-json\/wp\/v2\/categories?post=7564"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.lancard.com\/blog\/wp-json\/wp\/v2\/tags?post=7564"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}