HTTPD using 100% CPU, Apache needs restarting to clear

Support intro

Sorry to hear you’re facing problems :slightly_frowning_face:

help.nextcloud.com is for home/non-enterprise users. If you’re running a business, paid support can be accessed via portal.nextcloud.com 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:

example

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

longer
example
here

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 : 16.04
Operating system and version : Solaris 11.4 SRU13 (yes, I know it is not supported)
Apache or nginx version : Apache 2.4.39
PHP version : 7.1.25

The issue you are facing:

The CPU usage of the httpd daemon rises to to 100% (sometimes) when either syncing (Mac or Android) or when viewing directories with pictures in via the web BUI.

This results in the server hanging. Therefore (as I am using a Solaris zone) I have stopped the zone using more than 50% CPU. This means the app fails at that point and hangs. I can access and restart the service, all will then be fine for days/weeks, or until I deliberately hit it :slight_smile:

I appreciate I am not using a supported OS, but I have been running it for a while and these issues only started around the update to NC14.

My gut says it is a PHP issue, but my skillset does not go to that.

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

Steps to replicate it:

  1. Browse a large directory of pictures

The output of your Nextcloud log in Admin > Logging:

{"reqId":"bhnyONvHVanCw3uRQpp6","level":0,"time":"2019-09-28T08:15:01+00:00","remoteAddr":"","user":"--","app":"cron","method":"","url":"--","message":"Run OCA\\Files_Versions\\BackgroundJob\\ExpireVersions job with ID 4","userAgent":"--","version":"16.0.4.1"}
{"reqId":"bhnyONvHVanCw3uRQpp6","level":0,"time":"2019-09-28T08:15:01+00:00","remoteAddr":"","user":"--","app":"cron","method":"","url":"--","message":"Finished OCA\\Files_Versions\\BackgroundJob\\ExpireVersions job with ID 4 in 0 seconds","userAgent":"--","version":"16.0.4.1"}
{"reqId":"bhnyONvHVanCw3uRQpp6","level":0,"time":"2019-09-28T08:15:01+00:00","remoteAddr":"","user":"--","app":"cron","method":"","url":"--","message":"Run OCA\\Files_Sharing\\DeleteOrphanedSharesJob job with ID 5","userAgent":"--","version":"16.0.4.1"}
{"reqId":"bhnyONvHVanCw3uRQpp6","level":0,"time":"2019-09-28T08:15:01+00:00","remoteAddr":"","user":"--","app":"DeleteOrphanedSharesJob","method":"","url":"--","message":"0 orphaned share(s) deleted","userAgent":"--","version":"16.0.4.1"}
{"reqId":"bhnyONvHVanCw3uRQpp6","level":0,"time":"2019-09-28T08:15:01+00:00","remoteAddr":"","user":"--","app":"cron","method":"","url":"--","message":"Finished OCA\\Files_Sharing\\DeleteOrphanedSharesJob job with ID 5 in 0 seconds","userAgent":"--","version":"16.0.4.1"}
{"reqId":"bhnyONvHVanCw3uRQpp6","level":0,"time":"2019-09-28T08:15:01+00:00","remoteAddr":"","user":"--","app":"cron","method":"","url":"--","message":"Run OCA\\Files_Sharing\\ExpireSharesJob job with ID 6","userAgent":"--","version":"16.0.4.1"}
{"reqId":"bhnyONvHVanCw3uRQpp6","level":0,"time":"2019-09-28T08:15:01+00:00","remoteAddr":"","user":"--","app":"cron","method":"","url":"--","message":"Finished OCA\\Files_Sharing\\ExpireSharesJob job with ID 6 in 0 seconds","userAgent":"--","version":"16.0.4.1"}
{"reqId":"bhnyONvHVanCw3uRQpp6","level":0,"time":"2019-09-28T08:15:01+00:00","remoteAddr":"","user":"--","app":"cron","method":"","url":"--","message":"Run OCA\\Files\\BackgroundJob\\ScanFiles job with ID 7","userAgent":"--","version":"16.0.4.1"}
{"reqId":"bhnyONvHVanCw3uRQpp6","level":0,"time":"2019-09-28T08:15:01+00:00","remoteAddr":"","user":"--","app":"cron","method":"","url":"--","message":"Finished OCA\\Files\\BackgroundJob\\ScanFiles job with ID 7 in 0 seconds","userAgent":"--","version":"16.0.4.1"}
{"reqId":"bhnyONvHVanCw3uRQpp6","level":0,"time":"2019-09-28T08:15:01+00:00","remoteAddr":"","user":"--","app":"cron","method":"","url":"--","message":"Run OCA\\Files\\BackgroundJob\\DeleteOrphanedItems job with ID 8","userAgent":"--","version":"16.0.4.1"}

<lots more then >
{"reqId":"u0l1FcHCinGPCoWyhDRk","level":3,"time":"2019-09-28T08:30:00+00:00","remoteAddr":"192.168.0.32","user":"--","app":"PHP","method":"GET","url":"\/nextcloud\/status.php","message":"hash_hmac(): Unknown hashing algorithm: sha1 at \/var\/www\/nextcloud\/3rdparty\/phpseclib\/phpseclib\/phpseclib\/Crypt\/Hash.php#372","userAgent":"Mozilla\/5.0 (Macintosh) mirall\/2.2.4 (build 1) (Nextcloud)","version":"16.0.4.1"}
{"reqId":"P9ghQcm8oFSO9fAn2T9n","level":3,"time":"2019-09-28T08:30:00+00:00","remoteAddr":"192.168.0.32","user":"--","app":"PHP","method":"GET","url":"\/nextcloud\/status.php","message":"hash_hmac(): Unknown hashing algorithm: sha1 at \/var\/www\/nextcloud\/3rdparty\/phpseclib\/phpseclib\/phpseclib\/Crypt\/Hash.php#372","userAgent":"Mozilla\/5.0 (Macintosh) mirall\/2.2.4 (build 1) (Nextcloud)","version":"16.0.4.1"}
{"reqId":"ZqFo5mTDIScD2hshSrHt","level":3,"time":"2019-09-28T08:30:00+00:00","remoteAddr":"192.168.0.32","user":"--","app":"PHP","method":"GET","url":"\/nextcloud\/ocs\/v2.php\/apps\/notifications\/api\/v2\/notifications","message":"hash_hmac(): Unknown hashing algorithm: sha1 at \/var\/www\/nextcloud\/3rdparty\/phpseclib\/phpseclib\/phpseclib\/Crypt\/Hash.php#372","userAgent":"Mozilla\/5.0 (Macintosh; Intel Mac OS X 10.14; rv:69.0) Gecko\/20100101 Firefox\/69.0","version":"16.0.4.1"}
{"reqId":"b1954LCuqA3vvGKIOgD1","level":3,"time":"2019-09-28T08:30:00+00:00","remoteAddr":"192.168.0.32","user":"--","app":"PHP","method":"GET","url":"\/nextcloud\/ocs\/v2.php\/apps\/notifications\/api\/v2\/notifications","message":"hash_hmac(): Unknown hashing algorithm: sha1 at \/var\/www\/nextcloud\/3rdparty\/phpseclib\/phpseclib\/phpseclib\/Crypt\/Hash.php#372","userAgent":"Mozilla\/5.0 (Macintosh; Intel Mac OS X 10.14; rv:69.0) Gecko\/20100101 Firefox\/69.0","version":"16.0.4.1"}
{"reqId":"u0l1FcHCinGPCoWyhDRk","level":3,"time":"2019-09-28T08:30:00+00:00","remoteAddr":"192.168.0.32","user":"--","app":"PHP","method":"GET","url":"\/nextcloud\/status.php","message":"hash_hmac(): Unknown hashing algorithm: sha1 at \/var\/www\/nextcloud\/3rdparty\/phpseclib\/phpseclib\/phpseclib\/Crypt\/Hash.php#372","userAgent":"Mozilla\/5.0 (Macintosh) mirall\/2.2.4 (build 1) (Nextcloud)","version":"16.0.4.1"}
{"reqId":"P9ghQcm8oFSO9fAn2T9n","level":3,"time":"2019-09-28T08:30:00+00:00","remoteAddr":"192.168.0.32","user":"--","app":"PHP","method":"GET","url":"\/nextcloud\/status.php","message":"hash_hmac(): Unknown hashing algorithm: sha1 at \/var\/www\/nextcloud\/3rdparty\/phpseclib\/phpseclib\/phpseclib\/Crypt\/Hash.php#372","userAgent":"Mozilla\/5.0 (Macintosh) mirall\/2.2.4 (build 1) (Nextcloud)","version":"16.0.4.1"}
{"reqId":"ZqFo5mTDIScD2hshSrHt","level":3,"time":"2019-09-28T08:30:00+00:00","remoteAddr":"192.168.0.32","user":"--","app":"PHP","method":"GET","url":"\/nextcloud\/ocs\/v2.php\/apps\/notifications\/api\/v2\/notifications","message":"hash_hmac(): Unknown hashing algorithm: sha1 at \/var\/www\/nextcloud\/3rdparty\/phpseclib\/phpseclib\/phpseclib\/Crypt\/Hash.php#372","userAgent":"Mozilla\/5.0 (Macintosh; Intel Mac OS X 10.14; rv:69.0) Gecko\/20100101 Firefox\/69.0","version":"16.0.4.1"}
{"reqId":"b1954LCuqA3vvGKIOgD1","level":3,"time":"2019-09-28T08:30:00+00:00","remoteAddr":"192.168.0.32","user":"--","app":"PHP","method":"GET","url":"\/nextcloud\/ocs\/v2.php\/apps\/notifications\/api\/v2\/notifications","message":"hash_hmac(): Unknown hashing algorithm: sha1 at \/var\/www\/nextcloud\/3rdparty\/phpseclib\/phpseclib\/phpseclib\/Crypt\/Hash.php#372","userAgent":"Mozilla\/5.0 (Macintosh; Intel Mac OS X 10.14; rv:69.0) Gecko\/20100101 Firefox\/69.0","version":"16.0.4.1"}
{"reqId":"u0l1FcHCinGPCoWyhDRk","level":3,"time":"2019-09-28T08:30:00+00:00","remoteAddr":"192.168.0.32","user":"--","app":"PHP","method":"GET","url":"\/nextcloud\/status.php","message":"hash_hmac(): Unknown hashing algorithm: sha1 at \/var\/www\/nextcloud\/3rdparty\/phpseclib\/phpseclib\/phpseclib\/Crypt\/Hash.php#372","userAgent":"Mozilla\/5.0 (Macintosh) mirall\/2.2.4 (build 1) (Nextcloud)","version":"16.0.4.1"}
{"reqId":"P9ghQcm8oFSO9fAn2T9n","level":3,"time":"2019-09-28T08:30:00+00:00","remoteAddr":"192.168.0.32","user":"--","app":"PHP","method":"GET","url":"\/nextcloud\/status.php","message":"hash_hmac(): Unknown hashing algorithm: sha1 at \/var\/www\/nextcloud\/3rdparty\/phpseclib\/phpseclib\/phpseclib\/Crypt\/Hash.php#372","userAgent":"Mozilla\/5.0 (Macintosh) mirall\/2.2.4 (build 1) (Nextcloud)","version":"16.0.4.1"}

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

<?php
$CONFIG = array (
  'passwordsalt' => 'fZnHTc2koNT5ARED0wfZo6dxvrtaIO',
  'secret' => 'rd8jImrCfEVM7frCcIJPafTgzETMAW4p7BtonY9WEKqoapBB',
  'trusted_domains' => 
  array (
    0 => 'localhost',
    1 => 'xx.xx.66',
    2 => 'xx.xx.66:643',
    3 => 'xxxx:643',
    4 => 'xxxx:643',
  ),
  'datadirectory' => '/nextcloud/server/nextcloud/data',
  'overwrite.cli.url' => 'http://localhost',
  'dbtype' => 'mysql',
  'version' => '16.0.4.1',
  'dbname' => 'nextcloud',
  'dbhost' => 'localhost',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'dbuser' => 'oc_admin',
  'dbpassword' => 'nqN3yhp2NdYReUFTApjjBwYsnOQfLA',
  'logtimezone' => 'UTC',
  'installed' => true,
  'instanceid' => 'oc798ms43svp',
  'loglevel' => 0,
  'mail_from_address' => 'xxxxx',
  'mail_smtpmode' => 'sendmail',
  'mail_domain' => 'xxxxxxx',
  'auth.bruteforce.protection.enabled' => false,
  'maintenance' => false,
  'theme' => '',
  'mail_sendmailmode' => 'smtp',
);

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

Current file is empty, no entries since last rotation  yesterday