-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Expose Doctrine support for persistent connections in PDO in Nextcloud settings #32899
Conversation
76d5139
to
afa91b8
Compare
wouldn't it work to set it to "dbdriveroptions" directly in config.php, for example:
|
It's more or less what my first try to tinker with PDO::ATTR_PERSISTENT looked like. Although it works, I think it would be safer and more future-proof to expose a simple true/false flag, in turn enabling/disabling the setting in doctrine, rather than tuning the PDO driver from the nextcloud config file. Let me explain: |
2cf052c
to
2c2718e
Compare
bcd1308
to
34f314f
Compare
34f314f
to
3d989c8
Compare
3d989c8
to
5bd1371
Compare
ea0f124
to
7afa744
Compare
0b5c89c
to
369b4c8
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm with this, maybe at some point we could do that by default when running php-fpm if we don't notice anything weird
369b4c8
to
5c4f25a
Compare
I'll also update doc on the other repo for this new tunable. Friends already using this modification on their instances reported undesirable side effects when using
or
AKA "use an unlimited ammount of connexion to the db" , while php-fpm is set to pm = dynamic. Thoses are the settings we can see here in the docs As far as I can tell, php-fpm open a new connexion for each new children, and doesn't release the open connexion when a child is terminated. It's not Nextcloud fault, but it's something to be aware of before enabling persistent connexion to the db. I'll take a closer look later to see if it's something coming from doctrine dbal or php itself. In the meantime, I'll try to find sane default or alternatives to the aforementioned settings. |
Signed-off-by: Retidurc Silvernight <retidurc@silvernight.social>
Signed-off-by: Retidurc Silvernight <retidurc@silvernight.social>
Signed-off-by: Retidurc Silvernight <retidurc@silvernight.social>
Signed-off-by: Retidurc Silvernight <retidurc@silvernight.social>
5c4f25a
to
3ecd400
Compare
At the moment we don't set it, if not given, and doctrine sets permanent connections by default for the relevant engines:
Applying the change would switch the normal behaviour to non-persistent connections. |
If you check those files, there is a if statement around all thoses lines.
This is set only if "persistent" is present in the config passed to doctrine. Wich is what I'm doing there |
Darn, misinterpreted 😵💫 |
Thanks for your first pull request and welcome to the community! Feel free to keep them coming! If you are looking for issues to tackle then have a look at this selection: https://github.com/nextcloud/server/issues?q=is%3Aopen+is%3Aissue+label%3A%22good+first+issue%22 |
@Retidurc did you do you research on the topic? |
This is a very naive PR to expose Doctrine support for persistent connections in PDO doctrine/dbal#2315 in Netxcloud settings.
This setting enable the use of PDO::ATTR_PERSISTENT in the PDO driver .
This, with the various "persistent" options suggested in the docs allow for php-fpm to keep open and reuse connexion to the backend database. Not unlike a pool of connexion we can encounter in other languages.
I am personally using this modification, with a postresql database and pgsql.allow_persistent = On for a small nextcloud shared between friends and haven't seen anything weird yet. Although my use case is fairly small and problems may arise on larger instances