{"id":21440,"date":"2024-01-02T09:25:24","date_gmt":"2024-01-02T09:25:24","guid":{"rendered":"https:\/\/server.hk\/blog\/21440\/"},"modified":"2024-11-14T10:34:21","modified_gmt":"2024-11-14T02:34:21","slug":"how-to-fix-postgresql-error-code-53000-insufficient_resources","status":"publish","type":"post","link":"https:\/\/server.hk\/cnblog\/21440\/","title":{"rendered":"\u5982\u4f55\u4fee\u5fa9 PostgreSQL \u932f\u8aa4\u4ee3\u78bc\uff1a53000 &#8211; insufficient_resources"},"content":{"rendered":"<h1 id=\"how-to-fix-postgresql-error-code-53000-insufficient_resources-dXUFhsLUqa\">\u5982\u4f55\u4fee\u5fa9 PostgreSQL \u932f\u8aa4\u4ee3\u78bc\uff1a53000 &#8211; insufficient_resources<\/h1>\n<p>PostgreSQL \u662f\u4e00\u500b\u5f37\u5927\u7684\u958b\u6e90\u95dc\u806f\u6027\u6578\u64da\u5eab\u7ba1\u7406\u7cfb\u7d71\uff0c\u5ee3\u6cdb\u61c9\u7528\u65bc\u5404\u985e\u578b\u7684\u61c9\u7528\u7a0b\u5e8f\u4e2d\u3002\u7136\u800c\uff0c\u4efb\u4f55\u8edf\u4ef6\u90fd\u53ef\u80fd\u6703\u9047\u5230\u932f\u8aa4\uff0c\u9019\u4e9b\u932f\u8aa4\u53ef\u80fd\u6703\u64fe\u4e82\u5176\u6b63\u5e38\u904b\u4f5c\u3002\u5176\u4e2d\u4e00\u500b\u932f\u8aa4\u70ba PostgreSQL \u932f\u8aa4\u4ee3\u78bc\uff1a53000 &#8211; insufficient_resources\u3002\u672c\u6587\u5c07\u63a2\u8a0e\u6b64\u932f\u8aa4\u7684\u6210\u56e0\u4e26\u63d0\u4f9b\u4fee\u5fa9\u65b9\u6848\u3002<\/p>\n<h2 id=\"understanding-postgresql-error-code-53000-insufficient_resources-dXUFhsLUqa\">\u7406\u89e3 PostgreSQL \u932f\u8aa4\u4ee3\u78bc\uff1a53000 &#8211; insufficient_resources<\/h2>\n<p>\u7576\u6578\u64da\u5eab\u4f3a\u670d\u5668\u6c92\u6709\u8db3\u5920\u7684\u8cc7\u6e90\u4f86\u57f7\u884c\u67e5\u8a62\u6216\u57f7\u884c\u64cd\u4f5c\u6642\uff0c\u5c31\u6703\u767c\u751f PostgreSQL \u932f\u8aa4\u4ee3\u78bc\uff1a53000 &#8211; insufficient_resources\u3002\u6b64\u932f\u8aa4\u901a\u5e38\u8868\u793a\u7cfb\u7d71\u5167\u5b58\u3001\u78c1\u789f\u7a7a\u9593\u6216\u5176\u4ed6\u95dc\u9375\u8cc7\u6e90\u4e0d\u8db3\u3002<\/p>\n<p>\u51fa\u73fe\u6b64\u932f\u8aa4\u6642\uff0c\u60a8\u53ef\u80fd\u6703\u7d93\u6b77\u67e5\u8a62\u6027\u80fd\u7de9\u6162\u3001\u4ea4\u6613\u5931\u6557\u751a\u81f3\u4f3a\u670d\u5668\u5d29\u6f70\u3002\u53ca\u6642\u8655\u7406\u9019\u4e00\u932f\u8aa4\u5c0d\u65bc\u78ba\u4fdd PostgreSQL \u6578\u64da\u5eab\u7684\u5e73\u7a69\u904b\u884c\u81f3\u95dc\u91cd\u8981\u3002<\/p>\n<h2 id=\"causes-of-postgresql-error-code-53000-insufficient_resources-dXUFhsLUqa\">PostgreSQL \u932f\u8aa4\u4ee3\u78bc\uff1a53000 &#8211; insufficient_resources \u7684\u539f\u56e0<\/h2>\n<p>PostgreSQL \u932f\u8aa4\u4ee3\u78bc\uff1a53000 &#8211; insufficient_resources \u7684\u6f5b\u5728\u539f\u56e0\u6709\u5e7e\u500b\uff1a<\/p>\n<ul>\n<li><strong>\u5167\u5b58\u4e0d\u8db3\uff1a<\/strong> \u5167\u5b58\u5206\u914d\u4e0d\u8db3\u53ef\u80fd\u5c0e\u81f4\u8cc7\u6e90\u9650\u5236\uff0c\u5c24\u5176\u662f\u5728\u8655\u7406\u5927\u578b\u6578\u64da\u96c6\u6216\u8907\u96dc\u67e5\u8a62\u6642\u3002<\/li>\n<li><strong>\u78c1\u789f\u7a7a\u9593\u4e0d\u8db3\uff1a<\/strong> \u5982\u679c\u78c1\u789f\u7a7a\u9593\u4e0d\u8db3\uff0cPostgreSQL \u53ef\u80fd\u5728\u57f7\u884c\u78c1\u789f\u5bc6\u96c6\u578b\u64cd\u4f5c\u6642\u9762\u81e8\u56f0\u96e3\uff0c\u5f9e\u800c\u5c0e\u81f4\u8cc7\u6e90\u77ed\u7f3a\u3002<\/li>\n<li><strong>\u4e26\u767c\u554f\u984c\uff1a<\/strong> \u9ad8\u4e26\u767c\u9023\u63a5\u6216\u4ea4\u6613\u7684\u6578\u91cf\u6703\u589e\u52a0\u7cfb\u7d71\u8cc7\u6e90\u7684\u8ca0\u64d4\uff0c\u5f15\u767c insufficient_resources \u932f\u8aa4\u3002<\/li>\n<li><strong>\u914d\u7f6e\u8a2d\u5b9a\uff1a<\/strong> \u4e0d\u6b63\u78ba\u6216\u4e0d\u4f73\u7684\u914d\u7f6e\u8a2d\u5b9a\uff0c\u4f8b\u5982 shared_buffers \u6216 work_mem\uff0c\u53ef\u80fd\u6703\u5f71\u97ff\u8cc7\u6e90\u5206\u914d\uff0c\u5c0e\u81f4\u6b64\u932f\u8aa4\u3002<\/li>\n<\/ul>\n<h2 id=\"fixing-postgresql-error-code-53000-insufficient_resources-dXUFhsLUqa\">\u4fee\u5fa9 PostgreSQL \u932f\u8aa4\u4ee3\u78bc\uff1a53000 &#8211; insufficient_resources<\/h2>\n<p>\u8981\u89e3\u6c7a PostgreSQL \u932f\u8aa4\u4ee3\u78bc\uff1a53000 &#8211; insufficient_resources\uff0c\u8acb\u8003\u616e\u4ee5\u4e0b\u89e3\u6c7a\u65b9\u6848\uff1a<\/p>\n<h3 id=\"1-optimize-query-performance-dXUFhsLUqa\">1. \u512a\u5316\u67e5\u8a62\u6027\u80fd<\/h3>\n<p>\u6aa2\u67e5\u4e26\u512a\u5316\u60a8\u7684\u67e5\u8a62\u4ee5\u6e1b\u5c11\u8cc7\u6e90\u6d88\u8017\u3002\u78ba\u4fdd\u64c1\u6709\u9069\u5408\u7684\u7d22\u5f15\uff0c\u4f7f\u7528\u9ad8\u6548\u7684\u806f\u63a5\u6280\u8853\uff0c\u4e26\u9650\u5236\u6240\u6aa2\u7d22\u6578\u64da\u7684\u6578\u91cf\u3002<\/p>\n<h3 id=\"2-increase-memory-allocation-dXUFhsLUqa\">2. \u589e\u52a0\u5167\u5b58\u5206\u914d<\/h3>\n<p>\u5982\u679c\u7cfb\u7d71\u5167\u5b58\u4e0d\u8db3\uff0c\u8acb\u70ba PostgreSQL \u5206\u914d\u66f4\u591a\u5167\u5b58\u3002\u5728 PostgreSQL \u914d\u7f6e\u6587\u4ef6\u4e2d\u8abf\u6574 shared_buffers \u548c work_mem \u914d\u7f6e\u53c3\u6578\uff0c\u4ee5\u512a\u5316\u5167\u5b58\u4f7f\u7528\u3002<\/p>\n<h3 id=\"3-monitor-and-manage-disk-space-dXUFhsLUqa\">3. \u76e3\u63a7\u548c\u7ba1\u7406\u78c1\u789f\u7a7a\u9593<\/h3>\n<p>\u5b9a\u671f\u76e3\u63a7\u78c1\u789f\u7a7a\u9593\u7684\u4f7f\u7528\u60c5\u6cc1\uff0c\u78ba\u4fdd\u6709\u8db3\u5920\u7684\u7a7a\u9592\u7a7a\u9593\u4f9b PostgreSQL \u64cd\u4f5c\u4f7f\u7528\u3002\u8003\u616e\u5b58\u6a94\u6216\u522a\u9664\u4e0d\u5fc5\u8981\u7684\u6578\u64da\u4ee5\u91cb\u653e\u78c1\u789f\u7a7a\u9593\u3002<\/p>\n<h3 id=\"4-tune-configuration-settings-dXUFhsLUqa\">4. \u8abf\u6574\u914d\u7f6e\u8a2d\u5b9a<\/h3>\n<p>\u6aa2\u67e5\u4e26\u7d30\u7dfb\u8abf\u6574 PostgreSQL \u7684\u914d\u7f6e\u8a2d\u5b9a\uff0c\u4ee5\u512a\u5316\u8cc7\u6e90\u5206\u914d\u3002\u53c3\u8003 PostgreSQL \u6587\u6a94\u4ee5\u7372\u53d6\u6709\u95dc\u8abf\u6574\u5982 max_connections\u3001max_worker_processes \u548c effective_cache_size \u53c3\u6578\u7684\u6307\u5c0e\u3002<\/p>\n<h3 id=\"5-upgrade-hardware-or-scale-resources-dXUFhsLUqa\">5. \u5347\u7d1a\u786c\u4ef6\u6216\u64f4\u5c55\u8cc7\u6e90<\/h3>\n<p>\u5982\u679c\u60a8\u7d93\u5e38\u9762\u81e8\u8cc7\u6e90\u9650\u5236\uff0c\u8003\u616e\u5347\u7d1a\u786c\u4ef6\u6216\u64f4\u5c55\u8cc7\u6e90\u3002\u9019\u53ef\u80fd\u6d89\u53ca\u5230\u589e\u52a0\u5167\u5b58\u3001\u64f4\u5927\u78c1\u789f\u7a7a\u9593\u6216\u4f7f\u7528\u66f4\u5f37\u5927\u7684\u4f3a\u670d\u5668\u3002<\/p>\n<h2 id=\"summary-dXUFhsLUqa\">\u7e3d\u7d50<\/h2>\n<p>\u7e3d\u4e4b\uff0cPostgreSQL \u932f\u8aa4\u4ee3\u78bc\uff1a53000 &#8211; insufficient_resources \u53ef\u80fd\u7531\u591a\u7a2e\u56e0\u7d20\u9020\u6210\uff0c\u5982\u5167\u5b58\u4e0d\u8db3\u3001\u78c1\u789f\u7a7a\u9593\u4e0d\u8db3\u3001\u4e26\u767c\u554f\u984c\u6216\u914d\u7f6e\u8a2d\u5b9a\u4e0d\u7576\u3002\u4fee\u5fa9\u6b64\u932f\u8aa4\u7684\u8fa6\u6cd5\u5305\u62ec\u512a\u5316\u67e5\u8a62\u6027\u80fd\u3001\u589e\u52a0\u5167\u5b58\u3001\u76e3\u63a7\u78c1\u789f\u7a7a\u9593\u3001\u8abf\u6574\u914d\u7f6e\u8a2d\u5b9a\uff0c\u4ee5\u53ca\u8003\u616e\u5347\u7d1a\u786c\u4ef6\u6216\u64f4\u5c55\u8cc7\u6e90\u3002<\/p>\n<p>\u5982\u679c\u60a8\u6b63\u9762\u81e8 PostgreSQL \u932f\u8aa4\u4ee3\u78bc\uff1a53000 &#8211; insufficient_resources \u6216\u5176\u4ed6\u6578\u64da\u5eab\u76f8\u95dc\u7684\u554f\u984c\uff0cServer.HK \u63d0\u4f9b\u53ef\u9760\u4e14\u9ad8\u6548\u7684 VPS \u4e3b\u6a5f\u89e3\u6c7a\u65b9\u6848\u3002\u6211\u5011\u7684 <a href=\"https:\/\/server.hk\">\u9999\u6e2f VPS \u4e3b\u6a5f<\/a> \u670d\u52d9\u63d0\u4f9b\u60a8\u6240\u9700\u7684\u8cc7\u6e90\u548c\u652f\u6301\uff0c\u4ee5\u78ba\u4fdd PostgreSQL \u6578\u64da\u5eab\u7684\u9806\u5229\u904b\u884c\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5982\u4f55\u4fee\u5fa9 PostgreSQL &#46;&#46;&#46;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4925],"tags":[],"class_list":["post-21440","post","type-post","status-publish","format-standard","hentry","category-4925"],"_links":{"self":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/21440","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/comments?post=21440"}],"version-history":[{"count":1,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/21440\/revisions"}],"predecessor-version":[{"id":24041,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/21440\/revisions\/24041"}],"wp:attachment":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/media?parent=21440"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/categories?post=21440"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/tags?post=21440"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}