Nc18 php-fpm cpu is too high please help me

Support intro

Sorry to hear you’re facing problems :slightly_frowning_face: is for home/non-enterprise users. If you’re running a business, paid support can be accessed via where we can ensure your business keeps running smoothly.

In order to help you as quickly as possible, before clicking Create Topic please provide as much of the below as you can. Feel free to use a pastebin service for logs, otherwise either indent short log examples with four spaces:


Or for longer, use three backticks above and below the code snippet:


Some or all of the below information will be requested if it isn’t supplied; for fastest response please provide as much as you can :heart:

Nextcloud version (eg, 18.0.2): 18.0.2
Operating system and version (eg, Ubuntu 20.04):centos7.4
Apache or nginx version (eg, Apache 2.4.25): 1.14.2
PHP version (eg, 7.1):7.3

The issue you are facing:
when use jmeter login to /apps/files only 15 concurrent.THE php-fpm CPU is too high.
my server is esxi virtual machine.WEB SERVER: 8cpu 32GB memory.MYSQL SERVER 8cpu 32GB memory.
This is use jmeter

This is one user WEB login.success login about 1.5s. Refresh other url is the same problem.

Is this the first time you’ve seen this error? (Y/N):yes

Steps to replicate it:

The output of your Nextcloud log in Admin > Logging:


The output of your config.php file in /path/to/nextcloud (make sure you remove any identifiable information!):

$CONFIG = array ( 
  'instanceid' => 'xxxxx',
  'passwordsalt' => 'xxxx',
  'secret' => 'xxxx',
  'trusted_domains' =>
  array (
    0 => '',
  'datadirectory' => '/var/www/nextcloud/data',
  'dbtype' => 'mysql',
  'version' => '',
  'overwrite.cli.url' => '',
  'dbname' => 'nextcloud',
  'dbhost' => '',
  'dbport' => '3306',
  'dbtableprefix' => 'oc_',
  'mysql.utf8mb4' => true,
  'dbuser' => 'nextcloud',
  'dbpassword' => 'xxxx',
  'installed' => true,
  'default_language' => 'zh_CN',
  'default_locale' => 'zh_CN',
  'logtimezone' => 'Asia/Shanghai',
  'tempdirectory' => '/var/big_temp_file/',
  'lost_password_link' => '',
  'remember_login_cookie_lifetime' => 86400,
  'session_lifetime' => 86400,
  'session_keepalive' => true,
  'skeletondirectory' => '',
  'has_internet_connection' => false,
  'logfile' => '/data/log/nextcloud.log',
  'log.condition' =>
  array (
    'apps' =>
    array (
      0 => 'admin_audit',
  'filelocking.enabled' => true,
  'memcache.local' => '\\OC\\Memcache\\APCu',
  'memcache.distributed' => '\\OC\\Memcache\\Redis',
  'memcache.locking' => '\\OC\\Memcache\\Redis',
  'redis' =>
  array (
    'host' => '',
    'port' => 6379,
    'timeout' => 0.0,

The output of your Apache/nginx/system log in /var/log/____:

nginx log is all OK.

when use jmeter login to /apps/files only 100 concurrent.THE 15 concurrent is about 60% CPU.

Perhaps 11% of cpu is not too much. Perhaps it is the number of processes on each cpu.

Is it possible to configure it? Test some settings. Please post your settings.

hey man.this is my php www.conf
pm = static
pm.max_children = 100
pm.start_servers = 16
pm.min_spare_servers = 12
pm.max_spare_servers = 36
pm.max_requests = 500

my server is 8xcpu 32GB memory…memory is OK.but CPU very high.

Ok. One process uses e.g. 10% . For 50% you can use 5 children and for 8 cpus 5 * 8 = 40 children. Perhaps you can set

pm.max_children = 50

Test the cpu with “top” again and look netcloud (jmeter) works well or not.
Can you post the number of php-fpm-processes in different tests?

i set pm.max_children = 50. CPU is 90%.same problem.
when i use my Chrome to login nc the CPU also high.
your nc is not this problem??

Did you check that Redis and APCu are online? Not seen via your screenshot.

yes.this is my config.php
‘memcache.local’ => ‘\OC\Memcache\APCu’,
‘memcache.distributed’ => ‘\OC\Memcache\Redis’,
‘memcache.locking’ => ‘\OC\Memcache\Redis’,
‘redis’ =>
array (
‘host’ => ‘’,
‘port’ => 6379,
‘timeout’ => 0.0,

and use php73 -m include apcu 、redis

1 Like

this is my php all config
user = www
group = www
listen =
env[PATH] = /usr/local/bin:/usr/bin:/bin
env[TMP] = /tmp
env[TMPDIR] = /tmp
env[TEMP] = /tmp

mkdir -p /var/lib/php/session
chown www:www -R /var/lib/php/session/
session.save_handler = “files”
session.save_path = “/var/lib/php/session/”
vim /etc/php-fpm.d/www.conf
php_value[session.save_handler] = “files”
php_value[session.save_path] = “/var/lib/php/session/”



php_value upload_max_filesize 16G
php_value post_max_size 16G
php_value max_input_time 3600
php_value max_execution_time 3600
max_file_uploads = 100 #(上传文件数量)

memory_limit = 1024M
vim /etc/php-fpm.d/www.conf
php_admin_value[memory_limit] = 1024M

output_buffering = 0

vim /etc/php.ini
error_log = /data/log/php_error.log
vim /etc/php-fpm.conf
error_log = /data/log/php-fpm_error.log
vim /etc/php-fpm.d/www.conf
access.log = /data/log/php_access.log
slowlog = /data/log/php_www_slow.log
php_admin_value[error_log] = /data/log/php-fpm_www_error.log