Opened 14 months ago

Closed 14 months ago

Last modified 14 months ago

#3017 closed task (fixed)

Optimize speed of nextcloud

Reported by: robe Owned by: sac@…
Priority: normal Milestone: Sysadmin Contract 2023-I
Component: SysAdmin/Nextcloud Keywords:
Cc:

Description

I did some revisiting of nextcloud slowness.

I made the following changes which seemed to improve things a lot.

Changed to use redis (for non-local e.g. locking work), this didn't seem to improve that much.

apt install redis
apt install php-redis
#edit /var/www/nextcloud/config/config.php

right after:  'memcache.local' => '\\OC\\Memcache\\APCu',
  'memcache.distributed' => '\OC\Memcache\Redis',
  'memcache.locking' => '\OC\Memcache\Redis',
  'redis' => [
     'host' => 'localhost',
     'port' => 6379,
  ],
systemctl restart php8.1-fpm

But I also changed the php-fpm and I think I had these set too high, for the 32gb ram I had allocated, so reduced these. I think this made the most difference.

#the most improved performance, happened when tweaking

nano /etc/php/8.1/fpm/pool.d/www.conf 

pm.max_children = 30
pm.start_servers = 7
pm.min_spare_servers = 7
pm.max_spare_servers = 22
systemctl restart php8.1-fpm

Change History (3)

comment:1 by robe, 14 months ago

Resolution: fixed
Status: newclosed

comment:2 by robe, 14 months ago

I also made adjustments to the postgresql config as suggested here - https://docs.nextcloud.com/server/latest/admin_manual/configuration_database/linux_database_configuration.html

/etc/php/8.1/fpm/conf.d/20-pgsql.ini

was this

; configuration for php pgsql module
; priority=20
extension=pgsql.so

after changed to

; configuration for php pgsql module
; priority=20
extension=pdo_pgsql.so
extension=pgsql.so

[PostgresSQL]
pgsql.allow_persistent = On
pgsql.auto_reset_persistent = Off
pgsql.max_persistent = -1
pgsql.max_links = -1
pgsql.ignore_notice = 0
pgsql.log_notice = 0

also noted these changes in https://git.osgeo.org/gitea/sac/osgeo7/wiki/Nextcloud-Ubuntu-Setup and in git local repo

comment:3 by robe, 14 months ago

Component: SysAdminSysAdmin/Nextcloud
Note: See TracTickets for help on using tickets.