Nextcloud 21 high cpu usage

Basically ive installed nextcloud 21 today and ive noticed its chewing though my cpu cores like butter.

Its strange the cpu usage seems to spike to 100% when i use kodi to watch my media off my nextcloud installation via WebDAV.

Edit switching over to desktop so i can post more details

System Specs:AMD Ryzen 3 2300X Quadcore processor
8GB DDR4 Ram
OS: Kubuntu 20.04LTS
Apache/2.4.41
PHP Version 7.4.3
Mysql 8.0.23

my nextcloud config file ive removed any identifiable information.

<?php $CONFIG = array ( 'instanceid' => 'instancseid', 'passwordsalt' => 'oooosalty', 'secret' => '', 'trusted_domains' => array ( 0 => 'localhost', 1 => 'aaaa', 2 => 'aaa', ), 'memcache.local' => '\\OC\\Memcache\\Redis', 'memcache.locking' => '\\OC\\Memcache\\Redis', 'filelocking.enabled' => 'true', 'redis' => array( 'host' => 'localhost', 'port' => 6379, 'timeout' => 0.0, ), 'datadirectory' => '/var/www/nextcloud/data', 'dbtype' => 'mysql', 'version' => '21.0.1.1', 'overwrite.cli.url' => 'http://localhost/nextcloud', 'dbname' => 'databasename', 'dbhost' => 'localhost:3308', 'dbport' => '', 'dbtableprefix' => 'oc_', 'mysql.utf8mb4' => true, 'dbuser' => 'aname', 'dbpassword' => 'supersecretpassword', 'installed' => true, 'default_phone_region' => 'ISO 3166-2:GB', ); here is my apache2 error log [details="Summary] PHP Warning: Module 'apcu' already loaded in Unknown on line 0 [Sun Apr 18 20:12:54.183483 2021] [mpm_prefork:notice] [pid 26113] AH00163: Apache/2.4.41 (Ubuntu) OpenSSL/1.1.1f configured -- resuming normal operations [Sun Apr 18 20:12:54.183501 2021] [core:notice] [pid 26113] AH00094: Command line: '/usr/sbin/apache2' [Sun Apr 18 20:13:00.396179 2021] [access_compat:error] [pid 27407] [client 127.0.0.1:58396] AH01797: client denied by server configuration: /var/www/nextcloud/data/.ocdata [Sun Apr 18 20:13:20.178840 2021] [mpm_prefork:notice] [pid 26113] AH00169: caught SIGTERM, shutting down PHP Warning: Module 'apcu' already loaded in Unknown on line 0 [Sun Apr 18 20:13:20.254678 2021] [mpm_prefork:notice] [pid 27473] AH00163: Apache/2.4.41 (Ubuntu) OpenSSL/1.1.1f configured -- resuming normal operations [Sun Apr 18 20:13:20.254711 2021] [core:notice] [pid 27473] AH00094: Command line: '/usr/sbin/apache2' [Sun Apr 18 20:13:23.465941 2021] [access_compat:error] [pid 27478] [client 127.0.0.1:58460] AH01797: client denied by server configuration: /var/www/nextcloud/data/.ocdata [Sun Apr 18 20:15:54.810628 2021] [mpm_prefork:notice] [pid 27473] AH00169: caught SIGTERM, shutting down PHP Warning: Module 'apcu' already loaded in Unknown on line 0 [Sun Apr 18 20:15:54.885065 2021] [mpm_prefork:notice] [pid 27550] AH00163: Apache/2.4.41 (Ubuntu) OpenSSL/1.1.1f configured -- resuming normal operations [Sun Apr 18 20:15:54.885102 2021] [core:notice] [pid 27550] AH00094: Command line: '/usr/sbin/apache2' [Sun Apr 18 20:17:45.152235 2021] [access_compat:error] [pid 27566] [client 192.168.0.1:45290] AH01797: client denied by server configuration: /var/www/nextcloud/data/.ocdata [Sun Apr 18 20:26:28.899113 2021] [mpm_prefork:notice] [pid 27550] AH00169: caught SIGTERM, shutting down PHP Warning: Module 'apcu' already loaded in Unknown on line 0 [Sun Apr 18 20:27:12.487324 2021] [mpm_prefork:notice] [pid 964] AH00163: Apache/2.4.41 (Ubuntu) OpenSSL/1.1.1f configured -- resuming normal operations [Sun Apr 18 20:27:12.487359 2021] [core:notice] [pid 964] AH00094: Command line: '/usr/sbin/apache2' [Sun Apr 18 20:30:32.192155 2021] [mpm_prefork:notice] [pid 964] AH00169: caught SIGTERM, shutting down PHP Warning: Module 'apcu' already loaded in Unknown on line 0 [Sun Apr 18 20:31:15.478560 2021] [mpm_prefork:notice] [pid 948] AH00163: Apache/2.4.41 (Ubuntu) OpenSSL/1.1.1f configured -- resuming normal operations [Sun Apr 18 20:31:15.478604 2021] [core:notice] [pid 948] AH00094: Command line: '/usr/sbin/apache2' [Sun Apr 18 20:32:22.842974 2021] [access_compat:error] [pid 952] [client 192.168.0.1:47864] AH01797: client denied by server configuration: /var/www/nextcloud/data/.ocdata [Sun Apr 18 20:39:23.250514 2021] [mpm_prefork:notice] [pid 948] AH00169: caught SIGTERM, shutting down PHP Warning: Module 'apcu' already loaded in Unknown on line 0 [Sun Apr 18 20:40:01.135356 2021] [mpm_prefork:notice] [pid 1290] AH00163: Apache/2.4.41 (Ubuntu) OpenSSL/1.1.1f configured -- resuming normal operations [Sun Apr 18 20:40:01.135397 2021] [core:notice] [pid 1290] AH00094: Command line: '/usr/sbin/apache2' [Sun Apr 18 20:43:24.497138 2021] [mpm_prefork:notice] [pid 1290] AH00169: caught SIGTERM, shutting down PHP Warning: Module 'apcu' already loaded in Unknown on line 0 [Sun Apr 18 20:44:08.536074 2021] [mpm_prefork:notice] [pid 1287] AH00163: Apache/2.4.41 (Ubuntu) OpenSSL/1.1.1f configured -- resuming normal operations [Sun Apr 18 20:44:08.536126 2021] [core:notice] [pid 1287] AH00094: Command line: '/usr/sbin/apache2' [Sun Apr 18 22:13:09.884228 2021] [mpm_prefork:notice] [pid 1287] AH00169: caught SIGTERM, shutting down PHP Warning: Module 'apcu' already loaded in Unknown on line 0 [Sun Apr 18 22:13:09.971476 2021] [mpm_prefork:notice] [pid 39835] AH00163: Apache/2.4.41 (Ubuntu) OpenSSL/1.1.1f configured -- resuming normal operations [Sun Apr 18 22:13:09.971511 2021] [core:notice] [pid 39835] AH00094: Command line: '/usr/sbin/apache2' [Sun Apr 18 22:17:58.364152 2021] [mpm_prefork:notice] [pid 39835] AH00169: caught SIGTERM, shutting down PHP Warning: Module 'apcu' already loaded in Unknown on line 0 [Sun Apr 18 22:18:43.016328 2021] [mpm_prefork:notice] [pid 979] AH00163: Apache/2.4.41 (Ubuntu) OpenSSL/1.1.1f configured -- resuming normal operations [Sun Apr 18 22:18:43.016374 2021] [core:notice] [pid 979] AH00094: Command line: '/usr/sbin/apache2' [Sun Apr 18 22:20:24.856785 2021] [mpm_prefork:notice] [pid 979] AH00169: caught SIGTERM, shutting down PHP Warning: Module 'apcu' already loaded in Unknown on line 0 [Sun Apr 18 22:20:24.930937 2021] [mpm_prefork:notice] [pid 2131] AH00163: Apache/2.4.41 (Ubuntu) OpenSSL/1.1.1f configured -- resuming normal operations [Sun Apr 18 22:20:24.930968 2021] [core:notice] [pid 2131] AH00094: Command line: '/usr/sbin/apache2' [Sun Apr 18 22:41:29.785906 2021] [php7:error] [pid 3007] [client 51.38.40.95:47094] script '/var/www/html/wp-login.php' not found or unable to stat [Sun Apr 18 22:46:08.906997 2021] [mpm_prefork:notice] [pid 2131] AH00169: caught SIGTERM, shutting down PHP Warning: Module 'apcu' already loaded in Unknown on line 0 [Sun Apr 18 22:46:09.015244 2021] [mpm_prefork:notice] [pid 4582] AH00163: Apache/2.4.41 (Ubuntu) OpenSSL/1.1.1f configured -- resuming normal operations [Sun Apr 18 22:46:09.015282 2021] [core:notice] [pid 4582] AH00094: Command line: '/usr/sbin/apache2' [Sun Apr 18 22:47:48.604668 2021] [access_compat:error] [pid 4685] [client 192.168.0.1:48252] AH01797: client denied by server configuration: /var/www/nextcloud/data/.ocdata [Sun Apr 18 22:48:07.886628 2021] [php7:error] [pid 4584] [client 95.217.53.149:54984] script '/var/www/html/status.php' not found or unable to stat [Sun Apr 18 22:48:09.207755 2021] [php7:error] [pid 4739] [client 95.217.53.149:55000] script '/var/www/html/status.php' not found or unable to stat [Sun Apr 18 22:48:10.208957 2021] [php7:error] [pid 4740] [client 95.217.53.149:55026] script '/var/www/html/status.php' not found or unable to stat [Sun Apr 18 22:48:11.216015 2021] [php7:error] [pid 4742] [client 95.217.53.149:55028] script '/var/www/html/status.php' not found or unable to stat [Mon Apr 19 02:09:50.008263 2021] [mpm_prefork:notice] [pid 4582] AH00169: caught SIGTERM, shutting down PHP Warning: Module 'apcu' already loaded in Unknown on line 0 [Mon Apr 19 02:09:50.118993 2021] [mpm_prefork:notice] [pid 8085] AH00163: Apache/2.4.41 (Ubuntu) OpenSSL/1.1.1f configured -- resuming normal operations [Mon Apr 19 02:09:50.119047 2021] [core:notice] [pid 8085] AH00094: Command line: '/usr/sbin/apache2 apache 2 access log with a starnge thing going on 192.168.0.1 - yoda [19/Apr/2021:01:03:44 +0100] "GET /nextcloud/remote.php/dav/files/yoda/Home/TV/Firefly/Season%201/S01E06%20Our%20Mrs.%20Reynolds.mkv HTTP/1.1" 206 532954 "-" "Kodi/18.9 (WINDOWS 10.0.21361; Win64; x64) App_Bitness/64 Version/18.9-(18.9.0)-Git:20201023-0655c2c718" ::1 - - [19/Apr/2021:01:31:55 +0100] "OPTIONS * HTTP/1.0" 200 126 "-" "Apache/2.4.41 (Ubuntu) OpenSSL/1.1.1f (internal dummy connection)" ::1 - - [19/Apr/2021:01:31:56 +0100] "OPTIONS * HTTP/1.0" 200 126 "-" "Apache/2.4.41 (Ubuntu) OpenSSL/1.1.1f (internal dummy connection)" ::1 - - [19/Apr/2021:01:31:57 +0100] "OPTIONS * HTTP/1.0" 200 126 "-" "Apache/2.4.41 (Ubuntu) OpenSSL/1.1.1f (internal dummy connection)" ::1 - - [19/Apr/2021:01:31:58 +0100] "OPTIONS * HTTP/1.0" 200 126 "-" "Apache/2.4.41 (Ubuntu) OpenSSL/1.1.1f (internal dummy connection)" ::1 - - [19/Apr/2021:01:31:59 +0100] "OPTIONS * HTTP/1.0" 200 126 "-" "Apache/2.4.41 (Ubuntu) OpenSSL/1.1.1f (internal dummy connection)" ::1 - - [19/Apr/2021:01:32:00 +0100] "OPTIONS * HTTP/1.0" 200 126 "-" "Apache/2.4.41 (Ubuntu) OpenSSL/1.1.1f (internal dummy connection)" ::1 - - [19/Apr/2021:01:32:01 +0100] "OPTIONS * HTTP/1.0" 200 126 "-" "Apache/2.4.41 (Ubuntu) OpenSSL/1.1.1f (internal dummy connection)" ::1 - - [19/Apr/2021:01:32:02 +0100] "OPTIONS * HTTP/1.0" 200 126 "-" "Apache/2.4.41 (Ubuntu) OpenSSL/1.1.1f (internal dummy connection)" ::1 - - [19/Apr/2021:01:32:03 +0100] "OPTIONS * HTTP/1.0" 200 126 "-" "Apache/2.4.41 (Ubuntu) OpenSSL/1.1.1f (internal dummy connection)" ::1 - - [19/Apr/2021:01:32:04 +0100] "OPTIONS * HTTP/1.0" 200 126 "-" "Apache/2.4.41 (Ubuntu) OpenSSL/1.1.1f (internal dummy connection)" ::1 - - [19/Apr/2021:01:32:05 +0100] "OPTIONS * HTTP/1.0" 200 126 "-" "Apache/2.4.41 (Ubuntu) OpenSSL/1.1.1f (internal dummy connection)" ::1 - - [19/Apr/2021:01:32:06 +0100] "OPTIONS * HTTP/1.0" 200 126 "-" "Apache/2.4.41 (Ubuntu) OpenSSL/1.1.1f (internal dummy connection)" ::1 - - [19/Apr/2021:01:32:07 +0100] "OPTIONS * HTTP/1.0" 200 126 "-" "Apache/2.4.41 (Ubuntu) OpenSSL/1.1.1f (internal dummy connection)" ::1 - - [19/Apr/2021:01:32:08 +0100] "OPTIONS * HTTP/1.0" 200 126 "-" "Apache/2.4.41 (Ubuntu) OpenSSL/1.1.1f (internal dummy connection)" ::1 - - [19/Apr/2021:01:32:09 +0100] "OPTIONS * HTTP/1.0" 200 126 "-" "Apache/2.4.41 (Ubuntu) OpenSSL/1.1.1f (internal dummy connection)" ::1 - - [19/Apr/2021:01:32:10 +0100] "OPTIONS * HTTP/1.0" 200 126 "-" "Apache/2.4.41 (Ubuntu) OpenSSL/1.1.1f (internal dummy connection)" ::1 - - [19/Apr/2021:01:32:11 +0100] "OPTIONS * HTTP/1.0" 200 126 "-" "Apache/2.4.41 (Ubuntu) OpenSSL/1.1.1f (internal dummy connection)" ::1 - - [19/Apr/2021:01:32:12 +0100] "OPTIONS * HTTP/1.0" 200 126 "-" "Apache/2.4.41 (Ubuntu) OpenSSL/1.1.1f (internal dummy connection)" 192.168.0.1 - yoda [19/Apr/2021:01:03:39 +0100] "GET /nextcloud/remote.php/dav/files/yoda/Home/TV/Firefly/Season%201/S01E11%20Trash.mkv HTTP/1.1" 206 642294 "-" "Kodi/18.9 (WINDOWS 10.0.21361; Win64; x64) App_Bitness/64 Version/18.9-(18.9.0)-Git:20201023-0655c2c718" my mysql error log 2021-04-18T19:43:24.447858Z 0 [System] [MY-013172] [Server] Received SHUTDOWN from user . Shutting down mysqld (Version: 8.0.23-0ubuntu0.20.04.1). 2021-04-18T19:43:24.985373Z 0 [System] [MY-010910] [Server] /usr/sbin/mysqld: Shutdown complete (mysqld 8.0.23-0ubuntu0.20.04.1) (Ubuntu). 2021-04-18T19:44:08.592404Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.0.23-0ubuntu0.20.04.1) starting as process 1163 2021-04-18T19:44:08.605440Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started. 2021-04-18T19:44:08.889204Z 1 [System] [MY-013577] [InnoDB] InnoDB initialization has ended. 2021-04-18T19:44:08.994843Z 0 [System] [MY-011323] [Server] X Plugin ready for connections. Bind-address: '127.0.0.1' port: 33060, socket: /var/run/mysqld/mysqlx.sock 2021-04-18T19:44:09.059784Z 0 [Warning] [MY-010068] [Server] CA certificate ca.pem is self signed. 2021-04-18T19:44:09.059996Z 0 [System] [MY-013602] [Server] Channel mysql_main configured to support TLS. Encrypted connections are now supported for this channel. 2021-04-18T19:44:09.080412Z 0 [System] [MY-010931] [Server] /usr/sbin/mysqld: ready for connections. Version: '8.0.23-0ubuntu0.20.04.1' socket: '/var/run/mysqld/mysqld.sock' port: 3308 (Ubuntu). 2021-04-18T21:13:55.961784Z 8411 [ERROR] [MY-013131] [Server] Out of sort memory, consider increasing server sort buffer size! 2021-04-18T21:17:57.955747Z 0 [System] [MY-013172] [Server] Received SHUTDOWN from user . Shutting down mysqld (Version: 8.0.23-0ubuntu0.20.04.1). 2021-04-18T21:18:00.611339Z 0 [System] [MY-010910] [Server] /usr/sbin/mysqld: Shutdown complete (mysqld 8.0.23-0ubuntu0.20.04.1) (Ubuntu). 2021-04-18T21:18:43.096106Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.0.23-0ubuntu0.20.04.1) starting as process 922 2021-04-18T21:18:43.108869Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started. 2021-04-18T21:18:43.415416Z 1 [System] [MY-013577] [InnoDB] InnoDB initialization has ended. 2021-04-18T21:18:43.528508Z 0 [System] [MY-011323] [Server] X Plugin ready for connections. Bind-address: '127.0.0.1' port: 33060, socket: /var/run/mysqld/mysqlx.sock 2021-04-18T21:18:43.764026Z 0 [Warning] [MY-010068] [Server] CA certificate ca.pem is self signed. 2021-04-18T21:18:43.764217Z 0 [System] [MY-013602] [Server] Channel mysql_main configured to support TLS. Encrypted connections are now supported for this channel. 2021-04-18T21:18:43.786214Z 0 [System] [MY-010931] [Server] /usr/sbin/mysqld: ready for connections. Version: '8.0.23-0ubuntu0.20.04.1' socket: '/var/run/mysqld/mysqld.sock' port: 3308 (Ubuntu). 2021-04-18T21:21:20.481720Z 155 [ERROR] [MY-013131] [Server] Out of sort memory, consider increasing server sort buffer size! 2021-04-18T21:49:41.462513Z 2722 [ERROR] [MY-013131] [Server] Out of sort memory, consider increasing server sort buffer size! is there somthing i messed up during my instalation or is it a glitch with nextcloud

Please insert an additional line with three backticks (```) before and after your configuration and also the log excerpt to make it better readable.

I cant work out the formating options on here so ill post the logs etc in individual posts to help with legibility. due to problems ive had to use pastebin please find the logs attached to my last post

System Specs:AMD Ryzen 3 2300X Quadcore processor
8GB DDR4 Ram
OS: Kubuntu 20.04LTS
Apache/2.4.41
PHP Version 7.4.3
Mysql 8.0.23

nextcloud config file

apache2 error log

apache access log

mysql error log