Skip to content

Commit c482aa4

Browse files
author
jj
committed
Update Hikari CP settings in httpserver and ring-http-exchange
1 parent edfa3f7 commit c482aa4

File tree

3 files changed

+23
-15
lines changed

3 files changed

+23
-15
lines changed

frameworks/Clojure/ring-http-exchange/src/ring_http_exchange/benchmark.clj

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,13 @@
1515
(def query-fortunes (boa/execute (boa/->NextJdbcAdapter) "fortune.sql"))
1616

1717
(def db-spec {:auto-commit true
18-
:read-only false
19-
:connection-timeout 30000
18+
:read-only true
19+
:connection-timeout 10000
2020
:validation-timeout 5000
2121
:idle-timeout 600000
2222
:max-lifetime 1800000
23-
:minimum-idle 10
24-
:maximum-pool-size 520
25-
:minimum-pool-size 512
23+
:minimum-idle 16
24+
:maximum-pool-size 64
2625
:register-mbeans false
2726
:jdbcUrl "jdbc:postgresql://tfb-database/hello_world?user=benchmarkdbuser&password=benchmarkdbpass"})
2827

frameworks/Java/httpserver/pom.xml

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -30,23 +30,21 @@
3030
<artifactId>postgresql</artifactId>
3131
<version>42.7.2</version>
3232
</dependency>
33-
<dependency>
34-
<groupId>com.zaxxer</groupId>
35-
<artifactId>HikariCP</artifactId>
36-
<version>3.3.1</version>
37-
</dependency>
38-
3933
<dependency>
4034
<groupId>com.github.httl</groupId>
4135
<artifactId>httl</artifactId>
4236
<version>1.0.11</version>
4337
</dependency>
44-
4538
<dependency>
4639
<groupId>org.slf4j</groupId>
4740
<artifactId>slf4j-simple</artifactId>
4841
<version>1.8.0-beta4</version>
4942
</dependency>
43+
<dependency>
44+
<groupId>com.zaxxer</groupId>
45+
<artifactId>HikariCP</artifactId>
46+
<version>7.0.2</version>
47+
</dependency>
5048
</dependencies>
5149
<profiles>
5250
<profile>

frameworks/Java/httpserver/src/main/java/benchmarks/Server.java

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,12 +52,23 @@ private static List<Fortune> queryFortunes(DataSource ds) throws SQLException {
5252
}
5353

5454
private static DataSource createPostgresDataSource() throws ClassNotFoundException {
55-
Class.forName("org.postgresql.Driver");
5655
HikariConfig config = new HikariConfig();
56+
5757
config.setJdbcUrl("jdbc:postgresql://tfb-database:5432/hello_world");
5858
config.setUsername("benchmarkdbuser");
5959
config.setPassword("benchmarkdbpass");
60-
config.setMaximumPoolSize(512);
60+
61+
config.setMaximumPoolSize(64);
62+
config.setMinimumIdle(16);
63+
64+
config.setConnectionTimeout(10000);
65+
config.setIdleTimeout(600000);
66+
config.setMaxLifetime(1800000);
67+
68+
config.setAutoCommit(true);
69+
70+
config.setPoolName("PostgreSQL-HikariCP-Pool");
71+
6172
return new HikariDataSource(config);
6273
}
6374

@@ -145,4 +156,4 @@ static void main(String[] args) throws Exception {
145156
// start server
146157
server.start();
147158
}
148-
}
159+
}

0 commit comments

Comments
 (0)