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??
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().
cx_oracle + threadpool first insert call function slow