Reputation: 1124
I've configured max pool size as 10 in my Spring boot 2.0 application(I'm using Hikari connection pool). I'm testing my REST API using JMeter. I am trying to simulate 500 concurrent users(Thread Group - > Thread Properties -> Number of Threads (user):500). I expect the test to fail after 20th request but my JMeter test is working perfectly.
spring.datasource.hikari.minimumIdle: 10
spring.datasource.hikari.maximumPoolSize: 10
spring.datasource.hikari.connectionTimeout: 30000
spring.datasource.hikari.idleTimeout: 600000
spring.datasource.hikari.maxLifetime: 1800000
spring.datasource.hikari.connectionInitSql: SELECT 1 FROM DUAL
pom.xml
<dependency>
<groupId>com.oracle.jdbc</groupId>
<artifactId>ojdbc7</artifactId>
<version>12.1.0.2</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-jdbc</artifactId>
</dependency>
Upvotes: 0
Views: 3598
Reputation: 58862
Number of concurrent users is the potentially number of requests hitting the server at the same time. Notice it can be on about page (static page) and therefore won't reach/effect the database at all.
Even when request reach the database, then if the pool has reached max active connection, the pool is waiting for a connection, in your case, up to 30 seconds which is alot in term of realtime db transaction.
How to setup datasource is complex, but in general your setting is correct, you are just comparing different metrics.
Upvotes: 1