Webinterface/One Folder takes 20second to load

Nextcloud version (eg, 20.0.5): Nextcloud Hub II (23.0.0)
Operating system and version (eg, Ubuntu 20.04): Ubuntu 20.04
Apache or nginx version (eg, Apache 2.4.25): Server version: Apache/2.4.52 (Ubuntu)
PHP version (eg, 7.4): PHP 7.4.27 (cli) , php7.4 (Apache)

The issue you are facing:

We have a folder that takes > 20 seconds to load in the webinterface fileview

Bildschirmfoto 2022-02-01 um 12.11.38

There are 2472 subfolders in there. 194,9 GB of photos.

The files are on an external storage mounted in linux via cifs

Is there any way to speed up the webview of this folder with special caching mechanism or anything like that?

Edit: I have a hunch that this error shown in the browser console (chrome) has something to do with it

“Please do NOT wait for the DOMContentLoaded before registering your viewer handler
handlers @ Viewer.vue:264”

How can we fix this error? It’s slow in every browser.

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

 'dbtype' => 'mysql',
  'version' => '23.0.0.10',
  'overwriteprotocol' => 'https',
  'mysql.utf8mb4' => true,
  'memcache.local' => '\\OC\\Memcache\\APCu',
  'memcache.locking' => '\\OC\\Memcache\\Redis',
  'default_phone_region' => 'DE',
  'maintenance' => false,
  'theme' => '',
  'loglevel' => 2,
  'activity_expire_days' => 14,
  'auth.bruteforce.protection.enabled' => true,
  'blacklisted_files' =>
  array (
    0 => '.htaccess',
    1 => 'Thumbs.db',
    2 => 'thumbs.db',
  ),
  'enable_previews' => true,
  'enabledPreviewProviders' =>
  array (
    0 => 'OC\\Preview\\PNG',
    1 => 'OC\\Preview\\JPEG',
    2 => 'OC\\Preview\\GIF',
    3 => 'OC\\Preview\\BMP',
    4 => 'OC\\Preview\\XBitmap',
    5 => 'OC\\Preview\\Movie',
    6 => 'OC\\Preview\\PDF',
    7 => 'OC\\Preview\\MP3',
    8 => 'OC\\Preview\\TXT',
    9 => 'OC\\Preview\\MarkDown',
  ),
  'filesystem_check_changes' => 0,
  'filelocking.enabled' => 'true',
  'htaccess.RewriteBase' => '/',
  'integrity.check.disabled' => false,
  'knowledgebaseenabled' => false,
  'preview_max_x' => 1024,
  'preview_max_y' => 768,
  'preview_max_scale_factor' => 1,
  'redis' =>
  array (
    'host' => '/var/run/redis/redis-server.sock',
    'port' => 0,
    'dbindex' => 0,
    'timeout' => 1.5,
  ),
  'quota_include_external_storage' => false,
  'updater.release.channel' => 'stable',

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

Tue Feb 01 11:26:18.679655 2022] [ssl:info] [pid 239176] [client ] AH01964: Connection to child 0 established (server )
[Tue Feb 01 11:26:18.851337 2022] [ssl:info] [pid 238909] [client ] AH01964: Connection to child 11 established (server )
[Tue Feb 01 11:26:20.048866 2022] [ssl:info] [pid 240328] [client] AH01964: Connection to child 2 established (server )
[Tue Feb 01 11:26:21.881701 2022] [ssl:info] [pid 239185] [client ] AH01964: Connection to child 10 established (server )
[Tue Feb 01 11:26:27.751376 2022] [ssl:info] [pid 239179] [client ] AH01964: Connection to child 4 established (server )
[Tue Feb 01 11:26:27.758224 2022] [ssl:info] [pid 240331] [client ] AH01964: Connection to child 7 established (server )
[Tue Feb 01 11:26:29.640907 2022] [ssl:info] [pid 238911] [client ] AH01964: Connection to child 13 established (server )
[Tue Feb 01 11:26:30.875684 2022] [ssl:info] [pid 238835] [client ] AH01964: Connection to child 1 established (server)
[Tue Feb 01 11:26:37.216897 2022] [ssl:info] [pid 238846] (70014)End of file found: [client] AH01991: SSL input filter read failed.
[Tue Feb 01 11:26:42.365757 2022] [ssl:info] [pid 240444] [client ] AH01964: Connection to child 6 established (server)
[Tue Feb 01 11:26:48.593872 2022] [ssl:info] [pid 240330] [client] AH01964: Connection to child 3 established (server)
[Tue Feb 01 11:26:48.744462 2022] [ssl:info] [pid 240328] [client ] AH01964: Connection to child 2 established (server )
[Tue Feb 01 11:26:50.048672 2022] [ssl:info] [pid 239176] [client] AH01964: Connection to child 0 established (server)

Hello, did you adjust your php.ini file to match your server performance ? (max_memory, max_upload, …)

I was using like you apache and php, I did have much better performance on Nginx with php-fpm on the same machine. You can give it a try too.

Hello, I wonder about your server’s performance. Is it a NAS thingy or a VPS? If it’s a NAS, have you exposed it to Internet?

A VPS with 16CPU 32Gb Ram. We scaled it up to test if the specs are the problem. It runs as slow as with half the power. Every data except that one folder loads fast. The data is on an external storage box mounted into linux with cifs to the nextcloud data folder.

We did generate the previews. This didn’t help.

We did tweak the php.ini and mysql settings according to multiple installation guides.
We tried php8.0 and php8.0 fpm.

It always took around 20 seconds until you can view the content of the folder with the webinterface.

You mentioned about a “external storage box”. So I don’t know how, but you probably have somehow connected the “box” with your VPS?

Anyway, is that box totally owned by you, it’s access and itself? Do you know what kind of drive is inside it, a SSD or a HDD?

I have a hunch that this error shown in the browser console (chrome) has something to do with it

“Please do NOT wait for the DOMContentLoaded before registering your viewer handler
handlers @ Viewer.vue:264”

How can we fix this error? It’s slow in very browser.