Nextcloud version: 27.0.1
Operating system and version : Debian 11
Apache or nginx version: Nginx 1.18.0
PHP version: 8.2.8
The issue you are facing:
The php-fpm process has a very high memory usage since a few days when uploading files via Folder Sync.
Currently, the memory graph in the last 24 hours of the php-fpm service (all PHP processes combined, Nextcloud is the only PHP application) looks like this:
This is only because I’ve set pm.max_requests=50
otherwise it would eat up the swap too and then get OOM killed. My server has 32 GB of ram and half of it is already used by ZFS arc cache, PostgreSQL and other services.
I’m synchronizing my photos with FolderSync since at least a few months, and it never used that much memory. There is also no large diff, it will maybe check all these >20,000 files, but uploads are maybe like 10-50 per day.
I don’t have much knowledge of PHP, but I’ve created a core dump and with strings core.<pid>
I found out that most of the memory is full of cached propfind responses.
Is this the first time you’ve seen this error? (Y/N): Y
Steps to replicate it:
I don’t really know how to replicate it, but this is the steps that I’m aware of
- have folder sync on android setup
- Synchronize a folder which contains many files (at least 20k, with all subdirectories combined)
The output of your config.php file in /path/to/nextcloud
(make sure you remove any identifiable information!):
<?php
$CONFIG = array (
'instanceid' => 'INSTANCE_ID',
'passwordsalt' => 'SALT',
'secret' => 'SECRET',
'trusted_domains' =>
array (
0 => 'DOMAIN',
),
'datadirectory' => '/raid/nextcloud/data',
'dbtype' => 'pgsql',
'version' => '27.0.1.2',
'overwrite.cli.url' => 'URL',
'dbname' => 'DB_NAME',
'dbhost' => '/run/postgresql',
'dbtableprefix' => 'oc_',
'dbuser' => 'DB_USER',
'dbpassword' => 'DB_PASSWORD',
'installed' => true,
'memcache.local' => '\\OC\\Memcache\\APCu',
'memcache.locking' => '\\OC\\Memcache\\Redis',
'redis' =>
array (
'host' => '/run/redis/redis-server.sock',
'port' => 0,
'dbindex' => 0,
'timeout' => 1.5,
),
'mail_smtpmode' => 'smtp',
'mail_smtpsecure' => 'ssl',
'mail_sendmailmode' => 'smtp',
'mail_from_address' => 'FROM_ADDRESS',
'mail_domain' => 'DOMAIN',
'mail_smtpauthtype' => 'PLAIN',
'mail_smtphost' => 'SMTP_HOST',
'mail_smtpport' => '465',
'default_phone_region' => 'PHONE_REGION',
'maintenance' => false,
'enabledPreviewProviders' =>
array (
0 => 'OC\\Preview\\Image',
1 => 'OC\\Preview\\MP3',
2 => 'OC\\Preview\\TXT',
3 => 'OC\\Preview\\MarkDown',
4 => 'OC\\Preview\\OpenDocument',
5 => 'OC\\Preview\\Krita',
6 => 'OC\\Preview\\Movie',
),
'preview_max_x' => 1024,
'preview_max_y' => 1024,
'preview_max_memory' => 4096,
'preview_max_filesize_image' => 256,
'updater.release.channel' => 'stable',
'memories.exiftool' => '/var/www/nextcloud/apps/memories/exiftool-bin/exiftool-amd64-glibc',
'memories.gis_type' => 2,
'theme' => '',
'loglevel' => 2,
'memories.vod.ffmpeg' => '/usr/bin/ffmpeg',
'memories.vod.ffprobe' => '/usr/bin/ffprobe',
'memories.vod.path' => '/var/www/nextcloud/apps/memories/exiftool-bin/go-vod-amd64',
'memories.vod.disable' => false,
'memories.vod.vaapi' => true,
'memories.vod.nvenc' => false,
'memories.vod.nvenc.scale' => 'npp',
'memories.vod.nvenc.temporal_aq' => true,
'simpleSignUpLink.shown' => false,
'mail_smtpauth' => 1,
'mail_smtpname' => 'SMTP_NAME',
'mail_smtppassword' => 'MAIL_PW',
);
Nextcloud log and nginx log, don’t show anything related to this problem, both don’t contain any errors.
Nginx log only shows like 2-5 PROPFINDS in the timespan of 10s, but that’s it.