In my efforts to speed up the web user interface of my (2 years old) nextcloud installation I found my postgresql database may be an issue (no numbers, just a feeling). The logs of this database server showed me that for just visiting the Nextcloud Talk page of my instance, about 50 lines of logs are produced, mainly consisting of snippets like the following:
2023-01-04 09:49:08.288 UTC [273171] [unknown]@[unknown] LOG: connection received: host=192.168.x.x port=32804
2023-01-04 09:49:08.291 UTC [273171] nextcloud@nextclouddb LOG: connection authorized: user=nextcloud database=nextclouddb SSL enabled (protocol=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384, bits=256, compression=off)
2023-01-04 09:49:08.316 UTC [273171] nextcloud@nextclouddb LOG: disconnection: session time: 0:00:00.028 user=nextcloud database=nextclouddb host=192.168.x.x port=32804
So my question for the nextcloud side is:
- Is this intentional? Seems like very short-lived connections to me, this may be an issue (?)
- Is there nextcloud configuration potential to reduce the amount of connection creations?
- If not, should one use connection poolers like PGbounce or similar? What are larger-scale installations or well-performing setups doing about this?