Wie erhöhe ich die maxPoolSize in Grails, wenn ich mysql benutze? Es scheint, einen Standardverbindungspool nur 8 Verbindungen zu verwenden.Grails MySQL MaxPoolSize
5
A
Antwort
6
Leider müssen Sie die dataSource spring Bean für sich selbst konfigurieren, wenn Sie mehr Kontrolle darüber haben möchten. Dies kann durch die Definition der Bohne in "Grails-app/conf/Frühjahr/resources.groovy"
beans = {
dataSource(org.apache.commons.dbcp.BasicDataSource) {
driverClassName = "com.mysql.jdbc.Driver"
username = "someuser"
password = "s3cret"
initialSize = 15
maxActive = 50
maxIdle = 15
}
}
Es überschreibt den Standard Grails Datasource durchgeführt werden, die in „Grails-app/conf/DataSource.groovy konfiguriert ist, ".
Wahrscheinlich sollte es auch DataSource.groovy Konfiguration wie dies die PropertyOverrideConfigurer der Nutzung der Pool-Größe Eigenschaften des Standard grails außer Kraft arbeiten, um (in Config.groovy):
beans = {
dataSource.initialSize = 15
dataSource.maxActive = 50
dataSource.maxIdle = 15
}
3
Für Grails 1.2 Sie sollte ein etwas anderes Format verwenden:
dataSource {
pooled = true
dbCreate = "update"
url = "jdbc:mysql://localhost/yourDB"
driverClassName = "com.mysql.jdbc.Driver"
username = "yourUser"
password = "yourPassword"
properties {
maxActive = 50
maxIdle = 25
minIdle = 5
initialSize = 5
minEvictableIdleTimeMillis = 60000
timeBetweenEvictionRunsMillis = 60000
maxWait = 10000
}
}
Verwandte Themen
- 1. Grails MySql processList
- 2. Grails 3.1.0 mit MySQL einrichten
- 3. Grails 2.4.3 & MySQL & grails.project.fork = false
- 4. Führen Sie MySQL-Skript in Grails App
- 5. Grails GORM und MYSQL Kaskade löschen Problem
- 6. Grails 2.3.0 und MySQL-Verbindung Timeout
- 7. Grails: Unternehmen Grails
- 8. Grails durchsuchbar
- 9. Liquibase Grails Datenbank Migrationen
- 10. Grails: Alternativen zu Grails Doc?
- 11. Russische Zeichen werden als ???? in mysql in Grails-Anwendung
- 12. Grails DataSource für Remote-MYSQL-Datenbankzugriff und Migrationen
- 13. Grails GORM MySQL erzeugen TEXT oder LONGTEXT Spalte
- 14. Grails Cloud-Hosting-Empfehlung
- 15. Design an Grails anpassen
- 16. Grails codenarc Plugin für Grails 1.3.9
- 17. Grails GGTS IDE GrailsProcessDiedException: Grails Prozess starb
- 18. Grails Database Migration Plugin Probleme
- 19. Grails Kontrollkästchen
- 20. Grails Integrationstestfilter
- 21. Grails Sicherheit
- 22. Grails Fehler
- 23. grails Standardeinschränkungen
- 24. Grails IncompatibleClassChangeError
- 25. Grails + ClojureScript
- 26. Grails-Webfluss
- 27. Grails Installation
- 28. Grails Datenbankverbindung Pooling - Belastungstest
- 29. Grails Filter-Syntax, oder, wie Sie einen Grails-Filter außerhalb Grails
- 30. Was ist die neueste URL von Grails Repo? (Repo.grails.org/grails/repo vs repo.grails.org/grails/plugins)