Images display for 3-4 seconds then disappear (Multisite, Nginx, php-fpm, memcache)

Hi Everyone,

I'm having a crazy problem that I'm hoping someone has seen before. All media on my 3.1.1 Multisite (sub-domain config) WP install will show for 2-4 seconds then disappear (showing a broken link in place when the item does disappear).

I can refresh the page, and the images will reappear and then disappear again after 2-4 seconds (again, leaving a broken link). If I stop the execution of the page (specifically in the media library) the images continue to display.

My nginx log shows this error:
*46 recv() failed (104: Connection reset by peer) while reading response header from upstream, client: 69.164.167.146, server: *.site.com, request: "GET /files/2011/04/iStock_000000059184XSmall-150x150.jpg HTTP/1.1", upstream: "fastcgi://unix:disappointed:var/run/php5-fpm.socket:"

I'm using :
Nginx 0.9.5
php-fpm 5.3.5 (downgraded from 5.3.6 to validate that wasnt the issue)
memcached
memcache object cache plugin for WP

I'll post my configs if necessary, but was first wondering if anyone has seen any behavior like this.

Thanks -- banging my head against the wall

  • LexBlog
    • Design Lord, Child of Thor

    Thanks Barry, I started gathering this information, then went all A.D.D. on myself. I dug into strace and got further information.

    This is an actual issue with WP, and documented here: http://wordpress.org/support/topic/wordpress-30-multisite-mode-and-object-cache-with-memcached-not-showing-images.

    The fix was to move (from about line 260 of the wp-settings.php file):
    register_shutdown_function( 'shutdown_action_hook' );

    to be above line 97:
    if ( SHORTINIT )
    return false;

    So the finished update looks like this:

    95 // Moved shutdown here to handle imagees better
    94 register_shutdown_function( 'shutdown_action_hook' );
    95
    96 // Stop most of WordPress from being loaded if we just want the basics.
    97 if ( SHORTINIT )
    98 return false;
    99

    I'm sure this will be helpful for others, as I spent the last 30 hours trying to track this down.

  • bhaun
    • WPMU DEV Initiate

    *46 recv() failed (104: Connection reset by peer) while reading response header from upstream, client: 69.164.167.146, server: *.site.com, request: "GET /files/2011/04/iStock_000000059184XSmall-150x150.jpg HTTP/1.1", upstream: "fastcgi://unix:disappointed:var/run/php5-fpm.socket:"

    On a possibly unrelated note make sure you check your timeout settings for fastcgi in nginx. This error will creep up more and more often when anything upstream of nginx times out. The defaults can be to short.

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.