0

I am using SpringBoot application with PostgreSQL as database, I am doing Load Testing from Jmeter, Database is hosted in azure, when I try to hit 150 Rest request to Single API or endpoint parallelly/concurrently, I am getting below error but with 100 request it works successfully.

ERROR:

2022-12-21 17:29:43.000  WARN 1 --- [http-nio-8080-exec-60] o.h.engine.jdbc.spi.SqlExceptionHelper   : SQL Error: 0, SQLState: 08P01
2022-12-21 17:29:43.000 ERROR 1 --- [http-nio-8080-exec-60] o.h.engine.jdbc.spi.SqlExceptionHelper   : FATAL: query_wait_timeout
2022-12-21 17:29:43.000  WARN 1 --- [http-nio-8080-exec-60] o.h.engine.jdbc.spi.SqlExceptionHelper   : SQL Error: 0, SQLState: 08006
2022-12-21 17:29:43.001 ERROR 1 --- [http-nio-8080-exec-60] o.h.engine.jdbc.spi.SqlExceptionHelper   : An I/O error occurred while sending to the backend.
2022-12-21 17:29:43.090  WARN 1 --- [http-nio-8080-exec-61] o.h.engine.jdbc.spi.SqlExceptionHelper   : SQL Error: 0, SQLState: 08P01
2022-12-21 17:29:43.090 ERROR 1 --- [http-nio-8080-exec-61] o.h.engine.jdbc.spi.SqlExceptionHelper   : FATAL: query_wait_timeout

I want to improve the performance of the application in short solve the above error when we auto-scale our application with two instances, 150 request are passed but when we run with a single instance, it gives the above error, I want to understand

  1. whether it is a memory issue or a db issue?
  2. How to resolve it ?`
Albina
  • 1,901
  • 3
  • 7
  • 19

1 Answers1

0

As per documentation:

query_wait_timeout

Maximum time queries are allowed to spend waiting for execution. If the query is not assigned to a server during that time, the client is disconnected. 0 disables. If this is disabled, clients will be queued indefinitely. [seconds]

This setting is used to prevent unresponsive servers from grabbing up connections. It also helps when the server is down or rejects connections for any reason.

Default: 120

Most probably all the connections in the PostgreSQL connection pool are busy and your application fails to obtain one within the bounds of pre-defined timeout of 2 minutes.

The options are in:

  1. Increase connection pool size
  2. Increase the aforementioned timeout
  3. Check Postgresql slow queries logs and execution plans for these queries
  4. Test the database in isolation using JDBC Request sampler
  5. Use a profiler tool like JProfiler or YourKit to see whether the long processing is somewhere in your application source code.
Dmitri T
  • 159,985
  • 5
  • 83
  • 133