Disable PDF/Document Thumbnails?

We have a lot of documents in our folders and there is no need to generate tiny images as it is really slow and pins all 16 cores to 100% as users scroll.

We want to keep this feature for Image thumbnails (png, jpg). I just can’t figure out how to do this…
I know we can pre-generate thumbs, but I don’t want the user to need to load the images at all. The default icons are far better

This disables PDF but also everything else:
'enable_previews' => false

This disables images but PDF and other documents still generates thumbnails:
'enabledPreviewProviders' => []

I’ve gone as far as to edit ImageMagic’s meta.xml and removed PDF from the meta and it still generates thumbnails.

How do I disable document thumbnails? Ripping my hair out here

Can anyone shed some light on this? Currently have all previews disabled and have to turn it on for images soon. Even if I can disable this for a single directory is enough

As per docu https://docs.nextcloud.com/server/18/admin_manual/configuration_server/config_sample_php_parameters.html#previews just select what kind of previews you would like to have:

'enabledPreviewProviders' => array(

By the way “The following providers are disabled by default due to performance or privacy concerns: OC\Preview\PDF”.

1 Like

Thanks for your reply.

That’s the thing though. That was my first suspicion. I set ‘enabledPreviewProviders’ to an empty array and that disabled every preview except for documents!

'enabledPreviewProviders' => []

OC\Preview\PDF is defiantly not in my config file

And if you fill it up and explicitly forbid PDF by not exclude it from array?
I check it and if I do change my config:

    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',

Then no PDF previews are shown:

And if PDF is uncommented then I can see all PDF previews:

Didn’t work unfortunately. Still streaming in slowly generating previews. Maybe I’ll just increase ram to 16GB and CPU count to 16 on the VM and call it a day

loolforkit from Collabora is generating the previews if that helps at all…


Thats strange… May be you can open a bug report here

Is your problem performance? You can pre generate previews with Preview Generator by cron job, then it will be much quicker. Even I wrote small script to see some information in logs. How to know if Preview Generator is working?

Can you post details to the processes with top or htop (htop with sorted memory)

1200-1800ms for the previews to load, and it pins the CPUs. At the moment we only have IT trialing it with 3 users. If more users come online, I’m afraid that the previews will slow everything down during peak times.

Although if accessing already generated previews, it loads from cache, we have hundreds of folders of PDF invoices and other documents that will be accessed at one time.

As for the preview generator, I have tried that out, but it only uses a single core and is very slow to generate previews. I read in the issues that some people run it for 18 hours and still going.

Just had a look and mem is actually unrelated. mysqld and snapd

Can you sort?

sort by MEM% by pressing shift + M, or F3 to search in cmd line)

I would really recommend you to pre generate previews as per system cron job.

@daily /usr/local/bin/nextcloud-preview.sh #Nextcloud preview generation
@daily php /var/www/nextcloud/occ preview:pre-generate

This will save you CPU time in peak hours. Just execute it at the evening to be ready for a next day.

You can always interrupt it and as you say, it uses only 1 Core, should not be too bad for your performance.

For my old 2 core Cubietruck

For my new Ryzen with 16 GB RAM around 6 Hours for the same amount of job after migration to the newer Server.

Even after I moved out Preview folder to the SSD, by simply mounting it to the nextcloud folder as preview app, now All Nextcloud files are on a huge HDDs, but previews are on a SSD that makes random access to them extremely good.

mount | grep preview
/var/previews on /mnt/raid/nextcloud/data/appdata_xxxxxxxxxxx/preview type ext4 (rw,relatime)

Bunch of PDF Previews are loaded in 200-600 ms

1 Like

I don’t think you can sort Tree view can you? List view MEM% adds up to more than 100% so I was going off the actual used memory (virtual) per process tree in the screenshot before

Thank you both for you help.

I guess this is the solution for now as I don’t have time to try to replicate this issue and submit to github. I’m 80% sure its to do with preview requests being sent to Collabora when it shouldn’t have been.

Would be nice if it can run in parallel. I will try this weekend when no one is using the server in case it rolls over to the next day.

I think it is not normal the number, cpu and ram of your mysqld processes.

I just remembered, sql is running off another server so this server is only for the webfront.

Now to see how we can disable snap from loading mysql…