High CPU load on PROPFIND request

Nextcloud version (eg, 12.0.2): 16.0.4
Operating system and version (eg, Ubuntu 17.04): Ubuntu 18.04.03
Apache or nginx version (eg, Apache 2.4.25): nginx 1.15.10
PHP version (eg, 7.1): 7.3.8
Using Docker!

The issue you are facing:
The CPU load spikes with every PROPFIND request. I just don’t think that this is normal, is it? Compared to “normal” requests, it’s way harder hitting. See the screenshot below.


The first two spikes are from me sending PROPFIND requests. The following smaller spikes are normal GET requests.

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

Steps to replicate it:

  1. Check current CPU load
  2. Use command
    curl --header "Depth: 1" -X PROPFIND --basic -u 'user:password' 'https://example.com/remote.php/webdav'
    multiple times
  3. observe the now spiking CPU load
  4. now to compare, do curl -L https://example.com multiple times
  5. compare both load spikes

The output of your Nextcloud log in Admin > Logging:

last entry over 2 weeks old

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

$CONFIG = array (
  'htaccess.RewriteBase' => '/',
  'filelocking.enabled' => true,
  'memcache.local' => '\\OC\\Memcache\\APCu',
  'memcache.locking' => '\\OC\\Memcache\\Redis',
  'redis' =>
  array (
    'host' => 'redis',
    'port' => 6379,
  ),
  'apps_paths' =>
  array (
    0 =>
    array (
      'path' => '/var/www/html/apps',
      'url' => '/apps',
      'writable' => false,
    ),
    1 =>
    array (
      'path' => '/var/www/html/custom_apps',
      'url' => '/custom_apps',
      'writable' => true,
    ),
  ),
  'instanceid' => 'ocpszvlbaae0',
  'passwordsalt' => '<removed>',
  'secret' => '<removed>',
  'trusted_domains' =>
  array (
    0 => '<removed>',
    1 => '<removed>',
  ),
  'datadirectory' => '/var/www/html/data',
  'overwrite.cli.url' => 'https://<removed>',
  'dbtype' => 'mysql',
  'version' => '16.0.4.1',
  'dbname' => 'nextcloud',
  'dbhost' => 'mysql',
  'dbport' => '3306',
  'dbtableprefix' => 'oc_',
  'dbuser' => 'nextcloud',
  'dbpassword' => '<removed>',
  'installed' => true,
  'mail_smtpmode' => 'smtp',
  'mail_smtpauthtype' => 'LOGIN',
  'mail_from_address' => 'cloud',
  'mail_domain' => '<removed>',
  'mail_smtphost' => '<removed>',
  'mail_smtpport' => '587',
  'loglevel' => 2,
  'maintenance' => false,
  'user_backends' =>
  array (
    0 =>
    array (
      'class' => 'OC_User_IMAP',
      'arguments' =>
      array (
        0 => '<removed>',
        1 => 993,
        2 => 'ssl',
        3 => '<removed>',
      ),
    ),
  ),
  'updater.release.channel' => 'stable',
  'mail_smtpsecure' => 'tls',
  'app.mail.accounts.default' =>
  array (
    'email' => '%EMAIL%',
    'imapHost' => '<removed>',
    'imapPort' => 993,
    'imapSslMode' => 'ssl',
    'smtpHost' => '<removed>',
    'smtpPort' => 587,
    'smtpSslMode' => 'tls',
  ),
  'mysql.utf8mb4' => true,
  'forwarded_for_headers' =>
  array (
    0 => 'HTTP_X_FORWARDED_FOR',
  ),
  'trusted_proxies' =>
  array (
    0 => '10.0.100.0/24',
  ),
  'app_install_overwrite' =>
  array (
    0 => 'mail',
  ),
  'mail_sendmailmode' => 'smtp',
  'mail_smtpauth' => 1,
  'mail_smtpname' => '<removed>',
  'mail_smtppassword' => '<removed>',
);

The output of your Apache/nginx/system log in /var/log/____:
It’s basically the same, no errors and the status codes are as expected
(oh and don’t worry about the IP addresses - using a reverse proxy and didn’t configure the logging to use X-Forwarded-For. Nextcloud handles it correctly though)

172.18.0.1 - - [10/Sep/2019:22:21:49 +0000] "PROPFIND /remote.php/webdav HTTP/1.1" 207 5976 "-" "curl/7.58.0" "172.18.0.1"
172.18.0.1 - - [10/Sep/2019:22:21:54 +0000] "GET /ocs/v2.php/apps/notifications/api/v2/notifications HTTP/1.1" 200 74 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.132 Safari/537.36" "172.18.0.1"
172.18.0.1 - - [10/Sep/2019:22:22:24 +0000] "GET /ocs/v2.php/apps/notifications/api/v2/notifications HTTP/1.1" 200 74 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.132 Safari/537.36" "172.18.0.1"
172.18.0.1 - - [10/Sep/2019:22:22:53 +0000] "GET /settings/user HTTP/1.1" 200 14996 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.132 Safari/537.36" "172.18.0.1"
172.18.0.1 - - [10/Sep/2019:22:22:53 +0000] "GET /ocs/v2.php/apps/notifications/api/v2/notifications HTTP/1.1" 200 74 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.132 Safari/537.36" "172.18.0.1"