The MU forums have moved to WordPress.org

Unusably Slow Image Loading (13 posts)

  1. richcon
    Member
    Posted 14 years ago #

    Images in my wordpress site's upload folder load painfully slow. It takes 10-20 seconds for an image to even begin downloading.

    I looked at my .htaccess file, and the problem seems to be that everything in my uploads directory has to be routed through wp-content/blogs.php! That means it's loading up the PHP runtime for every. single. image. Ick.

    We need to do something about this... any ideas?

    Rich

  2. andrea_r
    Moderator
    Posted 14 years ago #

    that's how it's been for ages. Not everyone is experiencing the same slowness.

    Link so we can check? 10-20 seconds to me says something else is wrong entirely. Got image hotlink protection turned on?

  3. Innate
    Member
    Posted 14 years ago #

    The same file from a root location loads in a 1/4 of the time. Ive tested this on a fresh install with one post. The blogs.php file cause tremendous overhead on the server. Is there anyway to override this feature?

  4. tdjcbe
    Member
    Posted 14 years ago #

    Betting it's cached within your browser.

    As Andrea mentions, a link would be helpful.

  5. Innate
    Member
    Posted 14 years ago #

    The isn't anything complex about this requiring a link. This issue will occur on every blog running WPMU.

    This is a Wordpress MU failure as far as Im concerned (and many other users I see). Try it yourself with one post from your MU blog. Put an image file in your root dir and the same image uploaded by wp. Then insert this image onto a post and preview the page.

    The image served from the root is served instantly.
    The image served through blogs.php takes forever to load. up to 20 seconds at times for 5kb!!

    Is there any work around to the blogs.php issue as I'm losing users and its embarrassing.

    Is this the only option: http://mu.wordpress.org/forums/topic/14217?replies=7

  6. andrea_r
    Moderator
    Posted 14 years ago #

    On any of my setups I can't reproduce the delay like you're seeing.

  7. tdjcbe
    Member
    Posted 14 years ago #

    Ditto.

    We're offering our help. We can't do that without you providing the information that we need to help you.

  8. Innate
    Member
    Posted 14 years ago #

    ok, Ive set up a test blog using defaults:
    For a default, using the htacess and blogs.php file, try this link: http://fishnow.co.za/files/2010/04/welder1.jpg
    The same image is displayed on this post, but located in the root without the /files/ in its path: http://fishnow.co.za/welder1.jpg
    (I am using Firebug and Ctrl + F5 to refresh the cache for each load)
    I spoke to my host who recently upgraded Apache more or less when the issue appeared, could this be a problem? Is MU compatible with Apache 2 (changes to mod_write) ?

  9. andrea_r
    Moderator
    Posted 14 years ago #

    Crap, I wrecked my own test. :)

    I loaded the one in files first to see. loaded like all pics do for me.

    Then I used a tool I have to open both links in separate tabs at once, so the previously loaded image loaded lightening fast. :D

    Even on refresh (ctrl f5) they seem to take the same time for me.

    And if you're a fan of Yslow, it gives scores of 98 and 97 to the images directly, with the higher score going to the one with the rewritten URL.

    Dunno what to tell ya, just reporting my results. (from Canada, in case you're wondering about DNS.)

  10. Innate
    Member
    Posted 14 years ago #

    thanks for taking the time to check that for me.
    did you perhaps notice the time next to the yslow icon - Im getting 15 seconds for a 34kb image. Yslow give it perfect results, except for the time factor.

  11. Innate
    Member
    Posted 14 years ago #

    If I had a specific number of blogs in my mu install, lets say 50.
    I then create image folders for them, and create specific rewrite rules for each folder. Would I be able to remove the rewrite rule pointing to the blogs.php file?

  12. Innate
    Member
    Posted 14 years ago #

    would you believe this works! now just to figure out how to create the rewrite rules :-) but, what a huge improvement on the test. Rewrite is still working but not using the blogs.php file.

  13. kgraeme
    Member
    Posted 14 years ago #

    What this really appears to indicate is that your host has a CPU bound server. Yes, going through PHP will be slower than serving directly from the filesystem, but on a decent server the performance hit is negligible.

    If you can't change hosts, you might look into caching options before you go and modify the wordpress core (which will make upgrades a nightmare).
    http://codex.wordpress.org/WordPress_Optimization/Caching

    Along those lines, using a Content Distribution Network (CDN) is how the big guys handle file serving. It relocates your images and other files to some cloud based storage with network segment caches of the files for fast delivery. The W3 Total Cache plugin supports CDN as well as plugins specific to certain CDNs like Amazon S3.

About this Topic