I have a problem, I use the cx_oracle + aiohttp + threadpollexecutor bundle to call a function in the database that checks parameters and insert data into Oracle tables. I noticed a strange feature: the very first request after midnight runs for more than 17 seconds, but all subsequent requests run for 20 milliseconds. The connection pool is not broken and is used as a global variable via a function. What could be the problem and why only the first request behaves like this??
Asked
Active
Viewed 89 times
1 Answers
0
Christopher Jones gave you a suggestion. The easiest way to find out for sure is to set the environment variable DPI_DEBUG_LEVEL
to the value 4 prior to running your application and redirecting stderr to a log file. Then you can see which ODPI-C function was run immediately after midnight and how long it took. If Chris' suggestion is correct, the likely call will be dpiConn_create()
.

Anthony Tuininga
- 6,388
- 2
- 14
- 23
-
-
And a small question - is there a way to deal with this? What is the best way to recreate the connection pool so as not to slow down the app? – RKG Sep 22 '20 at 09:07
-
@ChristopherJones dpiStmt_execute() so long (first call function with inserts after night): 8 seconds, it's not dpiConn_create() – RKG Sep 22 '20 at 21:08