Support » Plugin: Compress JPEG & PNG images » Plugin causing significant CPU usage

  • Resolved connorhsm


    We’ve had issues with a large site we’ve been using this plugin on for the past month.
    Issues such as very slow and often failing uploads of media and images to the site.
    This morning when I attempted to upload an image, I noted that the site was no longer accessible.
    I contacted my host who reported issues with this plugin and a significant CPU spike.
    Disabling this plugin and uploading images afterwards resolved the problem.

    I would upload three images at once, the first would be successful and then the last two would freeze and eventually fail. The website would not be accessible for roughly 10 minutes after this.

    WP 5.2.3
    TinyPNG Compress plugin 3.2.0

    Our host provided this error
    [pool site-82740] script_filename = /www//wp-admin/admin-ajax.php curl_exec() /www/wp-content/plugins/tiny-compress-images/src/vendor/tinify/Tinify/Client.php:107 request() /www/wp-content/plugins/tiny-compress-images/src/vendor/tinify/Tinify/Source.php:13 fromBuffer() /www/wp-content/plugins/tiny-compress-images/src/vendor/tinify/Tinify.php:141 Tinify\fromBuffer() /www/wp-content/plugins/tiny-compress-images/src/class-tiny-compress-client.php:96 compress() /www/wp-content/plugins/tiny-compress-images/src/class-tiny-compress.php:116 compress_file() /www/wp-content/plugins/tiny-compress-images/src/class-tiny-image.php:219 compress() /www/wp-content/plugins/tiny-compress-images/src/class-tiny-plugin.php:373 compress_on_upload() /www/wp-includes/class-wp-hook.php:286 apply_filters() /www/wp-includes/class-wp-hook.php:310 do_action() /www/wp-includes/plugin.php:465 do_action() /www/wp-admin/admin-ajax.php:173

Viewing 4 replies - 1 through 4 (of 4 total)
  • I’ve reproduced this on another site I manage.

    Plugin Author TinyPNG


    Hi @connorhsm

    We are sorry to hear that you are experiencing issues!

    This does sound like an issue that has been reported before. Are you using WooCommerce as well? If so, please have a look at our analysis on to see if that helps you to fix this behaviour.

    Please let us know if that helped, so that in case it didn’t we can look further into the issue you’re experiencing.

    The first site I discovered this on is using WooCommerce with a handful of products, which do actually sit on the front page of the site. But we were never having speed issues.
    Issues were only arising when an image would be uploaded and with upload newly compressed items on.

    The second site does not have WooCommerce installed, unfortunately, I didn’t ask for the error from our host at the time though. But, they did alure to the issue being potentially different from the first site, but agreed it was more than likely the same issue once I explained how I reproduced the problem.

    The only difference I could note in my testing is that on the first site, I would upload three images at once, the first would complete and the final two would stall and eventually give an error, at which point the site would be unavailable for ~10 minutes.
    On the second site, I uploaded the exact three images and all completed successfully. From memory, I was even able to delete them. And then shortly after the site would not be available for about the same time.

    We use your plugin on many other sites, so I’ll try and reproduce this on some others with and without WooCommerce and see what happens.
    I can also test on a personal site and a new one that I’ll be setting up over this week, so hopefully that can give some more insight.

    Has WooCommerce confirmed the conflict and looked into a permanent fix at all?

    • This reply was modified 3 months, 1 week ago by connorhsm.
    Plugin Author TinyPNG


    Hi @connorhsm

    I have been trying to reproduce this error, but can not. You said you managed to reproduce it on other sites, could you perhaps let us know how you did it?

Viewing 4 replies - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.