File tree Expand file tree Collapse file tree 3 files changed +23
-15
lines changed
Clojure/ring-http-exchange/src/ring_http_exchange Expand file tree Collapse file tree 3 files changed +23
-15
lines changed Original file line number Diff line number Diff line change 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
Original file line number Diff line number Diff line change 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 >
Original file line number Diff line number Diff 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+ }
You can’t perform that action at this time.
0 commit comments