How do I increase the maxPoolSize in Grails when using mysql? It appears to be using a default connection pool only 8 connections.
Unfortunately you will need to configure the dataSource spring bean for yourself if you want to gain more control over it. This can be done by defining the bean in "grails-app/conf/spring/resources.groovy"
beans = {
dataSource(org.apache.commons.dbcp.BasicDataSource) {
driverClassName = "com.mysql.jdbc.Driver"
username = "someuser"
password = "s3cret"
initialSize = 15
maxActive = 50
maxIdle = 15
}
}
It will override the default Grails DataSource which is configured in "grails-app/conf/DataSource.groovy".
Probably it should also work to override the pool-size properties of the default grails DataSource.groovy configuration like this leveraging the PropertyOverrideConfigurer (in Config.groovy):
beans = {
dataSource.initialSize = 15
dataSource.maxActive = 50
dataSource.maxIdle = 15
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With