OJS hanging forever and then time out

Hello

we have an OJS installation to manage a journal (https://jgaa.info). It worked well for long time (more than a year). Suddenly it started having problems. When we try to access the website it starts loading the page but it remains hanging forever and in the end a time out message appears. Looking at the logs and at the DB, it seems that there are many connections to the DB that remain idle and in the end the maximum number of connections is reached. If I kill the connections in the DB and restart apache, then the website works for some minutes but then the problem appears again (although this is not always the case). We suspect that there is some problem in the interaction between OJS and the DB (postgresql 13.14) but we do not have any cue.

Any advice on how to further investigate is welcome.

The version we are usign is OJS 3.3.0-18

Thanks
Emilio