Hi,
I am experiencing significant performance degradation when using Nextcloud, especially when multiple users are uploading large files and working with documents in Collabora Online. Below are the specifics of the problem:
Symptoms:
- Web UI Lag: The Nextcloud Web UI becomes slow, particularly when multiple users are uploading large files (around 8GB). The interface becomes sluggish, and general navigation is delayed.
- Collabora Online Slowness: When opening a Word document in Collabora Online, it takes approximately 14 seconds to open with 3 users uploading files simultaneously, compared to the usual 2 seconds when no large files are being uploaded. With 2 users, the document opens in 10 seconds.
- Server Performance: The CPU usage increases by 20% and memory usage is around 1.5GB on a Proxmox server with 16 vCPUs and 16GB RAM. My MariaDB database is in a container with nextcloud, and Collabora is in a separate container as well.
Server Configuration:
Proxmox Setup: 2 containers (one for Nextcloud, one for Collabora)
PHP Configuration: Adjusted for large file uploads and optimized performance (see php.ini
section below)
MySQL Configuration: Optimized for performance (see my.cnf
section below)
MySQL Configuration:
[server]
skip_name_resolve = 1
innodb_buffer_pool_size = 10G
innodb_buffer_pool_instances = 7
innodb_flush_log_at_trx_commit = 2
innodb_log_buffer_size = 32M
innodb_max_dirty_pages_pct = 90
max_heap_table_size = 128M
tmp_table_size= 128M
slow_query_log = 0
slow_query_log_file = /var/log/mysql/slow.log
long_query_time = 2
[client-server]
!includedir /etc/mysql/conf.d/
!includedir /etc/mysql/mysql.conf.d/
[mysqld]
character_set_server = utf8mb4
collation-server = utf8mb4_general_ci
transaction_isolation = READ-COMMITTED
binlog_format = ROW
innodb_file_per_table=1
max_connections = 300
performance_schema = 0
table_open_cache = 4000
PHP Configuration:
max_execution_time = 3600
memory_limit = 4096M
upload_max_filesize = 50G
post_max_size = 50G
pcache.enable=1
opcache.memory_consumption=512
opcache.interned_strings_buffer=16
opcache.max_accelerated_files=10000
Nextcloud Configuration:
$CONFIG = array (
‘trusted_domains’ =>
array (
0 => ‘172.16.16.24’,
1 => ‘172.16.12.24’,
2 => ‘nextcloud.test.local’,
),
‘wopi_hosts’ =>
array (
0 => ‘172.16.16.24’,
1 => ‘172.16.16.26’,
2 => ‘172.16.12.26’,
3 => ‘nextcloud.test.local’,
),
‘datadirectory’ => ‘/var/www/html/nextcloud/data’,
‘dbtype’ => ‘mysql’,
‘version’ => ‘30.0.2.2’,
‘overwrite.cli.url’ => ‘https://nextcloud.test.local’,
‘collabora’ =>
array (
‘url’ => ‘https://collabora.test.local:9980’,
),
‘allow_unverified_ssl’ => true,
‘dbname’ => ‘nextcloud’,
‘dbhost’ => ‘localhost’,
‘dbport’ => ‘’,
‘dbtableprefix’ => ‘oc_’,
‘mysql.utf8mb4’ => true,
‘dbuser’ => ‘nextclouduser’,
‘dbpassword’ => ‘****’,
‘installed’ => true,
‘preview_max_x’ => 2048,
‘preview_max_y’ => 2048,
‘enable_previews’ => true,
‘preview_libre’ => ‘ffmpeg’,
‘preview’ =>
array (
‘cache’ => ‘files’,
‘defaults’ =>
array (
‘video’ => ‘ffmpeg’,
),
),
‘skeletondirectory’ => ‘’,
‘allow_external_storage’ => true,
‘files_external_allow_create_new_local’ => true,
‘files_external_allow_create_new’ => true,
‘filesystem_check_changes’ => 0,
‘files_external_share_enabled’ => true,
‘default_user_settings’ =>
array (
‘enable_default_files’ => false,
),
‘ldapProviderFactory’ => ‘OCA\User_LDAP\LDAPProviderFactory’,
‘maintenance’ => false,
‘theme’ => ‘’,
‘loglevel’ => 0,
‘updater.release.channel’ => ‘stable’,
‘debug’ => true,
‘memcache.local’ => ‘\OC\Memcache\Redis’,
‘memcache.locking’ => ‘\OC\Memcache\Redis’,
‘distributed’ => ‘\OC\Memcache\Redis’,
‘redis’ =>
array (
‘host’ => ‘localhost’,
‘port’ => 6379,
‘password’ => ‘123456’,
‘timeout’ => 0.0,
),
);
What I Have Tried:
Adjusted the MySQL and PHP configurations to allow larger file uploads and better performance.
Used Redis caching to optimize database and file handling.
Why does the Nextcloud web interface slow down with large file uploads even when the system has sufficient resources (16GB RAM, 16 vCPUs)?
Are there specific settings in MariaDB or PHP that could be affecting performance when handling multiple large files simultaneously.
Any advice or suggestions on how to address these issues would be greatly appreciated.
Thank you for your help!