With the little time I had over the last couple days, I poked at it a little, and found that the prefork module is actually enabled.
The reason I thought it was not installed is due to the following output:
root@nextcloudpi:/etc/apache2/conf-available# apachectl -l
Compiled in modules:
core.c
mod_so.c
mod_watchdog.c
http_core.c
mod_log_config.c
mod_logio.c
mod_version.c
mod_unixd.c
I ran some command, (I don’t remember what it was), and found that it was actually installed, but I guess it isn’t listed here. I’m not sure why.
After researching the prefork subject, and reading from this article here, that mpm_worker gives the best performance and memory useage, I disabled php7.0, then enabled mpm_worker, then attempted to enable php7.0 again.
It appears that php7.0 will not run with the installed version of mpm_worker?
root@nextcloudpi:~# a2enmod php7.0
Considering dependency mpm_prefork for php7.0:
Considering conflict mpm_event for mpm_prefork:
Considering conflict mpm_worker for mpm_prefork:
ERROR: Module mpm_worker is enabled - cannot proceed due to conflicts. It needs to be disabled first!
ERROR: Could not enable dependency mpm_prefork for php7.0, aborting
So I re-enabled mpm_prefork with php7.0 just exactly the way it was in the original installation.
After learning best configuration practices from here, I created the file: /etc/apache2/conf-available/performancetune.conf with the following contents:
<IfModule mpm_prefork_module>
StartServers 2
MinSpareServers 2
MaxSpareServers 5
MaxClients 150
#must be customized
ServerLimit 20
#must be customized
MaxRequestsPerChild 50
</IfModule>
KeepAlive Off
Then enabled that configuration:
a2enconf performancetune
I had another issue, however. It seems that nextcloud does not have any method to back off incoming data when clients are sending streams faster than what the storage medium can handle? The server would also crash due to too much throughput. I changed the nextcloud.conf file to contain the following:
<IfModule mod_bw.c>
BandwidthModule On
ForceBandWidthModule On
#Overall Limit to 4Mb
Bandwidth all "4194304"
MaxConnection all "400"
#any files over 1mb will be limited to 500kb/s
LargeFileLimit * 1024 512000
BandWidthError 510
Alias /nextcloud "/var/www/nextcloud/"
<Directory /var/www/nextcloud/>
Options +FollowSymlinks
AllowOverride All
<IfModule mod_dav.c>
Dav off
</IfModule>
SetEnv HOME /var/www/nextcloud
SetEnv HTTP_HOME /var/www/nextcloud
# Hard coding 128M OPCache size, only for /nextcloud, to suppress warning on nextcloud admin panel.
php_admin_value opcache.memory_consumption 128
</Directory>
</IfModule>
I’m guessing that’s probably not the best method of using the bandwidth module, but it seems to be working extremely well. I think my server is now behaving, these settings made a massive improvement. I will probably need to tweak them some as these values were just straight up guesses. I’ll run some hardcore client syncs over the next couple days to see how it does.
If anybody has input, please share.