Previews and high Imaginary requests

I’m setting up the preview with imaginary.
After having generate all preview, I see a weird behavior while loading a folder with >100 pictures :

  • Nextcloud make lot of postgres call, make sense since metadata is into the database (make me increase the max_connections config).
  • Nextcloud still make POST calls to my imaginary container even if the preview already exist (making high CPU pic).

I don’t understand why there are some much calls if the preview already exist into the appdata folder.

Part of Docker compose:

    image: nextcloud/aio-imaginary:latest
    container_name: nextcloud-imaginary
    restart: on-failure
      PORT: 9000
    command: -cpus 5 -concurrency 80 -enable-url-source
      - SYS_NICE

    image: nextcloud
    container_name: nextcloud
    hostname: nextcloud
    restart: on-failure
      - 80
      - nextcloud:/var/www/html
      - .nextcloud/custom_apps:/var/www/html/custom_apps
      - ./nextcloud/config:/var/www/html/config
      - ./nextcloud/nextcloud-data:/var/www/html/data
      - postgres
      - redis

Imaginary is into the enabledPreviewProvidersconfig at first entry.
Same for the URL : preview_imaginary_url' => 'http://nextcloud-imaginary:9000'

Imaginary logs during a gallery page load :

nextcloud-imaginary    | 172.19.X.X - - [16/May/2023 09:12:46] "POST /pipeline?operations=%5B%7B%22operation%22%3A%22autorotate%22%7D%2C%7B%22operation%22%3A%22fit%22%2C%22params%22%3A%7B%22width%22%3A256%2C%22height%22%3A256%2C%22stripmeta%22%3A%22true%22%2C%22type%22%3A%22png%22%2C%22norotation%22%3A%22true%22%2C%22quality%22%3A%2260%22%7D%7D%5D HTTP/1.1" 200 93461 6.6516
nextcloud-imaginary    | 172.19.X.X - - [16/May/2023 09:12:47] "POST /pipeline?operations=%5B%7B%22operation%22%3A%22autorotate%22%7D%2C%7B%22operation%22%3A%22fit%22%2C%22params%22%3A%7B%22width%22%3A256%2C%22height%22%3A256%2C%22stripmeta%22%3A%22true%22%2C%22type%22%3A%22png%22%2C%22norotation%22%3A%22true%22%2C%22quality%22%3A%2260%22%7D%7D%5D HTTP/1.1" 200 33402 7.6617

Best regards,

1 Like

I use previewgenerator but has very similar problem as you observed.
Thousands of requests to imaginary when visit big folder.

1 Like

For me it looks like the preview generator app doesn’t use imaginary for preview generation.

I uploaded a folder with 100 photos. Then used the occ preview:generator-all command and looked at what was displayed in htop. Generation of previews with this commad only uses one core on my old S720 and is quit slow. Imaginary process is never shown in htop.

Then opened the Folder. Thumbnails where loaded and at the same time a lot of imaginary processes appear in htop.