Skip to content

Commit 6e8b853

Browse files
author
jj
committed
Change executor and hikaricp settings for httpserver
1 parent edfa3f7 commit 6e8b853

File tree

2 files changed

+19
-9
lines changed

2 files changed

+19
-9
lines changed

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 & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,22 @@ private static List<Fortune> queryFortunes(DataSource ds) throws SQLException {
5454
private static DataSource createPostgresDataSource() throws ClassNotFoundException {
5555
Class.forName("org.postgresql.Driver");
5656
HikariConfig config = new HikariConfig();
57+
5758
config.setJdbcUrl("jdbc:postgresql://tfb-database:5432/hello_world");
5859
config.setUsername("benchmarkdbuser");
5960
config.setPassword("benchmarkdbpass");
60-
config.setMaximumPoolSize(512);
61+
62+
config.setMaximumPoolSize(520);
63+
config.setMinimumIdle(512);
64+
65+
config.setConnectionTimeout(30000);
66+
config.setIdleTimeout(600000);
67+
config.setMaxLifetime(1800000);
68+
69+
config.setAutoCommit(true);
70+
71+
config.setPoolName("PostgreSQL-HikariCP-Pool");
72+
6173
return new HikariDataSource(config);
6274
}
6375

@@ -145,4 +157,4 @@ static void main(String[] args) throws Exception {
145157
// start server
146158
server.start();
147159
}
148-
}
160+
}

0 commit comments

Comments
 (0)