[Nextcloud] A cloud for personal or group use

The footprint value define the expected RAM footprint for each child of the php process.
This value will be used to deduce the values for pm.max_children, pm.start_servers, pm.min_spare_servers and pm.max_spare_servers.

To make it simple, the higher the footprint, the lower the allowed children will be. Considering a higher footprint will result in each child being bigger.
The purpose of this is to prevent a single app to overload the system by having too much huge children running at the same time.

Yet, the value of the footprint does not define the size of the children, those are inherent to the app itself. It’s only a indication for the helper to compute the children it should allow for your system, depending on the max RAM available on the number of cores.

Then, the “Expected usage” will define the way php-fpm manage the children.
From, “low”, which is ondemand for php. Which means no children are running unless the app is used. Easy on the ram, since no child is running if not needed, but harder on the proc since it will have to spawn a child on demand.

“medium” is for dynamic, php will have a few children running (pm.min_spare_servers), ready to answer a request and can increase the children to pm.max_children if needed.

And “high” is for static, php will keep running as many children as pm.max_children all the time, always ready to answer to request. Best to use for a service that is always requested as it reduce the need for new children to be spawn.

You’ll find all information on this on the dedicated helper: yunohost/php at dev · YunoHost/yunohost · GitHub

6 Likes

Thanks for that great and precise explanation. Do you have any idea of the standard size of children for Nextcloud ? Setting “expected usage” as “high” feels much much faster :scream_cat:

The footprint have been set to ‘high’ since the first configuration of this helper for nextcloud, which is considered as 50Mb by the helper.

If I run nextcloud, I can see that my actual footprint is between 30 an 90Mb per child.

For sure, the children are always in stand-by, ready to run, but the foot print can be high on your server.
The delay you would expect when running on “medium” is the time for php to detect the load and spawn new children to answer it. While on “high”, the children are already there, ready to work.
You can run ps -o user,cmd,%cpu,rss -u nextcloud to see the actual foot print of each child on your system.

EDIT:
If you want to finely tune the performance, you can play with the “expected usage” parameter and the “footprint” value, the lower the footprint you give to the config, the more you’ll have children running at the same time.
Yet be careful to not overload your server with to many children running at the same time for nextcloud if you set a footprint lower than the real value.

1 Like

Thanks, it’s very clear and I finally understand a bit these things

The result is really fantastic, finally I have my nextcloud starting to get more snappy !
Setting my 2GB RAM / 1vc VPS to “high” and “high” gives 4 children, between 30 and 80MB each, eating 20% of CPU. I’ll try to see if it’s usable on the long run, but as of now it seems yes.
Thanks again, you made my day :slight_smile:

Apologies if this is not the proper thread,

After updating to v24, i am getting this error message in the logs every 15 minutes:

Warning support Total user count was negative (users: 9, disabled: 11)

Any ideas what this is?

Very interesting (I never found that information explained like this !), thank you ! :slight_smile:

Did his applies to CPU usage too ?
And they just cached on RAM (taking up some space) and ready to be reactivated quickly at any time, or are they actually “running” (=using CPU) all the time ?

In this situation, “expected usage” on “high”, you will have a lower impact on the CPU because the children are already spawned.
Yet, if you don’t use them, they will lower their memory footprint and stay idle.
Your CPU won’t be used as long as the app isn’t used.

However, this setting was intended to services that you use very often, and expecting the children to be never unused.

You can anyway play with those parameters as much as you want, just be careful with the footprint parameter, as said previously.

Best stay to see by yourself the behavior by using this command ps -o user,cmd,%cpu,rss -u nextcloud

1 Like

Pour ceux qui hĂ©sitent, je confirme que l’application onlyoffice_ynh fonctionne parfaitement, et est trĂšs facile Ă  paramĂ©trer en utilisant le connecteur Onlyoffice pour Nextcloud.
Ça fonctionne mĂȘme mieux qu’avant !

Bon, je ne crois avoir compris vraiment toutes les subtilitĂ©s qui suivent. Mais j’ai essayĂ© de mettre les configurations sur Ă  High et aussi max footprint. J’avais toujours un parfois ces erreurs The OPcache interned strings buffer is nearly full. To assure that repeating strings can be effectively cached, it is recommended to apply opcache.interned_strings_buffer to your PHP configuration with a value higher than 8.
Du coup j’essaie en plus de changer les valeurs dans en Ă©ditant /etc/php/8.0/fpm/pool.d/nextcloud.conf
avec

php_value[opcache.interned_strings_buffer]=16 // au lieu de 8
php_value[opcache.memory_consumption]=256 // au lieu de 128

Peut-ĂȘtre car trop de charge sur le serveur ??
À suivre


Nextcloud has just announced Hub3, among with a new Photos app, apparently faster and including basic modification + AI / face recognition etc
 Are they finally working to ship usable gallery and hopefully a viable Google photo alternative on the long run ? Time will tell !

2 Likes

@rodinux
Peu importe les valeurs que l’on peut mettre dans la configuration de php, le message d’erreur revient à un moment ou un autre dans Nextcloud.

Comme tu le dis dans ton post c’est peut-ĂȘtre du Ă  trop de charge sur le serveur.
J’ai contournĂ© ce problĂšme en rechargement php avec un cron toutes les 6h.
Depuis je n’ai plus ces erreurs.

## Recharger ph8.0-fpm pour Ă©viter les avertissements dans nextcloud
0 */6 * * * systemctl reload-or-restart php8.0-fpm

Ă  tester sur ton ton instance.

1 Like

merci @mib , je tente le ce cron


Salut,
bon je n’ai pas garder le crontab, j’ai prĂ©fĂ©rĂ© Ă©diter la conf fpm ainsi
nano /etc/php/8.0/fpm/pool.d/nextcloud.conf

[nextcloud]

user = nextcloud
group = nextcloud

chdir = /var/www/nextcloud

listen = /var/run/php/php8.0-fpm-nextcloud.sock
listen.owner = www-data
listen.group = www-data

pm = static
pm.max_children = 32
pm.max_requests = 500
request_terminate_timeout = 1d


; Additional php.ini defines, specific to this pool of workers.
env[PATH] = $PATH
php_admin_value[memory_limit] = 512M
php_value[upload_max_filesize] = 10G
php_value[post_max_size] = 10G
php_value[default_charset] = UTF-8
; OPcache is already activated by default
; php_value[opcache.enable]=1
; The following parameters are nevertheless recommended for Nextcloud
; see here: https://docs.nextcloud.com/server/15/admin_manual/installation/server_tuning.html#enable-php-opcache
php_value[opcache.enable_cli]=1
php_value[opcache.interned_strings_buffer]=64
php_value[opcache.max_accelerated_files]=32531
php_value[opcache.memory_consumption]=256
php_value[opcache.save_comments]=1
php_value[opcache.revalidate_freq]=1
; https://docs.nextcloud.com/server/latest/admin_manual/configuration_server/caching_configuration.html#id1
php_value[apc.enabled]=1
php_value[apc.enable_cli]=1

@rodinux
Ta modification sera écrasée par la prochaine mise à jour de Nextcloud

peut-ĂȘtre, Ă  moins que je modifie le settings.yml
 C’est pas trĂšs conseillĂ©, mais je l’ai fait dans un cas particulier: Editer settings.yml dans une My_Webapp - #19 by rodinux
ou ajouter un hooks


Exact, la mise Ă  jour Ă  effacer ces changements !! je vais les Ă©diter Ă  nouveau. Super Bravo pour les mainteneurs !!

Si tu veux que des changements soient gardés, si je ne me trompe pas, il faut faire un hook et coder dedans pour gérer tes modifications.
Quelques bases d’infos ici : Hooks | Yunohost Documentation
Et il y a un topic dans le forum oĂč des gens partagent leurs hooks, tu trouvera dedans des exemples.

Bonsoir,

La mise Ă  jour de la version 24.0.5 vers la 24.0.7 s’est bien dĂ©roulĂ© de mon cĂŽtĂ©.

A noter que je n’ai que de simples applications (agenda et contacts), et que je n’ai pas d’applications de type office.

Merci Ă  l’équipe et aux contributeurs !

ppr

I’m having a problem upgrading from v22 to v24. The upgrade to v23 is successful, but looks like its crashing on a fulltextsearch bug.

2022-11-30 21:43:28,266: DEBUG - Update app files_fulltextsearch from App Store
2022-11-30 21:43:30,248: DEBUG - Update app fulltextsearch from App Store
2022-11-30 21:43:33,483: DEBUG - An unhandled exception has been thrown:
2022-11-30 21:43:33,484: DEBUG - Error: Undefined constant OCA\FullTextSearch\Service\ConfigService::MIGRATION_24 in /var/www/nextcloud/apps/fulltextsearch/lib/Migration/Version2400Date202201301329.php:159
2022-11-30 21:43:33,484: DEBUG - Stack trace:
2022-11-30 21:43:33,484: DEBUG - #0 /var/www/nextcloud/lib/private/DB/MigrationService.php(547): OCA\FullTextSearch\Migration\Version2400Date202201301329->postSchemaChange()
2022-11-30 21:43:33,484: DEBUG - #1 /var/www/nextcloud/lib/private/DB/MigrationService.php(425): OC\DB\MigrationService->executeStep()
2022-11-30 21:43:33,484: DEBUG - #2 /var/www/nextcloud/lib/private/legacy/OC_App.php(1022): OC\DB\MigrationService->migrate()
2022-11-30 21:43:33,484: DEBUG - #3 /var/www/nextcloud/lib/private/Installer.php(201): OC_App::updateApp()
2022-11-30 21:43:33,485: DEBUG - #4 /var/www/nextcloud/lib/private/Updater.php(415): OC\Installer->updateAppstoreApp()
2022-11-30 21:43:33,485: DEBUG - #5 /var/www/nextcloud/lib/private/Updater.php(277): OC\Updater->upgradeAppStoreApps()
2022-11-30 21:43:33,485: DEBUG - #6 /var/www/nextcloud/lib/private/Updater.php(133): OC\Updater->doUpgrade()
2022-11-30 21:43:33,485: DEBUG - #7 /var/www/nextcloud/core/Command/Upgrade.php(235): OC\Updater->upgrade()
2022-11-30 21:43:33,485: DEBUG - #8 /var/www/nextcloud/3rdparty/symfony/console/Command/Command.php(255): OC\Core\Command\Upgrade->execute()
2022-11-30 21:43:33,485: DEBUG - #9 /var/www/nextcloud/3rdparty/symfony/console/Application.php(1009): Symfony\Component\Console\Command\Command->run()
2022-11-30 21:43:33,485: DEBUG - #10 /var/www/nextcloud/3rdparty/symfony/console/Application.php(273): Symfony\Component\Console\Application->doRunCommand()
2022-11-30 21:43:33,485: DEBUG - #11 /var/www/nextcloud/3rdparty/symfony/console/Application.php(149): Symfony\Component\Console\Application->doRun()
2022-11-30 21:43:33,485: DEBUG - #12 /var/www/nextcloud/lib/private/Console/Application.php(211): Symfony\Component\Console\Application->run()
2022-11-30 21:43:33,485: DEBUG - #13 /var/www/nextcloud/console.php(99): OC\Console\Application->run()
2022-11-30 21:43:33,486: DEBUG - #14 /var/www/nextcloud/occ(11): require_once('...')
2022-11-30 21:43:33,512: DEBUG - #15 {main}+ '[' 1 -eq 3 ']'
2022-11-30 21:43:33,512: DEBUG - + ynh_die '--message=Unable to upgrade Nextcloud'
2022-11-30 21:43:33,529: DEBUG - + ynh_exit_properly
2022-11-30 21:43:33,529: WARNING -     1/0 [----->----------------------]   0%Unable to upgrade Nextcloud
2022-11-30 21:43:34,045: DEBUG - + ynh_clean_setup
2022-11-30 21:43:34,045: DEBUG - + ynh_restore_upgradebackup
2022-11-30 21:43:34,045: DEBUG - + ynh_print_err '--message=Upgrade failed.'
2022-11-30 21:43:34,063: DEBUG - + ynh_print_log '[Error] Upgrade failed.'
2022-11-30 21:43:34,064: DEBUG - + echo -e '[Error] Upgrade failed.'
2022-11-30 21:43:34,064: DEBUG - + local app_bck=nextcloud
2022-11-30 21:43:34,064: DEBUG - + NO_BACKUP_UPGRADE=0
2022-11-30 21:43:34,064: DEBUG - + ynh_backup_archive_exists nextcloud-pre-upgrade1
2022-11-30 21:43:34,065: WARNING - [Error] Upgrade failed.

I’m in the process of disabling fulltextsearch and will retry upgrade, but in the meantime, any ideas?

Full log: https://paste.yunohost.org/raw/ilefihirey

Thanks in advance!

Edit: Successfully upgraded to v24 after disabling fulltextsearch on v22 before initiating the upgrade. Issue resolved.