Hello Nextcloud forums,
for a few days now, our Nextcloud server runs on a very high CPU load, most of the time more than 95% on each of the six cores; also the swap space is always fully taken. According to htop, that comes from the MySQL process, which takes up all of the resources. And it seems like it got worse gradually for a few days now. By today, even the web interface has become really slow.
What I found interesting is this output of show processlist;
in MariaDB:
MariaDB [(none)]> show processlist;
+---------+------------------+-----------+-----------+---------+------+--------------+------------------------------------------------------------------------------------------------------+----------+
| Id | User | Host | db | Command | Time | State | Info | Progress |
+---------+------------------+-----------+-----------+---------+------+--------------+------------------------------------------------------------------------------------------------------+----------+
| 5533543 | oc_root | localhost | nextcloud | Query | 845 | Sending data | SELECT `fileid`, `storage`, `path`, `parent`, `name`,
`mimetype`, `storage_mtime`, `mimepart`, ` | 0.000 |
| 5541855 | oc_root | localhost | nextcloud | Query | 477 | Sending data | SELECT `fileid`, `storage`, `path`, `parent`, `name`,
`mimetype`, `storage_mtime`, `mimepart`, ` | 0.000 |
| 5545999 | oc_root | localhost | nextcloud | Query | 819 | Sending data | SELECT `fileid`, `storage`, `path`, `parent`, `name`,
`mimetype`, `storage_mtime`, `mimepart`, ` | 0.000 |
| 5588786 | oc_root | localhost | nextcloud | Query | 325 | Sending data | SELECT `fileid`, `storage`, `path`, `parent`, `name`,
`mimetype`, `storage_mtime`, `mimepart`, ` | 0.000 |
| 5590030 | oc_root | localhost | nextcloud | Query | 519 | Sending data | SELECT `fileid`, `storage`, `path`, `parent`, `name`,
`mimetype`, `storage_mtime`, `mimepart`, ` | 0.000 |
| 5591869 | oc_root | localhost | nextcloud | Query | 726 | Sending data | SELECT `fileid`, `storage`, `path`, `parent`, `name`,
`mimetype`, `storage_mtime`, `mimepart`, ` | 0.000 |
| 5595236 | oc_root | localhost | nextcloud | Query | 139 | Sending data | SELECT `fileid`, `storage`, `path`, `parent`, `name`,
`mimetype`, `storage_mtime`, `mimepart`, ` | 0.000 |
| 5598040 | oc_root | localhost | nextcloud | Query | 322 | Sending data | SELECT `fileid`, `storage`, `path`, `parent`, `name`,
`mimetype`, `storage_mtime`, `mimepart`, ` | 0.000 |
| 5599190 | oc_root | localhost | nextcloud | Query | 399 | Sending data | SELECT `fileid`, `storage`, `path`, `parent`, `name`,
`mimetype`, `storage_mtime`, `mimepart`, ` | 0.000 |
| 5600335 | oc_root | localhost | nextcloud | Query | 629 | Sending data | SELECT `fileid`, `storage`, `path`, `parent`, `name`,
`mimetype`, `storage_mtime`, `mimepart`, ` | 0.000 |
| 5600920 | oc_root | localhost | nextcloud | Query | 284 | Sending data | SELECT `fileid`, `storage`, `path`, `parent`, `name`,
`mimetype`, `storage_mtime`, `mimepart`, ` | 0.000 |
| 5617378 | oc_root | localhost | nextcloud | Query | 19 | Sending data | SELECT `fileid`, `storage`, `path`, `parent`, `name`,
`mimetype`, `storage_mtime`, `mimepart`, ` | 0.000 |
| 5618918 | oc_root | localhost | nextcloud | Query | 75 | Sending data | SELECT `fileid`, `storage`, `path`, `parent`, `name`,
`mimetype`, `storage_mtime`, `mimepart`, ` | 0.000 |
| 5620627 | oc_root | localhost | nextcloud | Query | 763 | Sending data | SELECT `fileid`, `storage`, `path`, `parent`, `name`,
`mimetype`, `storage_mtime`, `mimepart`, ` | 0.000 |
| 5622019 | oc_root | localhost | nextcloud | Query | 629 | Sending data | SELECT `fileid`, `storage`, `path`, `parent`, `name`,
`mimetype`, `storage_mtime`, `mimepart`, ` | 0.000 |
| 5629989 | oc_root | localhost | nextcloud | Query | 546 | Sending data | SELECT `fileid`, `storage`, `path`, `parent`, `name`,
`mimetype`, `storage_mtime`, `mimepart`, ` | 0.000 |
| 5632322 | oc_root | localhost | nextcloud | Query | 162 | Sending data | SELECT `fileid`, `storage`, `path`, `parent`, `name`,
`mimetype`, `storage_mtime`, `mimepart`, ` | 0.000 |
| 5634767 | oc_root | localhost | nextcloud | Query | 816 | Sending data | SELECT `fileid`, `storage`, `path`, `parent`, `name`,
`mimetype`, `storage_mtime`, `mimepart`, ` | 0.000 |
| 5637514 | oc_root | localhost | nextcloud | Query | 589 | Sending data | SELECT `fileid`, `storage`, `path`, `parent`, `name`,
`mimetype`, `storage_mtime`, `mimepart`, ` | 0.000 |
| 5653279 | oc_root | localhost | nextcloud | Query | 850 | Sending data | SELECT `fileid`, `storage`, `path`, `parent`, `name`,
`mimetype`, `storage_mtime`, `mimepart`, ` | 0.000 |
| 5656678 | oc_root | localhost | nextcloud | Query | 478 | Sending data | SELECT `fileid`, `storage`, `path`, `parent`, `name`,
`mimetype`, `storage_mtime`, `mimepart`, ` | 0.000 |
| 5679457 | oc_root | localhost | nextcloud | Query | 629 | Sending data | SELECT `fileid`, `storage`, `path`, `parent`, `name`,
`mimetype`, `storage_mtime`, `mimepart`, ` | 0.000 |
| 5695029 | oc_root | localhost | nextcloud | Query | 172 | Sending data | SELECT `fileid`, `storage`, `path`, `parent`, `name`,
`mimetype`, `storage_mtime`, `mimepart`, ` | 0.000 |
| 5708272 | oc_root | localhost | nextcloud | Query | 585 | Sending data | SELECT `fileid`, `storage`, `path`, `parent`, `name`,
`mimetype`, `storage_mtime`, `mimepart`, ` | 0.000 |
| 5710313 | oc_root | localhost | nextcloud | Query | 848 | Sending data | SELECT `fileid`, `storage`, `path`, `parent`, `name`,
`mimetype`, `storage_mtime`, `mimepart`, ` | 0.000 |
| 5712299 | oc_root | localhost | nextcloud | Query | 475 | Sending data | SELECT `fileid`, `storage`, `path`, `parent`, `name`,
`mimetype`, `storage_mtime`, `mimepart`, ` | 0.000 |
| 5714361 | oc_root | localhost | nextcloud | Query | 170 | Sending data | SELECT `fileid`, `storage`, `path`, `parent`, `name`,
`mimetype`, `storage_mtime`, `mimepart`, ` | 0.000 |
| 5716562 | oc_root | localhost | nextcloud | Query | 314 | Sending data | SELECT `fileid`, `storage`, `path`, `parent`, `name`,
`mimetype`, `storage_mtime`, `mimepart`, ` | 0.000 |
| 5718013 | oc_root | localhost | nextcloud | Query | 595 | Sending data | SELECT `fileid`, `storage`, `path`, `parent`, `name`,
`mimetype`, `storage_mtime`, `mimepart`, ` | 0.000 |
| 5719218 | oc_root | localhost | nextcloud | Query | 5 | Sending data | SELECT `fileid`, `storage`, `path`, `parent`, `name`,
`mimetype`, `storage_mtime`, `mimepart`, ` | 0.000 |
| 5720771 | oc_root | localhost | nextcloud | Query | 763 | Sending data | SELECT `fileid`, `storage`, `path`, `parent`, `name`,
`mimetype`, `storage_mtime`, `mimepart`, ` | 0.000 |
| 5722252 | oc_root | localhost | nextcloud | Query | 726 | Sending data | SELECT `fileid`, `storage`, `path`, `parent`, `name`,
`mimetype`, `storage_mtime`, `mimepart`, ` | 0.000 |
| 5723505 | oc_root | localhost | nextcloud | Query | 410 | Sending data | SELECT `fileid`, `storage`, `path`, `parent`, `name`,
`mimetype`, `storage_mtime`, `mimepart`, ` | 0.000 |
| 5727958 | oc_root | localhost | nextcloud | Query | 121 | Sending data | SELECT `fileid`, `storage`, `path`, `parent`, `name`,
`mimetype`, `storage_mtime`, `mimepart`, ` | 0.000 |
| 5745232 | oc_root | localhost | nextcloud | Query | 629 | Sending data | SELECT `fileid`, `storage`, `path`, `parent`, `name`,
`mimetype`, `storage_mtime`, `mimepart`, ` | 0.000 |
| 5747516 | oc_root | localhost | nextcloud | Query | 465 | Sending data | SELECT `fileid`, `storage`, `path`, `parent`, `name`,
`mimetype`, `storage_mtime`, `mimepart`, ` | 0.000 |
| 5755215 | oc_root | localhost | nextcloud | Query | 627 | Sending data | SELECT `fileid`, `storage`, `path`, `parent`, `name`,
`mimetype`, `storage_mtime`, `mimepart`, ` | 0.000 |
| 5805639 | oc_root | localhost | nextcloud | Query | 72 | Sending data | SELECT `fileid`, `storage`, `path`, `parent`, `name`,
`mimetype`, `storage_mtime`, `mimepart`, ` | 0.000 |
| 5816884 | oc_root | localhost | nextcloud | Query | 341 | Sending data | SELECT `fileid`, `storage`, `path`, `parent`, `name`,
`mimetype`, `storage_mtime`, `mimepart`, ` | 0.000 |
| 5860822 | oc_root | localhost | nextcloud | Query | 445 | Sending data | SELECT `fileid`, `storage`, `path`, `parent`, `name`,
`mimetype`, `storage_mtime`, `mimepart`, ` | 0.000 |
| 5902350 | oc_root | localhost | nextcloud | Query | 112 | Sending data | SELECT `fileid`, `storage`, `path`, `parent`, `name`,
`mimetype`, `storage_mtime`, `mimepart`, ` | 0.000 |
| 5914670 | oc_root | localhost | nextcloud | Query | 627 | Sending data | SELECT `fileid`, `storage`, `path`, `parent`, `name`,
`mimetype`, `storage_mtime`, `mimepart`, ` | 0.000 |
| 5933105 | oc_root | localhost | nextcloud | Query | 885 | Sending data | SELECT `fileid`, `storage`, `path`, `parent`, `name`,
`mimetype`, `storage_mtime`, `mimepart`, ` | 0.000 |
| 5948863 | oc_root | localhost | nextcloud | Query | 322 | Sending data | SELECT `fileid`, `storage`, `path`, `parent`, `name`,
`mimetype`, `storage_mtime`, `mimepart`, ` | 0.000 |
| 6122940 | oc_root | localhost | nextcloud | Query | 333 | Sending data | SELECT `fileid`, `storage`, `path`, `parent`, `name`,
`mimetype`, `storage_mtime`, `mimepart`, ` | 0.000 |
| 6128702 | oc_root | localhost | nextcloud | Query | 172 | Sending data | SELECT `fileid`, `storage`, `path`, `parent`, `name`,
`mimetype`, `storage_mtime`, `mimepart`, ` | 0.000 |
(output truncated, below this there were a few unsuspicious looking processes)
Here is the apache error log:
root@nc:~# tail -n 50 /var/log/apache2/error.log
[Thu Mar 07 06:25:22.971740 2019] [mpm_prefork:notice] [pid 17027] AH00163: Apache/2.4.25 (Debian) OpenSSL/1.0.2q configured -- resuming normal operations
[Thu Mar 07 06:25:22.971796 2019] [core:notice] [pid 17027] AH00094: Command line: '/usr/sbin/apache2'
[Thu Mar 07 08:06:34.267909 2019] [authz_core:error] [pid 3048] [client 80.147.196.215:54907] AH01630: client denied by server configuration: /var/www/nextcloud/config
[Thu Mar 07 09:26:38.663169 2019] [authz_core:error] [pid 6764] [client 192.168.96.236:54736] AH01630: client denied by server configuration: /var/www/nextcloud/config
[Thu Mar 07 09:27:22.481754 2019] [authz_core:error] [pid 6502] [client 192.168.96.155:51525] AH01630: client denied by server configuration: /var/www/nextcloud/config
[Thu Mar 07 09:42:28.806836 2019] [authz_core:error] [pid 7411] [client 80.147.196.215:49739] AH01630: client denied by server configuration: /var/www/nextcloud/config
[Thu Mar 07 09:59:25.802701 2019] [ssl:error] [pid 7411] AH02032: Hostname <redacted> provided via SNI and hostname <redacted> provided via HTTP have no compatible SSL setup
[Thu Mar 07 09:59:30.523761 2019] [authz_core:error] [pid 7906] [client 185.64.158.204:55442] AH01630: client denied by server configuration: /var/www/nextcloud/config
[Thu Mar 07 10:03:47.842428 2019] [authz_core:error] [pid 8066] [client 192.168.96.112:37806] AH01630: client denied by server configuration: /var/www/nextcloud/config
[Thu Mar 07 10:08:48.600313 2019] [authz_core:error] [pid 8253] [client 192.168.96.167:44312] AH01630: client denied by server configuration: /var/www/nextcloud/config
[Thu Mar 07 10:31:07.648225 2019] [authz_core:error] [pid 9228] [client 192.168.96.179:55857] AH01630: client denied by server configuration: /var/www/nextcloud/config
[Thu Mar 07 11:14:20.502554 2019] [authz_core:error] [pid 11546] [client 192.168.96.167:46868] AH01630: client denied by server configuration: /var/www/nextcloud/data/.ocdata
[Thu Mar 07 11:14:35.336506 2019] [authz_core:error] [pid 11681] [client 192.168.96.167:46888] AH01630: client denied by server configuration: /var/www/nextcloud/data/.ocdata
Any idea in which direction to check here?
Thank you very much - have a good thursday!
Nextcloud version (eg, 12.0.2): 15.0.4
Operating system and version (eg, Ubuntu 17.04): Debian Stretch
Apache or nginx version (eg, Apache 2.4.25): 2.4
PHP version (eg, 7.1): 7.1