• I’ve switched from disk to memcached on all Cache options. Due to my PHP version, my only available options are Disk or Memcached. I’m on a dedicated web server that runs mysql queries to a remote server.

    I have WordPress installed on sub folder, and it’s a sub page to main site. The main site uses Memcached and does about 100x the traffic the WordPress pages do.

    So, it’s odd that when I turn on “Page Cache” to Memcache that it doesn’t take all that long for Memcache to crash and need to be reset. I can’t figure out why, considering my WordPress area only has about 50 posts at the moment. I can’t believe something so small can be so problematic.

    I could go back to Disk Enhanced, but I’d really love to use my server’s memory instead.

    Anybody else encounter such an issue?

    Cheers!
    Ryan

Viewing 8 replies - 1 through 8 (of 8 total)
  • @casbboy

    Are you using php5-memcache or php5-memcached?

    Thread Starter casbboy

    (@casbboy)

    Not sure…

    memcache support enabled
    Version 3.0.8
    Revision $Revision: 329835 $
    Directive Local Value Master Value
    memcache.allow_failover 1 1
    memcache.chunk_size 32768 32768
    memcache.compress_threshold 20000 20000
    memcache.default_port 11211 11211
    memcache.hash_function crc32 crc32
    memcache.hash_strategy consistent consistent
    memcache.lock_timeout 15 15
    memcache.max_failover_attempts 20 20
    memcache.protocol ascii ascii
    memcache.redundancy 1 1
    memcache.session_redundancy 2 2

    If that doesn’t help, here’s the call I use on the primary site to prep for requests:

    define('MEMCACHED_HOST', '127.0.0.1');
    				define('MEMCACHED_PORT', '11211');
    				 
    				// Connection creation
    				$memcache = new Memcache;
    				$cacheAvailable = $memcache->connect(MEMCACHED_HOST, MEMCACHED_PORT);

    Thanks
    Ryan

    @luke it’ll be php-memcache. wordpress’ w3tc download only supports memcache. However, I recently added support for php-memcached in the w3tc community-build since it seems memcache will never be php7 supported (i could be wrong). So at least memcached can now be an additional option for all (esp php7 users).

    Anyway @casbboy

    Can you enable debug mode. I am curious to know if there are any errors being triggered.

    To enable debug mode — in your wp-config.php:
    Change

    
    define('WP_DEBUG', false);

    to

    
    define('WP_DEBUG', true);
    define('WP_DEBUG_DISPLAY', false);
    define('WP_DEBUG_LOG', true);
    @ini_set('display_errors',0);

    This will create a file called debug.log inside the /wp-content folder. Now, just run through your routine to make your memcached server crash (is that what u mean crashed?) and then check this file to see if anything was logged.

    • This reply was modified 8 years, 6 months ago by Kimberly.
    Thread Starter casbboy

    (@casbboy)

    It’s like the server was listening. The memcache just went down again. Had to go into SSH to restart it. So odd. I am Minify/Object/Database to Memcache in WordPress.

    Primary site stores all database results into array, then memcache.

    I’ll setup the debug.

    Cheers
    Ryan

    @amiga500

    Good to know that the community version supports memcached.

    Thread Starter casbboy

    (@casbboy)

    have a 5MB log file:

    Most common errors:

    [12-Sep-2016 21:58:46 UTC] PHP Notice: is_page was called incorrectly. Conditional query tags do not work before the query is run.

    [12-Sep-2016 21:58:46 UTC] PHP Notice: The called constructor method for WP_Widget in MY_PostWidget is deprecated since version 4.3.0! Use

    __construct()

    instead.

    [12-Sep-2016 23:00:51 UTC] PHP Warning: mysqli_query(): MySQL server has gone away

    I’m not sure why MySQL server has gone away considering that the server claims it has been up no issue all day, so not sure why that would appear in log.

    I did a search for memcache and not seeing anything with that.

    Thread Starter casbboy

    (@casbboy)

    Memcache crashed again, but still not seeing any errors reporting in the log file that would relate.

    Thread Starter casbboy

    (@casbboy)

    I hate doing it. But running all cacheing through W3 to Disk again. No issues and my Memcache is once again running fine as it controls the entire site.

    Would love to only use Memcache for sub wordpress pages too, but afraid of it just crashing the memcache service after enabling.

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Page Cache to Memcached is crashing Memcached’ is closed to new replies.