bonecp数据源的使用
程序员文章站
2024-04-06 15:44:31
...
bonecp.properties jdbc.driverClass=oracle.jdbc.driver.OracleDriverjdbc.jdbcUrl=jdbc:oracle:thin:@192.168.30.4:1521:testjdbc.username=testjdbc.password=test#Sets the minimum number of connections that will be contained in every partition. bo
bonecp.propertiesjdbc.driverClass=oracle.jdbc.driver.OracleDriver jdbc.jdbcUrl=jdbc:oracle:thin:@192.168.30.4:1521:test jdbc.username=test jdbc.password=test #Sets the minimum number of connections that will be contained in every partition. bonecp.minConnectionsPerPartition=1 #Sets the maximum number of connections that will be contained in every partition. #Setting this to 5 with 3 partitions means you will have 15 unique #connections to the database. Note that the connection pool will not create all #these connections in one go but rather start off with minConnectionsPerPartition and gradually #increase connections as required. bonecp.maxConnectionsPerPartition=5 #Sets the acquireIncrement property. When the available connections are about to run #out, BoneCP will dynamically create new ones in batches. This property controls how #many new connections to create in one go (up to a maximum of #maxConnectionsPerPartition). Note: This is a per partition setting. bonecp.acquireIncrement=1 #Sets number of partitions to use. In order to reduce lock contention #and thus improve performance, each incoming connection request picks off a connection from #a pool that has thread-affinity, i.e. pool[threadId % partition_count]. The higher this number, #the better your performance will be for the case when you have plenty #of short-lived threads. Beyond a certain threshold, maintenance of these pools will start #to have a negative effect on performance (and only for the case when #connections on a partition start running out). Default: 1, minimum: 1, recommended: #2-4 (but very app specific) bonecp.partitionCount=1 #Sets the idleConnectionTestPeriod. This sets the time (in minutes), for a connection #to remain idle before sending a test query to the DB. This is #useful to prevent a DB from timing out connections on its end. Do #not use aggressive values here! Default: 240 min, set to 0 #to disable bonecp.idleConnectionTestPeriodInMinutes=240 #Sets the idleConnectionTestPeriod. This sets the time (in seconds), for a connection #to remain idle before sending a test query to the DB. This is #useful to prevent a DB from timing out connections on its end. Do #not use aggressive values here! Default: 240 min, set to 0 #to disable bonecp.idleConnectionTestPeriodInSeconds=14400 #Sets Idle max age (in min). The time (in minutes), for a #connection to remain unused before it is closed off. Do not use aggressive #values here! Default: 60 minutes, set to 0 to disable. bonecp.idleMaxAgeInMinutes=60 #Sets Idle max age (in seconds). The time (in seconds), for a #connection to remain unused before it is closed off. Do not use aggressive #values here! Default: 60 minutes, set to 0 to disable. bonecp.idleMaxAgeInSeconds=3600 #Sets statementsCacheSize setting. The number of statements to cache. bonecp.statementsCacheSize=0 #Sets number of helper threads to create that will handle releasing a connection. #When this value is set to zero, the application thread is blocked #until the pool is able to perform all the necessary cleanup to recycle #the connection and make it available for another thread. When a non-zero #value is set, the pool will create threads that will take care of #recycling a connection when it is closed (the application dumps the connection into #a temporary queue to be processed asychronously to the application via the release #helper threads). Useful when your application is doing lots of work on #each connection (i.e. perform an SQL query, do lots of non-DB stuff and #perform another query), otherwise will probably slow things down. bonecp.releaseHelperThreads=3 #Instruct the pool to create a helper thread to watch over connection acquires #that are never released (or released twice). This is for debugging purposes only #and will create a new thread for each call to getConnection(). Enabling this #option will have a big negative impact on pool performance. bonecp.closeConnectionWatch=false #If enabled, log SQL statements being executed. bonecp.logStatementsEnabled=false #Sets the number of ms to wait before attempting to obtain a connection #again after a failure. bonecp.acquireRetryDelayInMs=7000 #Set to true to force the connection pool to obtain the initial connections #lazily. bonecp.lazyInit=false #Set to true to enable recording of all transaction activity and replay the #transaction automatically in case of a connection failure. bonecp.transactionRecoveryEnabled=false #After attempting to acquire a connection and failing, try to connect these many #times before giving up. Default 5. bonecp.acquireRetryAttempts=5 #Set to true to disable JMX. bonecp.disableJMX=false #Queries taking longer than this limit to execute are logged. bonecp.queryExecuteTimeLimitInMs=0 #Sets the Pool Watch thread threshold. The pool watch thread attempts to #maintain a number of connections always available (between minConnections and maxConnections). This value #sets the percentage value to maintain. For example, setting it to 20 means #that if the following condition holds: Free Connections / MaxConnectionsapplicationContenxt.xml
classpath:cn/com/config/dataSource/bonecp.properties
上一篇: 最省空间的计数器
下一篇: PHPCrawl爬虫库抓取酷狗歌单
推荐阅读
-
bonecp数据源的使用
-
apache - 在嵌入式设备中使用php,php-fpm占用很高的CPU
-
ThinkPHP上使用多说评论插件的方法_PHP
-
yii2使用ajax返回json的实现方法,yii2ajax返回json_PHP教程
-
ThinkPHP学习札记(七)实例化中create方法的作用,以及令牌的使用
-
php文章中图片处理的使用_PHP教程
-
thinkPHP使用pclzip打包备份mysql数据库的方法,thinkphppclzip
-
php socket使用smtp发送带附件的邮件
-
PHP静态变量static的使用介绍
-
PHP:使用PHPExcel完成电子表格文件的导出下载和导入操作_PHP教程