There’s a few threads on persistent database connections on Nextcloud, but all are closed. I’m running vanilla Nextcloud 33 as shipped with Fedora, with a Redis server for caching, and a MySQL database, all on the same host.
I’ve verified via PHPINFO that MySQL has persistent connections enabled as per mysqli configuration (although that doesn’t seem to matter since pdo_mysql has no setting for such a thing and neither does pdo_mysql which appears to be using mysqlnd).
config.php in fact has dbpersistent set to true.
And yet, PHPINFO does not show me any open connections, and neither does my server when I look at netstat -tnp output (there ought to be some open connections after refreshing a few Nextcloud pages).
What should I look into, in order to enable persistent connections? Thanks in advance.
The Basics
- Nextcloud Server version (e.g., 29.x.x):
33.0.6
- Operating system and version (e.g., Ubuntu 24.04):
Fedora 43
- Web server and version (e.g, Apache 2.4.25):
Apache / PHP-FPM
- Reverse proxy and version _(e.g. nginx 1.27.2)
not relevant
- PHP version (e.g, 8.3):
PHP 8.4.3
- Is this the first time you’ve seen this error? (Yes / No):
not an error
- When did this problem seem to first start?
forever
- Installation method (e.g. AlO, NCP, Bare Metal/Archive, etc.)
Fedora RPMs
- Are you using CloudfIare, mod_security, or similar? (Yes / No)
no
Log entries
There are no relevant log entries.
Configuration
Nextcloud
The output of occ config:list system or similar is best, but, if not possible, the contents of your config.php file from /path/to/nextcloud is fine (make sure to remove any identifiable information!):
{
"system": {
"log_type": "file",
"log_type_audit": "file",
"datadirectory": "***REMOVED SENSITIVE VALUE***",
"updatechecker": false,
"check_for_working_htaccess": false,
"asset-pipeline.enabled": false,
"assetdirectory": "\/var\/lib\/nextcloud",
"preview_libreoffice_path": "\/usr\/bin\/libreoffice",
"apps_paths": [
{
"path": "\/usr\/share\/nextcloud\/apps",
"url": "\/apps",
"writable": false
},
{
"path": "\/var\/lib\/nextcloud\/apps",
"url": "\/apps-appstore",
"writable": true
}
],
"passwordsalt": "***REMOVED SENSITIVE VALUE***",
"secret": "***REMOVED SENSITIVE VALUE***",
"dbtype": "mysql",
"version": "33.0.6.2",
"dbname": "***REMOVED SENSITIVE VALUE***",
"dbhost": "***REMOVED SENSITIVE VALUE***",
"dbport": "",
"dbtableprefix": "oc_",
"mysql.utf8mb4": true,
"dbuser": "***REMOVED SENSITIVE VALUE***",
"dbpassword": "***REMOVED SENSITIVE VALUE***",
"installed": true,
"instanceid": "***REMOVED SENSITIVE VALUE***",
"htaccess.RewriteBase": "\/",
"mail_smtpmode": "smtp",
"mail_smtpsecure": "tls",
"mail_sendmailmode": "smtp",
"mail_smtpauthtype": "LOGIN",
"mail_smtpauth": 1,
"mail_domain": "***REMOVED SENSITIVE VALUE***",
"mail_from_address": "***REMOVED SENSITIVE VALUE***",
"mail_smtphost": "***REMOVED SENSITIVE VALUE***",
"mail_smtpport": "587",
"mail_smtpname": "***REMOVED SENSITIVE VALUE***",
"mail_smtppassword": "***REMOVED SENSITIVE VALUE***",
"maintenance": false,
"enabledPreviewProviders": [
"OC\\Preview\\BMP",
"OC\\Preview\\GIF",
"OC\\Preview\\JPEG",
"OC\\Preview\\Krita",
"OC\\Preview\\MarkDown",
"OC\\Preview\\MP3",
"OC\\Preview\\OpenDocument",
"OC\\Preview\\PNG",
"OC\\Preview\\TXT",
"OC\\Preview\\XBitmap",
"OC\\Preview\\Movie",
"OC\\Preview\\PDF",
"OC\\Preview\\Image",
"OC\\Preview\\HEIC"
],
"preview_max_x": 1024,
"preview_max_y": 1024,
"theme": "",
"app_install_overwrite": [
"news",
"caniupdate",
"inventory",
"files_markdown",
"mindmap_app",
"facerecognition",
"files_scripts",
"otpmanager",
"files_mindmap"
],
"memcache.local": "\\OC\\Memcache\\APCu",
"default_phone_region": "CH",
"maintenance_window_start": 4,
"memories.db.triggers.fcu": true,
"memories.exiftool_no_local": true,
"memories.vod.path": "\/var\/lib\/nextcloud\/apps\/memories\/bin-ext\/go-vod-amd64",
"memories.vod.ffmpeg": "\/usr\/bin\/ffmpeg",
"memories.vod.ffprobe": "\/usr\/bin\/ffprobe",
"memcache.locking": "\\OC\\Memcache\\Redis",
"redis": {
"host": "***REMOVED SENSITIVE VALUE***",
"port": 6379
},
"memcache.distributed": "\\OC\\Memcache\\Redis",
"memories.viewer.high_res_cond_default": "always",
"dbpersistent": true,
"loglevel": 2
}
}
