maxActive、maxIdle 建议设置 maxActive="300" maxIdle="50"
maxActive 设置在300-1000之间
maxIdle 设置在 20-100 之间
还有就是在程序的 finally 里面要关闭 Connection
例如: DbHelper.closedAll(rs, ps, conn);<wbr></wbr>
maxIdle,最大空闲数,数据库连接的最大空闲时间。超过空闲时间,数据库连
接将被标记为不可用,然后被释放。设为0表示无限制。
MaxActive,连接池的最大数据库连接数。设为0表示无限制。
maxWait ,最大建立连接等待时间。如果超过此时间将接到异常。设为-1表示
无限制。
*maxActive:最大连接数据库连接数,设 0 为没有限制
*maxIdle:最大等待连接中的数量,设 0 为没有限制
*maxWait:最大等待毫秒数, 单位为 ms, 超过时间会出错误信息
一般把maxActive设置成可能的并发量就行了
maxActive、maxIdle和maxWait参数:
maxActive是最大激活连接数,这里取值为20,表示同时最多有20个数据库连
接。maxIdle是最大的空闲连接数,这里取值为20,表示即使没有数据库连接时依然可以保持20空闲的
连接,而不被清除,随时处于待命状态。MaxWait是最大等待秒钟数,这里取值-1,表示无限等待,直到
超时为止
来源本人博客:http://yijianfengvip.blog.163.com/blog/static/175273432201201222133793/
<wbr></wbr>
分享到:
相关推荐
dbcp 连接池不合理的锁导致连接耗尽解决方案 ... nested exception is org.apache.commons.dbcp.SQLNestedException: Cannot get a connection, pool exhausted at org.springframework.jdbc.dataso
主要介绍了阿里dubbo出错提示Thread pool is EXHAUSTED的问题及解决方法,本文给大家介绍的非常详细,对大家的学习或工作具有一定的参考借鉴价值,需要的朋友可以参考下
使用spring + atomikos+druid配置的分布式事务demo,两种数据源配置方式都可以,使用junit测试没问题,案例中使用的mysql数据库是8.0.11版本,版本不同请自行修改pom.xml和jdbc.properties
o POOL-152: GenericObjectPool can block forever in borrowObject when the pool is exhausted and a newly created object fails validation. When borrowing an object if a new object is created but ...
php解决Allowed memory size of bytes exhausted
编译时virtual memory exhausted Cannot allocate memory 内存增加.docx
今天在百度知道看php相关资料时发现一个网友问一个...下面我把自己整理的出错原因和解决办法给phper分享一下,希望有所帮助。 出错原因: 因为php页面消耗的最大内存默认是为8M (在PHP的php.ini配置文件里可以看到) ,如
php Allowed memory size of 134217728 bytes exhausted
如果你的ThinkPHP提示你:致命错误(Fatal error: Allowed memory size),根据网上说的提高服务器可使用内存,我觉得都不是好的解决办法。麻烦也没必要。因为这是ThinkPHP本身存在BUG。 错误提示:Fatal error: ...
connection pool exhausted connection refuse by peer 一个个来分析。 LOADING Redis is loading the dataset in memory 这里至少有2种可能 可用内存太小,修改 redis.conf 中的 maxmemory 即可解决 redis 在...
S7A驱动,7.20版本, Version history S7A OPC server and FIX driver for Siemens S7/S5 communication via Ethernet TCP/IP, MPI or Profibus Version 7.20 Date: 26.02.2007 ...
虚拟内存不足方案虚拟内存不足方案虚拟内存不足方案虚拟内存不足方案虚拟内存不足方案虚拟内存不足方案虚拟内存不足方案
主要介绍了Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 2611816 bytes)错误的解决方法,需要的朋友可以参考下
Websphere Application Server WAS 内存溢出分析,帮助分析内存问题
Allowed memory size of 134217728 bytes exhausted错误,这种问题一个是程序写得不好导致的,另一个是环境配置不好也会出现,像php5.1.27+apache2.2.3好像在windows2003中就会出现bug不管你怎么修复都无法解决Fatal ...
and larger, everyone suffers when disk space is exhausted. With POP, saved messages get offloaded from the mail server. MIME MIME stands for Multipurpose Internet Mail Extensions. It is not a ...
大家在使用Android Studio导入AOSP源码的时候,可能会遇到inotify大小不足的问题,这篇文章就给大家介绍了怎么解决这个问题的方法,有需要的朋友们可以参考借鉴。
向可用内存池(pool)中返回部分内存,以使其可以由程序的其他部分或者其他程序使用。 实现这些需求的程序库称为 分配程序(allocators),因为它们负责分配和回收内存。程序的动态性越强,内存管理就越重要,您的...