I try to use the Image Optimize plugin to optimize the image with default Craft Transform. There are lots of images to be optimized at the same time, I keep having the issue of server down. Here is the error message,

The process "'/usr/bin/php7.4' 'craft' 'queue/exec' '280426' '300' '1' '7380' '--color='" exceeded the timeout of 300 seconds.

enter image description here

I have installed the Async (Background) Queue, but doesn't seems to be helpful.

Is there any solution for this?

Craft: 3.6.13

Image Optimize: 1.6.33

  • 1
    Did you configure the plugin as per the documentation as well as setting 'runQueueAutomatically' => false in your config/general.php (docs)?
    – Oli
    Jun 1 at 7:22
  • The server is down even I add this line
    – Lee
    Jun 1 at 8:11
  • Do you have very large images, or not much CPU available? It sounds like its timing out the server, but 300 seconds is a very long time... I'm quite surprised any image transforms that need doing are not done in that timeframe. Can you give specs on your hosting? Jun 2 at 1:13
  • Yes, there are lots of images to be optimized, some folders have 50+ images, some have 500+ images. Currently, I'm optimizing per folder based, but the issue still there. Yes, it used 100% of the CPU usage. Is there any way to solve this besides increasing the CPU usage?
    – Lee
    Jun 2 at 1:57

Fixed this by adding

return [
    'modules' => [
        'my-module' => \modules\Module::class,
    'components' => [
        'queue' => [
            'ttr' => 3600,

to config/app.php.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.