Support » Plugin: W3 Total Cache » Slow log full of w3-total-cache lines

  • On my WordPress 4.9.9/PHP 7 based website I’m using W3TC latest version. But I have slowness during some operations.
    Digging in slow log I found most of them related to w3-total-cache files like:

    • w3-total-cache/Util_File.php:127
    • w3-total-cache/Util_File.php:143
    • w3-total-cache/Cache_File_Cleaner.php:100
    • w3-total-cache/Cache_File.php:165

    W3TC Configuration

    • Page cache: enabled (Disk:Basic)

      • Late initialization: enabled
      • Maximum lifetime of cache objects: 86400 seconds
      • Garbage collection interval: 86400 seconds
    • Object cache: enabled (Disk)

      • Default lifetime of cache objects: 86400 seconds
      • Garbage collection interval:86400 seconds
    • Database cache: disabled (MySQL query cache enabled)
    • Minify: disabled
    • Browser cache: enabled

    Use cases

    Case 1 (Saving Post):

    script_filename = /website/wp-admin/post.php
    [0x00007fee54816280] readdir() /website/wp-content/plugins/w3-total-cache/Util_File.php:127
    [0x00007fee54816020] rmdir() /website/wp-content/plugins/w3-total-cache/Util_File.php:141
    [0x00007fee54815dc0] rmdir() /website/wp-content/plugins/w3-total-cache/Util_File.php:141
    [0x00007fee54815b60] rmdir() /website/wp-content/plugins/w3-total-cache/Util_File.php:163
    [0x00007fee54815ad0] emptydir() /website/wp-content/plugins/w3-total-cache/Cache_File.php:280
    [0x00007fee54815970] flush() /website/wp-content/plugins/w3-total-cache/ObjectCache_WpObjectCache_Regular.php:411
    [0x00007fee548157c0] flush() /website/wp-content/plugins/w3-total-cache/CacheFlush_Locally.php:41
    [0x00007fee548156a0] objectcache_flush() /website/wp-content/plugins/w3-total-cache/CacheFlush.php:64
    [0x00007fee54815600] objectcache_flush() /website/wp-content/plugins/w3-total-cache/ObjectCache_Plugin.php:185
    [0x00007fee54815480] on_post_change() /website/wp-includes/class-wp-hook.php:286
    [0x00007fee54815390] apply_filters() /website/wp-includes/class-wp-hook.php:310
    [0x00007fee54815310] do_action() /website/wp-includes/plugin.php:453
    [0x00007fee548151e0] do_action() /website/wp-includes/post.php:5970
    [0x00007fee54815140] clean_post_cache() /website/wp-content/plugins/social-networks-auto-poster-facebook-twitter-g/inc/nxs_functions_wp.php:416
    [0x00007fee54815010] nxs_snapLogPublishTo() /website/wp-includes/class-wp-hook.php:286
    [0x00007fee54814f20] apply_filters() /website/wp-includes/class-wp-hook.php:310
    [0x00007fee54814ea0] do_action() /website/wp-includes/plugin.php:453
    [0x00007fee54814d60] do_action() /website/wp-includes/post.php:4128
    [0x00007fee54814c90] wp_transition_post_status() /website/wp-includes/post.php:3588
    [0x00007fee54814880] wp_insert_post() /website/wp-includes/post.php:3746

    Case 2 (Saving Tag):

    script_filename = /website/wp-admin/edit-tags.php
    [0x00007fe5e4e16310] unlink() /website/wp-content/plugins/w3-total-cache/Util_File.php:143
    [0x00007fe5e4e16220] rmdir() /website/wp-content/plugins/w3-total-cache/Util_File.php:141
    [0x00007fe5e4e16130] rmdir() /website/wp-content/plugins/w3-total-cache/Util_File.php:141
    [0x00007fe5e4e16040] rmdir() /website/wp-content/plugins/w3-total-cache/Util_File.php:163
    [0x00007fe5e4e15fb0] emptydir() /website/wp-content/plugins/w3-total-cache/Cache_File.php:280
    [0x00007fe5e4e15f00] flush() /website/wp-content/plugins/w3-total-cache/ObjectCache_WpObjectCache_Regular.php:411
    [0x00007fe5e4e15e30] flush() /website/wp-content/plugins/w3-total-cache/CacheFlush_Locally.php:41
    [0x00007fe5e4e15d10] objectcache_flush() /website/wp-content/plugins/w3-total-cache/CacheFlush.php:64
    [0x00007fe5e4e15c70] objectcache_flush() /website/wp-content/plugins/w3-total-cache/w3-total-cache-api.php:337
    [0x00007fe5e4e15be0] w3tc_objectcache_flush() /website/wp-content/plugins/wordpress-seo/inc/class-wpseo-utils.php:523
    [0x00007fe5e4e15b60] flush_w3tc_cache() /website/wp-includes/class-wp-hook.php:288
    [0x00007fe5e4e15a70] apply_filters() /website/wp-includes/class-wp-hook.php:310
    [0x00007fe5e4e159f0] do_action() /website/wp-includes/plugin.php:453
    [0x00007fe5e4e158b0] do_action() /website/wp-includes/option.php:401
    [0x00007fe5e4e15780] update_option() /website/wp-content/plugins/wordpress-seo/inc/options/class-wpseo-taxonomy-meta.php:554
    [0x00007fe5e4e156f0] save_tax_meta() /website/wp-content/plugins/wordpress-seo/inc/options/class-wpseo-taxonomy-meta.php:536
    [0x00007fe5e4e15630] save_clean_values() /website/wp-content/plugins/wordpress-seo/inc/options/class-wpseo-taxonomy-meta.php:465
    [0x00007fe5e4e15560] set_values() /website/wp-content/plugins/wordpress-seo/admin/taxonomy/class-taxonomy.php:179
    [0x00007fe5e4e15390] update_term() /website/wp-includes/class-wp-hook.php:286
    [0x00007fe5e4e152a0] apply_filters() /website/wp-includes/class-wp-hook.php:310

    Case 3 (Cron operation):

    script_filename = /website/wp-cron.php
    [0x00007fe5e4e14580] fopen() /website/wp-content/plugins/w3-total-cache/Cache_File_Cleaner.php:100
    [0x00007fe5e4e143b0] is_valid() /website/wp-content/plugins/w3-total-cache/Cache_File_Cleaner.php:77
    [0x00007fe5e4e14130] _clean() /website/wp-content/plugins/w3-total-cache/Cache_File_Cleaner.php:76
    [0x00007fe5e4e13eb0] _clean() /website/wp-content/plugins/w3-total-cache/Cache_File_Cleaner.php:76
    [0x00007fe5e4e13c30] _clean() /website/wp-content/plugins/w3-total-cache/Cache_File_Cleaner.php:48
    [0x00007fe5e4e13b80] clean() /website/wp-content/plugins/w3-total-cache/PgCache_Plugin_Admin.php:90
    [0x00007fe5e4e13900] cleanup_local() /website/wp-content/plugins/w3-total-cache/PgCache_Plugin_Admin.php:67
    [0x00007fe5e4e13820] cleanup() /website/wp-content/plugins/w3-total-cache/PgCache_Plugin.php:130
    [0x00007fe5e4e137b0] cleanup() /website/wp-includes/class-wp-hook.php:286
    [0x00007fe5e4e136c0] apply_filters() /website/wp-includes/class-wp-hook.php:310
    [0x00007fe5e4e13640] do_action() /website/wp-includes/plugin.php:515
    [0x00007fe5e4e13560] do_action_ref_array() /website/wp-cron.php:126

    Case 4:

    script_filename = /website/index.php
    [0x00007fe5e4e14fe0] fread() /website/wp-content/plugins/w3-total-cache/Cache_File.php:165
    [0x00007fe5e4e14ec0] _get_with_old_raw() /website/wp-content/plugins/w3-total-cache/Cache_File.php:136
    [0x00007fe5e4e14de0] get_with_old() /website/wp-content/plugins/w3-total-cache/Cache_Base.php:96
    [0x00007fe5e4e14d10] get() /website/wp-content/plugins/w3-total-cache/ObjectCache_WpObjectCache_Regular.php:157
    [0x00007fe5e4e14bb0] get() /website/wp-content/plugins/w3-total-cache/ObjectCache_WpObjectCache.php:36
    [0x00007fe5e4e14ae0] get() /website/wp-content/object-cache.php:52
    [0x00007fe5e4e14a20] wp_cache_get() /website/wp-includes/meta.php:818
    [0x00007fe5e4e14840] update_meta_cache() /website/wp-includes/taxonomy.php:1256
    [0x00007fe5e4e147b0] update_termmeta_cache() /website/wp-includes/class-wp-term-query.php:696
    [0x00007fe5e4e14370] get_terms() /website/wp-includes/class-wp-term-query.php:288
    [0x00007fe5e4e142e0] query() /website/wp-includes/taxonomy.php:1099
    [0x00007fe5e4e141a0] get_terms() /website/wp-content/plugins/wordpress-seo/inc/sitemaps/class-taxonomy-sitemap-provider.php:61
    [0x00007fe5e4e13fb0] get_index_links() /website/wp-content/plugins/wordpress-seo/inc/sitemaps/class-sitemaps.php:360
    [0x00007fe5e4e13e70] build_root_map() /website/wp-content/plugins/wordpress-seo/inc/sitemaps/class-sitemaps.php:314
    [0x00007fe5e4e13da0] build_sitemap() /website/wp-content/plugins/wordpress-seo/inc/sitemaps/class-sitemaps.php:229
    [0x00007fe5e4e13ce0] redirect() /website/wp-includes/class-wp-hook.php:286
    [0x00007fe5e4e13bf0] apply_filters() /website/wp-includes/class-wp-hook.php:310
    [0x00007fe5e4e13b70] do_action() /website/wp-includes/plugin.php:515
    [0x00007fe5e4e13a90] do_action_ref_array() /website/wp-includes/class-wp-query.php:1634
    [0x00007fe5e4e13390] get_posts() /website/wp-includes/class-wp-query.php:3230
Viewing 3 replies - 1 through 3 (of 3 total)
  • Here is another case, clicking on Save Settings & Purge Caches:

    slow.log:

    [29-Jan-2019 10:49:11.180642]  [pool mywebsite.com] pid 18293
    script_filename = /website/wp-admin/admin.php
    [0x00007f2b0f4186b0] is_dir() /website/wp-content/plugins/w3-total-cache/Util_File.php:140
    [0x00007f2b0f4185c0] rmdir() /website/wp-content/plugins/w3-total-cache/Util_File.php:141
    [0x00007f2b0f4184d0] rmdir() /website/wp-content/plugins/w3-total-cache/Util_File.php:163
    [0x00007f2b0f418440] emptydir() /website/wp-content/plugins/w3-total-cache/Cache_File.php:280
    [0x00007f2b0f418390] flush() /website/wp-content/plugins/w3-total-cache/ObjectCache_WpObjectCache_Regular.php:411
    [0x00007f2b0f4182c0] flush() /website/wp-content/plugins/w3-total-cache/CacheFlush_Locally.php:41
    [0x00007f2b0f418190] objectcache_flush() /website/wp-includes/class-wp-hook.php:286
    [0x00007f2b0f4180a0] apply_filters() /website/wp-includes/class-wp-hook.php:310
    [0x00007f2b0f418020] do_action() /website/wp-includes/plugin.php:453
    [0x00007f2b0f417f00] do_action() /website/wp-content/plugins/w3-total-cache/CacheFlush_Locally.php:212
    [0x00007f2b0f417ce0] flush_all() /website/wp-content/plugins/w3-total-cache/CacheFlush.php:158
    [0x00007f2b0f417c10] flush_all() /website/wp-content/plugins/w3-total-cache/Generic_AdminActions_Default.php:177
    [0x00007f2b0f417ab0] w3tc_default_save_and_flush() /website/wp-content/plugins/w3-total-cache/Root_AdminActions.php:25
    [0x00007f2b0f417880] execute() /website/wp-content/plugins/w3-total-cache/Generic_Plugin_Admin.php:159
    [0x00007f2b0f417620] load() /website/wp-includes/class-wp-hook.php:286
    [0x00007f2b0f417530] apply_filters() /website/wp-includes/class-wp-hook.php:310
    [0x00007f2b0f4174b0] do_action() /website/wp-includes/plugin.php:453
    [0x00007f2b0f417390] do_action() /website/wp-admin/admin.php:214

    error.log:

    2019/01/29 10:52:07 [error] 10021#10021: *57609 recv() failed (104: Connection reset by peer) while reading response header from upstream, 
    client: XXX.XX.XXX.XX, server: www.mywebsite.com, 
    request: "POST /wp-admin/admin.php?page=w3tc_pgcache HTTP/1.1", 
    upstream: "fastcgi://unix:/var/run/php/php7.0-fpm.mywebsite.com.sock:", host: "www.mywebsite.com", 
    referrer: "https://www.mywebsite.com/wp-admin/admin.php?page=w3tc_pgcache"
    Plugin Support Marko Vasiljevic

    (@vmarko)

    Hello,
    When you use Disk cache engine – naturally cleaning cache when requires will take time depending on the size of your cache. More items – more time. If your cache is too big that system can’t remove all those files in acceptable time – use have to use less caching or use memory-based cache engines.

    I’m aware of this but, with about 15MiB to 20MiB of page cache I think this is not so much. Is there any way to fine tune purge cache procedures?

    This is my configuration:
    Specify the pages and feeds to purge when posts are created, edited, or comments posted.

    • Front page
    • Posts page
    • Post page

    Slowness on saving Tags and Posts render Admin unusable, contrary of what is reported here: https://wordpress.org/plugins/w3-total-cache/#will%20this%20plugin%20speed%20up%20wp%20admin%3F

    I’m using Maximum lifetime and Garbage collection interval of 86400 seconds to avoid garbage collection caused slowness to interfere with editing operations.

    Is there any way to limit disk caches size, like a size threshold? Maybe in pro version? Or a way to defer purge to cron on save?

    Object cache size is around 1GiB.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Slow log full of w3-total-cache lines’ is closed to new replies.