NextCloud 30.0.6 natively on Ubuntu 22.04.
1 user (me!)
ps -eLf | grep mariadb | wc -l
25
For the database, you can configure a max connection setting. You have tools like tuning-primer.sh or mysqltuner.pl, that after some runtime (1 day or more), show you a bit the usage of caches, connections and so on and give you some advice how to set it up for good performance and reasonable resource consumption.
After that it makes sense, to set you apache to something similar.
Keep in mind for a single user, you still might have connected a few clients in parallel, use multiple connections for parallel upload.
I agree that the system can be tuned. Does every process spin us a separate mariadb and apache thread? No persistent connection to the database that can be reused?
It’s true that i was uploading a bunch of files. Now the system is much more idle. Looks a lot better now.
I’m not 100% sure, regarding the database I think, one process can access the database at a time. So with n processes, you can handle n accesses at the same time. E.g. your desktop client periodically connects, in between these connects the database connection can be used by others.
And even if one is used right now, it probably can wait a few milliseconds to finish the previous one, some request can completely handled by cached data, …
Apache is special of its own with child processes and threads:
https://httpd.apache.org/docs/2.4/misc/perf-tuning.html#compiletime
In theory, if you have a too low number, you might see some warnings in the logfiles, and then later you’ll see an impact on performance.