Server: Add a max-simultaneous-db-connection parameter

Created on 28 Feb 2019  路  4Comments  路  Source: nextcloud/server

Is your feature request related to a problem? Please describe.
Yes, I already submitted a bug report here for the contact app: https://github.com/nextcloud/contacts/issues/957
The main problem is, when having a limit on simultaneous DB connections (30 in my case), the contact import from the webui only imports a number of contacts equals to the number of allowed simultaneous connections. In my case, over 180 contacts, only 30 has been imported.

Problem, may it be possible that other apps or server features also behave wrongly if the connections are limited ? Could it leads to data loss or file sync bugs or any other ?

Describe the solution you'd like
It would be very nice if a max-simultaneous-db-connection parameter would be introduced and the "DB connection manager" would maintain sort a pool of connections, with some kind of wait queue when more connections are requested by any apps.

Describe alternatives you've considered
Or maybe a simple generic retry process to not loose anything on the way.

Additional context
The main context here is a shared hosts env with a limit on the simultaneous DB connections. I think these kind of envs should not be considered as not possible with nextcloud has it provides a very convenient way to have a personnal cloud on a highly available infrastructure and allows to easily setup some kind of family cloud with enough power and storage for such a use case ;)

However, I suppose that even with control on the DB configured with a large number of connections allowed, in case of high DB loads, some connections may be discarded and the same wrong behaviors can appear too.

0. Needs triage bug enhancement dav needs info

All 4 comments

There is no real way for us to do this. You can try to limit it in the front end. But in the backend there is no real way to do it.

Somehow you need to somewhere track this shared state how many connections are made. But we can't share this state since we have no DB.

We should however fail gracefully when this happens and throw a proper error.

I can confirm this issue. Eventually, the DB server will no longer accept new connections and the calendar import will fail.

@skjnldsv is this fixed by https://github.com/nextcloud/contacts/commit/5501624f8f45c9427c1942c8674df7a38ed516cd#diff-cfadd004726d5e46ee72f85874efa590 for contacts app?

Yes :p
But how do you find those old issues @kesselb :scream: (:heart:)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

rullzer picture rullzer  路  3Comments

williambargent picture williambargent  路  3Comments

georgehrke picture georgehrke  路  3Comments

jancborchardt picture jancborchardt  路  3Comments

blackcrack picture blackcrack  路  3Comments