Problem : slowness observed during first 1 sec only and the remaining 59 have a constant response time which 90% better than the max response time.
Server Env details: spring boot webflux with r2dbc pool deployed in ECS fargate and connecting to Postgres Aurora cluster. pool settings - maxSize,initialSize is 200 Using spring data r2dbc and enabled proxy listener for debugging.
Client : A gatling script with a very minimal load of 200,250,300,500 users with a ramp time of 50 sec is configured in AWS EC2 in same VPC.
Scenario
- ECS server started.
- wait for 4 min.
- did a dry run of 5 requests using postman.
- trigger load using gatling
- Shutdown the ECS.
- repeat the steps with a different number of users.
The behaviour is consistent with different users. Always the first 1 min has the slowest responses and having the max response time. Subsequent runs without server restart has a good performance without any delays.
Total|OK |KO|Cnt/s|Min|50th pct|75th pct|95th pct|99th pct|Max |Mean |Std Dev|
500 |500 |0 |9.804|94 |184 |397 |1785 |2652 | 2912 | 417 | 556 |
And also observed in the logs the time difference between these two immediate lines logged is 168ms for the request with max response time. -- Executing query: BEGIN -- io.r2dbc.spi.Connection.beginTransaction callback at ConnectionFactory#create()
Any suggestion how to approach/fix the issue?
Thanks.