{"id":117385,"date":"2026-10-24T18:57:11","date_gmt":"2026-10-24T10:57:11","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/117385.html"},"modified":"2026-10-24T18:57:11","modified_gmt":"2026-10-24T10:57:11","slug":"hikaricp-%e8%bf%9e%e6%8e%a5%e6%b1%a0%e8%80%97%e5%b0%bd","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/117385.html","title":{"rendered":"HikariCP \u8fde\u63a5\u6c60\u8017\u5c3d"},"content":{"rendered":"<h2>HikariCP \u8fde\u63a5\u6c60\u8017\u5c3d&#xff1a;\u63a5\u53e3\u4e3a\u4ec0\u4e48\u7a81\u7136\u5168\u90e8\u8d85\u65f6<\/h2>\n<p>\u524d\u4e00\u5206\u949f\u63a5\u53e3\u8fd8\u6b63\u5e38&#xff0c;\u540e\u4e00\u5206\u949f\u5c31\u96c6\u4f53\u8d85\u65f6\u3002\u65e5\u5fd7\u91cc\u53cd\u590d\u51fa\u73b0\u540c\u4e00\u53e5\u8bdd&#xff1a;<\/p>\n<p>Connection is not available, request timed out after 30000ms<\/p>\n<hr \/>\n<h3>1. \u8fde\u63a5\u6c60\u4e0d\u662f\u4e00\u4e2a\u65e0\u9650\u5f00\u5173<\/h3>\n<p>\u5e94\u7528\u6bcf\u6b21\u8bbf\u95ee\u6570\u636e\u5e93&#xff0c;\u90fd\u8981\u5148\u4ece\u8fde\u63a5\u6c60\u62ff\u4e00\u4e2a\u8fde\u63a5\u3002\u62ff\u5230\u8fde\u63a5\u540e&#xff0c;\u5e94\u7528\u6267\u884c SQL&#xff0c;\u518d\u628a\u8fde\u63a5\u5f52\u8fd8\u3002\u5982\u679c\u5f52\u8fd8\u4e4b\u524d\u53d1\u751f\u4e86\u95ee\u9898&#xff0c;\u8fde\u63a5\u5c31\u4f1a\u4e00\u76f4\u5360\u7528\u4e0b\u53bb\u3002<\/p>\n<p>HikariCP \u9ed8\u8ba4\u7684 connectionTimeout \u662f 30 \u79d2&#xff0c;\u6700\u4f4e\u5141\u8bb8 250 \u6beb\u79d2\u3002\u8d85\u8fc7\u7b49\u5f85\u65f6\u95f4\u540e&#xff0c;\u8bf7\u6c42\u4f1a\u629b\u5f02\u5e38\u3002\u6240\u4ee5\u201c\u63a5\u53e3\u7a81\u7136\u5168\u90e8\u8d85\u65f6\u201d\u901a\u5e38\u662f\u8fd9\u6837\u4e00\u4e2a\u8fc7\u7a0b&#xff1a;<\/p>\n<li>\u67d0\u4e9b\u8bf7\u6c42\u62ff\u5230\u8fde\u63a5\u540e\u957f\u65f6\u95f4\u6ca1\u6709\u5f52\u8fd8&#xff1b;<\/li>\n<li>\u6c60\u5b50\u91cc\u6240\u6709\u8fde\u63a5\u90fd\u88ab\u5360\u6ee1&#xff1b;<\/li>\n<li>\u540e\u7eed\u8bf7\u6c42\u8fdb\u5165\u7b49\u5f85&#xff1b;<\/li>\n<li>30 \u79d2\u4e00\u5230&#xff0c;\u7b49\u5f85\u7684\u8bf7\u6c42\u5168\u90e8\u5931\u8d25\u3002<\/li>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/10\/20261024105709-6adc8f0590a62.png\" alt=\"\u5728\u8fd9\u91cc\u63d2\u5165\u56fe\u7247\u63cf\u8ff0\" \/><\/p>\n<p>\u56fe 1&#xff1a;\u6c60\u5b50\u5927\u5c0f\u6709\u9650&#xff0c;\u5360\u7528\u4e0d\u5f52\u8fd8\u4f1a\u8ba9\u540e\u9762\u7684\u8bf7\u6c42\u6392\u961f\u5230\u8d85\u65f6\u3002<\/p>\n<p>\u8fd9\u91cc\u6709\u4e00\u4e2a\u5bb9\u6613\u8bef\u5224\u7684\u70b9&#xff1a;\u65e5\u5fd7\u91cc\u62a5\u7684\u662f\u201c\u83b7\u53d6\u8fde\u63a5\u8d85\u65f6\u201d&#xff0c;\u4f46\u771f\u6b63\u7684\u75c5\u6839\u5f80\u5f80\u4e0d\u5728\u8fde\u63a5\u6c60\u672c\u8eab&#xff0c;\u800c\u5728\u201c\u8c01\u5360\u7528\u4e86\u8fde\u63a5\u3001\u4e3a\u4ec0\u4e48\u8fd9\u4e48\u4e45\u201d\u3002<\/p>\n<h3>2. \u6162 SQL \u548c\u957f\u4e8b\u52a1&#xff0c;\u662f\u6700\u5e38\u89c1\u7684\u5360\u7528\u8005<\/h3>\n<p>\u8fde\u63a5\u53ea\u6709\u5728\u88ab\u5f52\u8fd8\u540e&#xff0c;\u624d\u80fd\u7ed9\u4e0b\u4e00\u4e2a\u8bf7\u6c42\u4f7f\u7528\u3002\u5982\u679c\u67d0\u4e2a\u63a5\u53e3\u6267\u884c\u4e00\u6761 10 \u79d2\u7684 SQL&#xff0c;\u6216\u8005\u5728\u4e8b\u52a1\u91cc\u8c03\u7528\u5916\u90e8\u670d\u52a1\u3001\u53d1\u6d88\u606f\u3001\u5faa\u73af\u67e5\u8be2&#xff0c;\u8fde\u63a5\u5c31\u4f1a\u88ab\u957f\u671f\u5360\u7528\u3002<\/p>\n<p>\u4e00\u4e2a\u4e8b\u52a1\u65b9\u6cd5\u53ef\u80fd\u770b\u8d77\u6765\u5f88\u77ed&#xff1a;<\/p>\n<p><span class=\"token annotation punctuation\">&#064;Transactional<\/span><br \/>\n<span class=\"token keyword\">public<\/span> <span class=\"token keyword\">void<\/span> <span class=\"token function\">createOrder<\/span><span class=\"token punctuation\">(<\/span><span class=\"token class-name\">Order<\/span> order<span class=\"token punctuation\">)<\/span> <span class=\"token punctuation\">{<\/span><br \/>\n    orderMapper<span class=\"token punctuation\">.<\/span><span class=\"token function\">insert<\/span><span class=\"token punctuation\">(<\/span>order<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n    notificationClient<span class=\"token punctuation\">.<\/span><span class=\"token function\">send<\/span><span class=\"token punctuation\">(<\/span>order<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n    stockMapper<span class=\"token punctuation\">.<\/span><span class=\"token function\">deduct<\/span><span class=\"token punctuation\">(<\/span>order<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n<span class=\"token punctuation\">}<\/span><\/p>\n<p>\u5728 notificationClient.send \u671f\u95f4&#xff0c;\u6570\u636e\u5e93\u8fde\u63a5\u4ecd\u7136\u88ab\u4e8b\u52a1\u6301\u6709\u3002\u5982\u679c\u8fd9\u4e2a\u5916\u90e8\u8c03\u7528\u8017\u65f6 3 \u79d2&#xff0c;\u6bcf\u4e2a\u8bf7\u6c42\u5c31\u4f1a\u6bd4\u9884\u671f\u591a\u5360\u7528 3 \u79d2\u8fde\u63a5\u3002\u5e76\u53d1\u4e00\u4e0a\u6765&#xff0c;\u6c60\u5b50\u5f88\u5bb9\u6613\u88ab\u6253\u6ee1\u3002<\/p>\n<p>\u6240\u4ee5\u6392\u67e5\u8fde\u63a5\u6c60\u8017\u5c3d\u65f6&#xff0c;\u7b2c\u4e00\u6b65\u4e0d\u662f\u6539\u6c60\u5b50\u914d\u7f6e&#xff0c;\u800c\u662f\u627e\u5230\u6267\u884c\u65f6\u95f4\u6700\u957f\u7684 SQL \u548c\u4e8b\u52a1\u8fb9\u754c\u3002\u5f88\u591a\u201c\u8fde\u63a5\u4e0d\u591f\u201d\u7684\u672c\u8d28&#xff0c;\u662f SQL \u592a\u6162\u6216\u4e8b\u52a1\u628a\u4e0d\u8be5\u5305\u542b\u7684\u64cd\u4f5c\u5305\u4e86\u8fdb\u6765\u3002<\/p>\n<h3>3. \u8fde\u63a5\u6cc4\u6f0f&#xff1a;\u62ff\u5230\u8fde\u63a5\u5374\u4e0d\u5f52\u8fd8<\/h3>\n<p>\u8fde\u63a5\u6cc4\u6f0f\u548c\u6162 SQL \u4e0d\u540c\u3002\u6162 SQL \u6700\u7ec8\u4f1a\u5f52\u8fd8\u8fde\u63a5&#xff0c;\u6cc4\u6f0f\u5219\u6c38\u8fdc\u4e0d\u4f1a\u5f52\u8fd8\u3002<\/p>\n<p><span class=\"token class-name\">Connection<\/span> conn <span class=\"token operator\">&#061;<\/span> dataSource<span class=\"token punctuation\">.<\/span><span class=\"token function\">getConnection<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\nconn<span class=\"token punctuation\">.<\/span><span class=\"token function\">createStatement<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">.<\/span><span class=\"token function\">executeQuery<\/span><span class=\"token punctuation\">(<\/span><span class=\"token string\">&#034;SELECT 1&#034;<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n<span class=\"token comment\">\/\/ \u6ca1\u6709 conn.close()<\/span><\/p>\n<p>\u4e0a\u9762\u7684\u4ee3\u7801\u6bcf\u6b21\u6267\u884c\u90fd\u4f1a\u5c11\u4e00\u4e2a\u53ef\u7528\u8fde\u63a5\u3002\u968f\u7740\u65f6\u95f4\u63a8\u79fb&#xff0c;idle \u8fde\u63a5\u5f52\u96f6&#xff0c;active \u8fde\u63a5\u6301\u7eed\u7b49\u4e8e\u6700\u5927\u503c&#xff0c;\u63a5\u53e3\u5f00\u59cb\u6392\u961f\u8d85\u65f6\u3002<\/p>\n<p>\u6b63\u786e\u5199\u6cd5\u662f\u4ea4\u7ed9 try-with-resources&#xff1a;<\/p>\n<p><span class=\"token keyword\">try<\/span> <span class=\"token punctuation\">(<\/span><span class=\"token class-name\">Connection<\/span> conn <span class=\"token operator\">&#061;<\/span> dataSource<span class=\"token punctuation\">.<\/span><span class=\"token function\">getConnection<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n     <span class=\"token class-name\">PreparedStatement<\/span> stmt <span class=\"token operator\">&#061;<\/span> conn<span class=\"token punctuation\">.<\/span><span class=\"token function\">prepareStatement<\/span><span class=\"token punctuation\">(<\/span><span class=\"token string\">&#034;SELECT 1&#034;<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">)<\/span> <span class=\"token punctuation\">{<\/span><br \/>\n    stmt<span class=\"token punctuation\">.<\/span><span class=\"token function\">executeQuery<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n<span class=\"token punctuation\">}<\/span><\/p>\n<p>Connection\u3001Statement\u3001ResultSet \u90fd\u5b9e\u73b0\u4e86 AutoCloseable&#xff0c;\u65b9\u6cd5\u7ed3\u675f\u65f6\u4f1a\u88ab\u81ea\u52a8\u5173\u95ed\u3002\u53ea\u6709\u5728\u786e\u5b9e\u9700\u8981\u8de8\u8d8a\u65b9\u6cd5\u8fb9\u754c\u7684\u8fde\u63a5\u65f6&#xff0c;\u624d\u624b\u52a8\u7ba1\u7406\u751f\u547d\u5468\u671f&#xff0c;\u5e76\u4e14\u5fc5\u987b\u5728 finally \u6216\u7b49\u4ef7\u7ed3\u6784\u4e2d\u5f52\u8fd8\u3002<\/p>\n<h3>4. leak-detection-threshold \u80fd\u5e2e\u4f60\u627e\u5230\u6cc4\u6f0f\u70b9<\/h3>\n<p>Spring Boot \u4e2d\u53ef\u4ee5\u8fd9\u6837\u914d\u7f6e HikariCP&#xff1a;<\/p>\n<p><span class=\"token key atrule\">spring<\/span><span class=\"token punctuation\">:<\/span><br \/>\n  <span class=\"token key atrule\">datasource<\/span><span class=\"token punctuation\">:<\/span><br \/>\n    <span class=\"token key atrule\">hikari<\/span><span class=\"token punctuation\">:<\/span><br \/>\n      <span class=\"token key atrule\">maximum-pool-size<\/span><span class=\"token punctuation\">:<\/span> <span class=\"token number\">20<\/span><br \/>\n      <span class=\"token key atrule\">minimum-idle<\/span><span class=\"token punctuation\">:<\/span> <span class=\"token number\">5<\/span><br \/>\n      <span class=\"token key atrule\">connection-timeout<\/span><span class=\"token punctuation\">:<\/span> <span class=\"token number\">3000<\/span><br \/>\n      <span class=\"token key atrule\">leak-detection-threshold<\/span><span class=\"token punctuation\">:<\/span> <span class=\"token number\">10000<\/span><br \/>\n      <span class=\"token key atrule\">max-lifetime<\/span><span class=\"token punctuation\">:<\/span> <span class=\"token number\">1800000<\/span><\/p>\n<p>leak-detection-threshold \u63a7\u5236\u8fde\u63a5\u501f\u51fa\u8d85\u8fc7\u591a\u4e45\u540e\u6253\u5370\u201c\u53ef\u80fd\u6cc4\u6f0f\u201d\u7684\u65e5\u5fd7\u3002\u8fd9\u4e2a\u65e5\u5fd7\u901a\u5e38\u5305\u542b\u8fde\u63a5\u501f\u51fa\u65f6\u7684\u5806\u6808&#xff0c;\u80fd\u544a\u8bc9\u4f60\u662f\u5728\u54ea\u4e2a\u4ee3\u7801\u4f4d\u7f6e\u62ff\u8d70\u4e86\u8fde\u63a5\u3002\u5b83\u4e0d\u4f1a\u89e3\u51b3\u95ee\u9898&#xff0c;\u4f46\u80fd\u628a\u201c\u6c60\u5b50\u6ee1\u4e86\u201d\u53d8\u6210\u201c\u5177\u4f53\u54ea\u4e2a\u65b9\u6cd5\u5360\u4e86\u8fde\u63a5\u201d\u3002<\/p>\n<p>max-lifetime \u5efa\u8bae\u6bd4\u6570\u636e\u5e93\u6216\u7f51\u7edc\u8bbe\u5907\u4e3b\u52a8\u65ad\u5f00\u7684\u8d85\u65f6\u65f6\u95f4\u77ed\u51e0\u79d2&#xff0c;\u907f\u514d\u8fde\u63a5\u5df2\u7ecf\u88ab\u670d\u52a1\u7aef\u65ad\u5f00\u3001\u5ba2\u6237\u7aef\u8fd8\u4ee5\u4e3a\u5b83\u53ef\u7528\u3002<\/p>\n<p>connection-timeout \u5efa\u8bae\u5c0f\u4e8e\u63a5\u53e3\u81ea\u8eab\u7684\u8d85\u65f6\u65f6\u95f4\u3002\u8fde\u63a5\u83b7\u53d6\u5931\u8d25\u5e94\u8be5\u5c3d\u5feb\u5931\u8d25&#xff0c;\u800c\u4e0d\u662f\u8ba9\u8bf7\u6c42\u4e00\u76f4\u5361\u5728\u6c60\u5b50\u5916\u9762\u3002<\/p>\n<h3>5. \u7528\u6307\u6807\u786e\u8ba4\u662f\u201c\u6c60\u5b50\u6ee1\u201d&#xff0c;\u8fd8\u662f\u201c\u6570\u636e\u5e93\u6ee1\u201d<\/h3>\n<p>\u53d1\u751f\u5f02\u5e38\u65f6&#xff0c;\u5148\u770b HikariCP \u66b4\u9732\u7684\u6307\u6807&#xff1a;<\/p>\n<p>active connections<br \/>\nidle connections<br \/>\npending threads<br \/>\nconnection timeout<br \/>\nconnection creation<br \/>\nconnection acquire time<\/p>\n<p>\u5982\u679c\u4f7f\u7528 Spring Boot Actuator \u548c Micrometer&#xff0c;\u53ef\u4ee5\u770b\u5230\u7c7b\u4f3c hikaricp.connections.active\u3001hikaricp.connections.idle\u3001hikaricp.connections.pending \u7684\u6307\u6807\u3002<\/p>\n<p>\u5173\u952e\u5224\u65ad\u662f&#xff1a;<\/p>\n<ul>\n<li>active \u957f\u65f6\u95f4\u7b49\u4e8e maximumPoolSize&#xff0c;\u8bf4\u660e\u8fde\u63a5\u90fd\u88ab\u501f\u51fa&#xff1b;<\/li>\n<li>pending \u6301\u7eed\u5927\u4e8e 0&#xff0c;\u8bf4\u660e\u5df2\u7ecf\u6709\u8bf7\u6c42\u5728\u6392\u961f&#xff1b;<\/li>\n<li>idle \u957f\u671f\u4e3a 0&#xff0c;\u8bf4\u660e\u6c60\u5b50\u6ca1\u6709\u4f59\u91cf&#xff1b;<\/li>\n<li>\u83b7\u53d6\u8fde\u63a5\u7684\u5e73\u5747\u8017\u65f6\u5347\u9ad8&#xff0c;\u901a\u5e38\u610f\u5473\u7740\u7b49\u5f85\u5f00\u59cb\u51fa\u73b0\u3002<\/li>\n<\/ul>\n<p>\u8fd8\u6709\u4e00\u79cd\u60c5\u51b5\u8981\u533a\u5206&#xff1a;\u5982\u679c\u6c60\u5b50\u80fd\u521b\u5efa\u65b0\u8fde\u63a5&#xff0c;\u4f46\u6570\u636e\u5e93\u62a5 too many connections&#xff0c;\u8bf4\u660e\u6570\u636e\u5e93\u4fa7\u8fde\u63a5\u4e0a\u9650\u5148\u88ab\u6253\u6ee1\u3002\u8fd9\u65f6\u7684\u95ee\u9898\u4e0d\u5728 HikariCP \u7684\u53c2\u6570&#xff0c;\u800c\u5728\u6570\u636e\u5e93\u7684 max_connections \u548c\u6574\u4e2a\u96c6\u7fa4\u7684\u603b\u8fde\u63a5\u9884\u7b97\u3002<\/p>\n<h3>6. \u6c60\u5b50\u4e0d\u662f\u8d8a\u5927\u8d8a\u597d<\/h3>\n<p>\u8fde\u63a5\u6c60\u5927\u5c0f\u6ca1\u6709\u4e07\u80fd\u7b54\u6848\u3002\u65e9\u671f HikariCP \u7684\u6587\u6863\u7ed9\u51fa\u8fc7\u4e00\u4e2a\u7ecf\u9a8c\u516c\u5f0f&#xff1a;<\/p>\n<p>connections &#061; (core_count * 2) &#043; effective_spindle_count<\/p>\n<p>\u5b83\u8003\u8651\u4e86 CPU \u6838\u5fc3\u548c\u78c1\u76d8\u80fd\u529b&#xff0c;\u4f46\u53ea\u9002\u5408\u4f5c\u4e3a\u8d77\u70b9&#xff0c;\u4e0d\u9002\u5408\u7167\u6284\u5230\u6240\u6709\u73af\u5883\u3002\u73b0\u4ee3\u6570\u636e\u5e93\u3001\u4e91\u5b9e\u4f8b\u3001\u8bfb\u5199\u5206\u79bb\u548c\u5bb9\u5668\u5316\u90e8\u7f72\u90fd\u4f1a\u5f71\u54cd\u7ed3\u679c\u3002<\/p>\n<p>\u66f4\u5927\u7684\u6c60\u5b50\u610f\u5473\u7740\u66f4\u591a\u8fde\u63a5\u3001\u66f4\u591a\u6570\u636e\u5e93\u7aef\u8d44\u6e90\u5360\u7528\u548c\u66f4\u5927\u7684\u7ba1\u7406\u5f00\u9500\u3002\u5982\u679c\u6570\u636e\u5e93\u8fde\u63a5\u4e0a\u9650\u53ea\u6709 100&#xff0c;\u5e94\u7528\u5374\u628a\u6c60\u5b50\u914d\u5230 200&#xff0c;\u6570\u636e\u5e93\u4f1a\u5148\u625b\u4e0d\u4f4f\u3002\u6c60\u5b50\u5927\u5c0f\u5e94\u8be5\u548c\u6570\u636e\u5e93\u7684 max_connections\u3001\u5b9e\u4f8b\u89c4\u683c\u3001\u4e8b\u52a1\u65f6\u957f\u548c\u5b9e\u9645\u5e76\u53d1\u4e00\u8d77\u8bc4\u4f30&#xff0c;\u518d\u901a\u8fc7\u538b\u6d4b\u786e\u8ba4\u3002<\/p>\n<h3>7. \u4fee\u590d\u65f6\u4e0d\u8981\u53ea\u4f1a\u8c03\u5927\u6570\u5b57<\/h3>\n<p>\u8fde\u63a5\u6c60\u8017\u5c3d\u901a\u5e38\u53ea\u662f\u8868\u8c61&#xff0c;\u771f\u6b63\u8981\u5904\u7406\u7684\u662f\u201c\u8c01\u5360\u7528\u4e86\u8fde\u63a5\u3001\u4e3a\u4ec0\u4e48\u8fd9\u4e48\u4e45\u201d\u3002<\/p>\n<p>\u53ef\u4ee5\u5148\u505a\u8fd9\u51e0\u4ef6\u4e8b&#xff1a;<\/p>\n<ul>\n<li>\u627e\u6162 SQL&#xff0c;\u52a0\u7d22\u5f15\u3001\u62c6\u5206\u5927\u67e5\u8be2\u3001\u51cf\u5c11\u4e0d\u5fc5\u8981\u7684\u5b57\u6bb5&#xff1b;<\/li>\n<li>\u7f29\u77ed\u4e8b\u52a1\u8303\u56f4&#xff0c;\u4e0d\u8981\u5728\u6267\u884c SQL \u671f\u95f4\u8c03\u7528\u8fdc\u7a0b\u63a5\u53e3\u6216\u53d1\u9001\u6d88\u606f&#xff1b;<\/li>\n<li>\u786e\u8ba4\u6240\u6709\u8fde\u63a5\u3001\u8bed\u53e5\u548c\u7ed3\u679c\u96c6\u90fd\u5728 try-with-resources \u4e2d\u5173\u95ed&#xff1b;<\/li>\n<li>\u6839\u636e\u6570\u636e\u5e93\u8fde\u63a5\u4e0a\u9650\u548c\u538b\u6d4b\u7ed3\u679c\u8bbe\u7f6e\u5408\u7406\u7684 maximum-pool-size&#xff1b;<\/li>\n<li>\u89c2\u5bdf leak-detection-threshold \u6253\u5370\u7684\u5806\u6808&#xff0c;\u627e\u5230\u6cc4\u6f0f\u70b9&#xff1b;<\/li>\n<li>\u7528\u7f13\u5b58\u3001\u8bfb\u5199\u5206\u79bb\u6216\u5f02\u6b65\u4efb\u52a1\u51cf\u5c11\u6570\u636e\u5e93\u8fde\u63a5\u5360\u7528\u3002<\/li>\n<\/ul>\n<p>\u5982\u679c\u53ea\u662f\u628a maximum-pool-size \u4ece 20 \u6539\u5230 200&#xff0c;\u6c60\u5b50\u53ef\u80fd\u4e0d\u518d\u62a5\u8d85\u65f6&#xff0c;\u4f46\u6570\u636e\u5e93\u4f1a\u88ab\u65b0\u8fdb\u6765\u7684\u5e76\u53d1\u8bf7\u6c42\u538b\u57ae&#xff0c;\u95ee\u9898\u53ea\u662f\u6362\u4e86\u4e2a\u4f4d\u7f6e\u51fa\u73b0\u3002<\/p>\n<hr \/>\n<h3>\u603b\u7ed3<\/h3>\n<p>HikariCP \u8fde\u63a5\u6c60\u8017\u5c3d&#xff0c;\u8bf4\u660e\u8fde\u63a5\u88ab\u501f\u51fa\u540e\u6ca1\u6709\u53ca\u65f6\u5f52\u8fd8\u3002\u5b83\u53ef\u80fd\u662f\u6162 SQL\u3001\u957f\u4e8b\u52a1\u3001\u8fde\u63a5\u6cc4\u6f0f\u6216\u6c60\u5b50\u914d\u7f6e\u4e0d\u5408\u7406\u3002\u4fee\u590d\u987a\u5e8f\u5e94\u8be5\u662f\u5148\u627e\u5230\u5360\u7528\u8005&#xff0c;\u518d\u8c03\u6574\u6c60\u5b50\u5927\u5c0f&#xff0c;\u800c\u4e0d\u662f\u5148\u628a\u6570\u5b57\u8c03\u5927\u3002<\/p>\n<h3>\u53c2\u8003\u8d44\u6599<\/h3>\n<ul>\n<li>HikariCP \u914d\u7f6e\u6587\u6863<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>HikariCP \u8fde\u63a5\u6c60\u8017\u5c3d&#xff1a;\u63a5\u53e3\u4e3a\u4ec0\u4e48\u7a81\u7136\u5168\u90e8\u8d85\u65f6 \u524d\u4e00\u5206\u949f\u63a5\u53e3\u8fd8\u6b63\u5e38&#xff0c;\u540e\u4e00\u5206\u949f\u5c31\u96c6\u4f53\u8d85\u65f6\u3002\u65e5\u5fd7\u91cc\u53cd\u590d\u51fa\u73b0\u540c\u4e00\u53e5\u8bdd&#xff1a; Connection is not available, request timed out after 30000ms 1. \u8fde\u63a5\u6c60\u4e0d\u662f\u4e00\u4e2a\u65e0\u9650\u5f00\u5173<br \/>\n\u5e94\u7528\u6bcf\u6b21\u8bbf\u95ee\u6570\u636e\u5e93&#xff0c;\u90fd\u8981\u5148\u4ece\u8fde\u63a5\u6c60\u62ff\u4e00\u4e2a\u8fde\u63a5\u3002\u62ff\u5230\u8fde\u63a5\u540e&#xff0c;\u5e94\u7528\u6267\u884c SQL&#xff0c;\u518d\u628a\u8fde\u63a5\u5f52\u8fd8\u3002\u5982\u679c\u5f52\u8fd8\u4e4b\u524d\u53d1\u751f\u4e86\u95ee\u9898&amp;#xff<\/p>\n","protected":false},"author":2,"featured_media":117384,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[100],"topic":[],"class_list":["post-117385","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-server","tag-100"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>HikariCP \u8fde\u63a5\u6c60\u8017\u5c3d - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.wsisp.com\/helps\/117385.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"HikariCP \u8fde\u63a5\u6c60\u8017\u5c3d - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"HikariCP \u8fde\u63a5\u6c60\u8017\u5c3d&#xff1a;\u63a5\u53e3\u4e3a\u4ec0\u4e48\u7a81\u7136\u5168\u90e8\u8d85\u65f6 \u524d\u4e00\u5206\u949f\u63a5\u53e3\u8fd8\u6b63\u5e38&#xff0c;\u540e\u4e00\u5206\u949f\u5c31\u96c6\u4f53\u8d85\u65f6\u3002\u65e5\u5fd7\u91cc\u53cd\u590d\u51fa\u73b0\u540c\u4e00\u53e5\u8bdd&#xff1a; Connection is not available, request timed out after 30000ms 1. \u8fde\u63a5\u6c60\u4e0d\u662f\u4e00\u4e2a\u65e0\u9650\u5f00\u5173 \u5e94\u7528\u6bcf\u6b21\u8bbf\u95ee\u6570\u636e\u5e93&#xff0c;\u90fd\u8981\u5148\u4ece\u8fde\u63a5\u6c60\u62ff\u4e00\u4e2a\u8fde\u63a5\u3002\u62ff\u5230\u8fde\u63a5\u540e&#xff0c;\u5e94\u7528\u6267\u884c SQL&#xff0c;\u518d\u628a\u8fde\u63a5\u5f52\u8fd8\u3002\u5982\u679c\u5f52\u8fd8\u4e4b\u524d\u53d1\u751f\u4e86\u95ee\u9898&amp;#xff\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/117385.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2026-10-24T10:57:11+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/10\/20261024105709-6adc8f0590a62.png\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/117385.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/117385.html\",\"name\":\"HikariCP \u8fde\u63a5\u6c60\u8017\u5c3d - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2026-10-24T10:57:11+00:00\",\"dateModified\":\"2026-10-24T10:57:11+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/117385.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/117385.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/117385.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"HikariCP \u8fde\u63a5\u6c60\u8017\u5c3d\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\",\"url\":\"https:\/\/www.wsisp.com\/helps\/\",\"name\":\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"description\":\"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"contentUrl\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"caption\":\"admin\"},\"sameAs\":[\"http:\/\/wp.wsisp.com\"],\"url\":\"https:\/\/www.wsisp.com\/helps\/author\/admin\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"HikariCP \u8fde\u63a5\u6c60\u8017\u5c3d - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.wsisp.com\/helps\/117385.html","og_locale":"zh_CN","og_type":"article","og_title":"HikariCP \u8fde\u63a5\u6c60\u8017\u5c3d - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"HikariCP \u8fde\u63a5\u6c60\u8017\u5c3d&#xff1a;\u63a5\u53e3\u4e3a\u4ec0\u4e48\u7a81\u7136\u5168\u90e8\u8d85\u65f6 \u524d\u4e00\u5206\u949f\u63a5\u53e3\u8fd8\u6b63\u5e38&#xff0c;\u540e\u4e00\u5206\u949f\u5c31\u96c6\u4f53\u8d85\u65f6\u3002\u65e5\u5fd7\u91cc\u53cd\u590d\u51fa\u73b0\u540c\u4e00\u53e5\u8bdd&#xff1a; Connection is not available, request timed out after 30000ms 1. \u8fde\u63a5\u6c60\u4e0d\u662f\u4e00\u4e2a\u65e0\u9650\u5f00\u5173 \u5e94\u7528\u6bcf\u6b21\u8bbf\u95ee\u6570\u636e\u5e93&#xff0c;\u90fd\u8981\u5148\u4ece\u8fde\u63a5\u6c60\u62ff\u4e00\u4e2a\u8fde\u63a5\u3002\u62ff\u5230\u8fde\u63a5\u540e&#xff0c;\u5e94\u7528\u6267\u884c SQL&#xff0c;\u518d\u628a\u8fde\u63a5\u5f52\u8fd8\u3002\u5982\u679c\u5f52\u8fd8\u4e4b\u524d\u53d1\u751f\u4e86\u95ee\u9898&amp;#xff","og_url":"https:\/\/www.wsisp.com\/helps\/117385.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2026-10-24T10:57:11+00:00","og_image":[{"url":"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/10\/20261024105709-6adc8f0590a62.png"}],"author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"2 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/117385.html","url":"https:\/\/www.wsisp.com\/helps\/117385.html","name":"HikariCP \u8fde\u63a5\u6c60\u8017\u5c3d - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2026-10-24T10:57:11+00:00","dateModified":"2026-10-24T10:57:11+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/117385.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/117385.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/117385.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"HikariCP \u8fde\u63a5\u6c60\u8017\u5c3d"}]},{"@type":"WebSite","@id":"https:\/\/www.wsisp.com\/helps\/#website","url":"https:\/\/www.wsisp.com\/helps\/","name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","description":"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41","name":"admin","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/","url":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","contentUrl":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","caption":"admin"},"sameAs":["http:\/\/wp.wsisp.com"],"url":"https:\/\/www.wsisp.com\/helps\/author\/admin"}]}},"_links":{"self":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/117385","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/comments?post=117385"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/117385\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media\/117384"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=117385"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=117385"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=117385"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=117385"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}