• Resolved Josh

    (@joshshashaty)


    Hello!

    We’re using the free version on a Pantheon.io site. Their live environments don’t have any write permissions on code (except for the uploads directory) … and their uploads directory are actually symlinked to another directory where media/files are actually stored. More on that here, if it’s helpful: https://pantheon.io/docs/platform-considerations/#write-access-on-environments

    We’ve seen some real slowness, mostly centered around WP Retina 2x, and getting the retina version of an image from a url. Here are some screenshots from New Relic showing the call stack where the slowness generally occurs.

    imgur-2018_04_25-11:17:13

    imgur-2018_04_25-11:10:07

    imgur-2018_04_25-11:12:08

    It seems like there’s always a check to make sure the path exists. We’ve also seen some reports pointing directly to wp_mkdir_p(), which is called when you try to get the current upload directory.

    Do you have any clues as to what might be causing the slowness given the server environment characteristics I mentioned above?

    Thank you!

    • This topic was modified 6 years, 10 months ago by Josh.
    • This topic was modified 6 years, 10 months ago by Josh.
Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Jordy Meow

    (@tigroumeow)

    Hi,

    Depending on your settings, WP Retina 2x can be either very fast or very slow. But in any case, since websites generally use caching, the pages are generated and then everything should be instant.

    The get_retina_from_url() is the slowest function in the whole plugin, and I am not sure you need to enable the related settings (Over HTTP Check
    ). Also, don’t use this setting if your website has no caching.

    I am not sure how this environment works exactly, but it would be a bit problematic if the uploads directory is mapped to a remove directory (networking-wise), that might indeed become extremely slow.

    Anyway, I think the short answer here would be to avoid the setting we talked about above and also to maybe optimize caching. PHP is slow by definition and WordPress needs to load itself (+ all the plugin) at every single page load, so slowness is “normal” but caching much be optimized.

    If you want a perfectly fast WP Retina 2x, use the “Responsive Images” method and don’t check the “Over HTTP Check” setting.

    Thread Starter Josh

    (@joshshashaty)

    I gotcha. Thanks for the great response!

    We do have really aggressive page caching, 1800 seconds TTL. I think there are hiccups when that cache expires, then the plugin needs to do all it’s lookups again. And the real slowness might come from the uploads directory being symlinked. The actual location of those uploads exists on another fileserver from where the code is actually being executed.

    I’ll try disabling HTTP lookups and see how that does.

    Thank you!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Slowness in get_retina_from_url()’ is closed to new replies.