You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
framework/db: use HikariCP as default and improvements (apache#9518)
Per docs, if the mysql connector is JDBC2 compliant then it should use
the Connection.isValid API to test a connection.
(https://docs.oracle.com/javase/8/docs/api/java/sql/Connection.html#isValid-int-)
This would significantly reduce query lags and API throughput, as for
every SQL query one or two SELECT 1 are performed everytime a Connection
is given to application logic.
This should only be accepted when the driver is JDBC4 complaint.
As per the docs, the connector-j can use /* ping */ before calling
SELECT 1 to have light weight application pings to the server:
https://dev.mysql.com/doc/connector-j/en/connector-j-usagenotes-j2ee-concepts-connection-pooling.html
Replaces dbcp2 connection pool library with more performant HikariCP.
With this unit tests are failing but build is passing.
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
Co-authored-by: Rohit Yadav <rohityadav89@gmail.com>
Copy file name to clipboardExpand all lines: client/conf/db.properties.in
+16-4Lines changed: 16 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -34,10 +34,14 @@ db.cloud.uri=
34
34
35
35
36
36
# CloudStack database tuning parameters
37
+
db.cloud.connectionPoolLib=hikaricp
37
38
db.cloud.maxActive=250
38
39
db.cloud.maxIdle=30
39
-
db.cloud.maxWait=10000
40
-
db.cloud.validationQuery=SELECT 1
40
+
db.cloud.maxWait=600000
41
+
db.cloud.minIdleConnections=5
42
+
db.cloud.connectionTimeout=30000
43
+
db.cloud.keepAliveTime=600000
44
+
db.cloud.validationQuery=/* ping */ SELECT 1
41
45
db.cloud.testOnBorrow=true
42
46
db.cloud.testWhileIdle=true
43
47
db.cloud.timeBetweenEvictionRunsMillis=40000
@@ -70,9 +74,13 @@ db.usage.uri=
70
74
71
75
72
76
# usage database tuning parameters
77
+
db.usage.connectionPoolLib=hikaricp
73
78
db.usage.maxActive=100
74
79
db.usage.maxIdle=30
75
-
db.usage.maxWait=10000
80
+
db.usage.maxWait=600000
81
+
db.usage.minIdleConnections=5
82
+
db.usage.connectionTimeout=30000
83
+
db.usage.keepAliveTime=600000
76
84
db.usage.url.params=serverTimezone=UTC
77
85
78
86
# Simulator database settings
@@ -82,9 +90,13 @@ db.simulator.host=@DBHOST@
82
90
db.simulator.driver=@DBDRIVER@
83
91
db.simulator.port=3306
84
92
db.simulator.name=simulator
93
+
db.simulator.connectionPoolLib=hikaricp
85
94
db.simulator.maxActive=250
86
95
db.simulator.maxIdle=30
87
-
db.simulator.maxWait=10000
96
+
db.simulator.maxWait=600000
97
+
db.simulator.minIdleConnections=5
98
+
db.simulator.connectionTimeout=30000
99
+
db.simulator.keepAliveTime=600000
88
100
db.simulator.autoReconnect=true
89
101
90
102
# Connection URI to the database "simulator". When this property is set, only the following properties will be used along with it: db.simulator.host, db.simulator.port, db.simulator.name, db.simulator.autoReconnect. Other properties will be ignored.
0 commit comments