Imagick “not authorized” and 502s during WordPress WebP thumbnails

My site normanyap is being run on WordPress, where Imagick handles thumbnails and WebP

I keep going through the following issues:

  • 502 Bad Gateway during bulk thumbnail and WebP generation
  • Occasional 499 client closed requests
  • Imagick error:
  • convert-im6.q16: not authorized ... @ error/constitute.c/ReadImage/412
  • First view of galleries sometimes has slow TTFB

Questions:

  • How to fix the Imagick “not authorized” on Leap safely? Edit policy.xml per format or create an override file?
  • Could AppArmor be blocking php-fpm temp paths for uploads and conversions? Where should I whitelist paths?
  • Recommended PHP-FPM tuning for short image bursts: raise max_children and lower execution time, or keep higher timeouts and queue jobs?
  • Nginx and performance: better to preload the LCP image or keep this in WordPress and avoid server tweaks?

You tagged this “other” for the openSUSE version you use.
That makes is even more important you start your post with telling what version of openSUSE this is about.