Resource limits set at installation?

I’ve taken over maintenance of a Nextcloud installation originally set up by someone else. It’s my understanding that it was originally a VM and then migrated to a docker container on Ubuntu 16.04 on bare metal server.

I’ve upgradeed Nextcloud from 12 to 21, and postgres from 9.6 to 11.1, and it seems relatively laggy despite system resources basically sitting idle (disk, network cpu, and load with gb of unused memory). I see the same thing on another bare metal system where I cloned the datastore, DB, and containers. Symptoms are delays in logging in, showing icons, etc. It takes around 20 seconds to complete loading each page con content when I open a new folder with a dozen items.

I’m wondering if my Nextcloud install might still be acting as though it has the same limited resources as the original VM. Is this possible, and how would go about checking and reconfiguring this? Is it possible to fire up a fresh install and point to the same data store on my test system without causing problems?

Are there other places I should be looking for bottlenecks?


Hi @imneedham ,
do you use php-fpm modules , opcache ? if not try them maybe it can help you.
if yes, check configuration files and set the value like documentation ( Server tuning — Nextcloud latest Administration Manual latest documentation )

opcache is enabled, but I’m using apache/mod_php instead of php-fpm.

After upgrading to v21 and enabling apcu in config.php, my production instance is much faster. I still have a test instance that has replaced apache with php-fpm/nginx and has added redis for file locking. It’s even faster, but getting there involved some manual permission changes and a lot of trial and error. I’ve created a new topic for that specific issue.


1 Like

You can use PHP-FPM with Apache too:

apt install php7.4-fpm

a2dismod php7.4 && a2dismod mpm_prefork && a2enmod proxy_fcgi setenvif mpm_event && service apache2 restart

a2enconf php7.4-fpm && service apache2 restart

Thanks. As I understand it, this would either require:

  1. running these each time the container restarts, or
  2. making my own customized version of the standard NextCloud image.

I’d rather not do either one of those. I’m trying to keep our instance as close to stock as possible and our infrastructure easier for anyone else to pick up and maintain. Or is there another option?

Sorry I should have read more carefully. I didn’t realize you were using Docker.

If you use docker, it is best to follow the documentation of the respective Docker images. If you want to have more control over the components used and their configuration, a manual installation without Docker would probably make more sense. But I am no Docker expert.