WordPress.org

Ready to get started?Download WordPress

Forums

W3 Total Cache
Google's mod_pagespeed and W3 (29 posts)

  1. jani-u
    Member
    Posted 3 years ago #

    Has anyone tried out the new mod_pagespeed together with W3 total cache? Are there any conflicts to be expected since they are doing some similar things?
    http://code.google.com/speed/page-speed/docs/module.html

  2. Eddie - Digital Marketing Consultant
    Member
    Posted 3 years ago #

    good question. my guess is that mod_pagespeed is a better choice between the two, given that it is compiled code. So, if you can install the mod, do it. I bet that W3 total cache's performance boost, when running in addition to the mod, will be negligible (if any)...

  3. Frederick Townes
    Member
    Plugin Author

    Posted 3 years ago #

    I bet that W3 total cache's performance boost, when running in addition to the mod, will be negligible (if any).

    False.

    Not so fast (no pun intended), as you can see (evidently there are scale/performance issues as it takes >8 seconds before Google's web server responds to a request for a page that's ~2K); things are not so simple.

    If you have W3 Total Cache you do not need mod_pagespeed. Furthermore, mod_pagespeed does not:

    • Optimize WordPress' performance w/r/t generating pages/posts/feeds on-the-fly
    • Integrate with any content delivery network
    • Support Nginx which is a better performing web server than Apache (in this case)
    • Provide granular controls for minification of HTML, CSS or JavaScript, which means that it's quite easy for sites to be broken unless they are tuned (manually modified) for mod_pagespeed's policies/behaviors
    • Provide control over the caching policies themselves, which actually need to be different for most sites
    • Preload pages from the site to cache them and allow the server to scale further
    • Minify 3rd party CSS or JavaScript
    • Import 3rd party images (attachments) so you can control the caching policy they follow
    • Respect HTML comments used by screen readers (for the disabled) or for Google AdSense targeting for example
    • Optimize respective themes, nor give you control over which user agents you show them to (e.g. mobile themes)
    • Optimize progressive render performance of a given page
    • Allow grouping of JavaScript files into various (asynchronously) embed locations to give more control over initial render time, which is a key factor in improving time on site and user engagement
    • Respect the uniqueness of each site on the web. There are still numerous other features that have not yet been released for W3 Total Cache that a web server module cannot deliver in an automated fashion

    Make no mistake, there are lots of seemingly similar solutions for optimizing web sites and what Google is doing is not actually a new thing. There will never be a replacement for optimizing the application itself and for providing granular control over the same.

    In the end, if every site were the same and performance problems easy to resolve, web hosting companies would either have all applied some standard solution about 10+ years ago or all be advertising their unique solutions to this problem to differentiate themselves from the rest.

  4. wbervoets
    Member
    Posted 3 years ago #

    evidently there are scale/performance issues as it takes >8 seconds before Google's web server responds to a request for a page that's ~2K

    8 seconds? It's only 0.5 seconds with me?

    For WordPress + W3 Total Cache I think you'll not win much with mod_pagespeed (I didn't look in detail if Google is doing some things not yet implemented by W3 Total Cache).

    But I'll surely install mod_pagespeed for my non-wordpress sites. (eg. phpBB forum, java, ...) which don't have the excellent W3 Total Cache features available because it's not wordpress...

    Wim

  5. Frederick Townes
    Member
    Plugin Author

    Posted 3 years ago #

    8 seconds? It's only 0.5 seconds with me?

    Dunno, not sure why that happened.

  6. Jeremy Winter
    Member
    Posted 3 years ago #

    I tested out mod_pagespeed with W3-total-cache and after about a hour apache stopped serving pages. The same thing happened to another user testing out mod_pagespeed with w3-total-cache. I also noticed that my cpu usage and disk IO both spiked right when apache crashed.

    I would be interested in hearing from others experience as well, but at the moment I would advise anyone testing the two to not assume apache will not crash eventually with mod_pagespeed.

  7. Frederick Townes
    Member
    Plugin Author

    Posted 3 years ago #

    @Jeremy Winter, it would be interesting to know what your settings were for W3TC and mod_pagespeed.

  8. Jeremy Winter
    Member
    Posted 3 years ago #

    @Frederick
    I was running mod_pagespeed as default with all corefilters enabled. For W3TC
    Page Cache: Disk(enhanced)
    Minify: Disk
    Database Cache: Opcode - APC
    Object Cache: Opcode - APC
    CDN: Disabled
    Browser Cache: Enabled

    I can post my W3TC config export if you are looking for more details.

  9. Frederick Townes
    Member
    Plugin Author

    Posted 3 years ago #

    Well yes, that would be more useful. Also the settings for mod_pagespeed.

  10. Jeremy Winter
    Member
    Posted 3 years ago #

  11. Frederick Townes
    Member
    Plugin Author

    Posted 3 years ago #

    Interesting. Why haven't you used more mod_pagespeed options? What does your site's MRTG for load and transfer look like?

  12. moikirsch
    Member
    Posted 3 years ago #

    I tried it for a few minutes with my host (dreamhost) but I started to get some garbage code and decided to deactivate mod_pagespeed for the moment.

    It is a low trafic website right now so I rather stick with W3TC for now and wait a little to see the improvements and some comments from people who actually know what their doing.

    But if it helps, I would gladly turn it on again for a day and show the results.

  13. Jeremy Winter
    Member
    Posted 3 years ago #

    @Frederick I was using the default CoreFilter set as it is default and are "generally safe for most web pages". The way I understand this is that the ModPagespeedRewriteLevel can be set to the CoreFilters or PassThrough setting. PassThrough simply allows you to select which filters you wish to use selectively. CoreFilters is a select set of filters that the developers thought were ready for mainstream.

    Most of the other settings are actually not very important, according to the support over at the mod_pagespeed page at Google Code. You don't have to set the ModPagespeedDomain for example.

    I'm still not convinced that this problem has anything to do with W3TC, it's more likely a bug that will be needed to be worked out with mod_pagespeed.

    Oh and my load and transfer is usually fairly minimal, when Apache crashed though, I had a big spike in cpu usage (relative to normal) and Disk IO. Apparently there is to be some expected cpu and DiskIO overhead with mod_pagespeed so this may or may not have been a direct part of the problem.

    *Update - I just took a look at the FAQ on the mod_pagespeed site and there is a new entry about WordPress.

    I am using WordPress and my log is filled with errors and my pages are blank
    Disable compression in the WordPress plugin, so that mod_pagespeed will process uncompressed HTML. mod_pagespeed automatically adds mod_deflate to the filter after running, so the optimized HTML will be compressed before serving.

    I will do some testing and report back.

  14. Jeremy Winter
    Member
    Posted 3 years ago #

    I disabled compress as per the FAQ, but still resulted in a unresponsive server. Mod_pagespeed just released a new version via SVN that reportedly fixes some of these bugs, but I will not be checking it out at this time. If anyone else builds the new release. feel free to share your results.

    At least we can confirm the issues have nothing to do with W3TC.

  15. Andy Beard
    Member
    Posted 3 years ago #

    If you really want to test out mod_pagespeed, pop over to the mailing list and there is a reference there for a proxy.

    http://torbit.com/proxy.php

    In testing a test page on my site that is fairly well configured the proxy mod_pagespeed caused a 4 point decrease in my PageSpeed 1.9 score :)

    As in it went down from 92 to 88

    As far as I can see it doesn't give you any advantage over w3tc and the effort to set it up is far more than w3tc.

  16. Sujay
    Member
    Posted 3 years ago #

    Yet is there any harm to using both? I see benefits to features in both. I've not encountered any errors or issues so far, but I'd just like to know what the official word is.

  17. Frederick Townes
    Member
    Plugin Author

    Posted 3 years ago #

    There will never be a final word because as I indicated above mileage varies and in the end optimizing the application "from within" the application (if you will), is the place to start. So for that reason once W3TC is tuned everything else is superfluous.

  18. Andy Beard
    Member
    Posted 3 years ago #

    Little case study for you from last night.

    A friend was working on site optimization for a relatively new and "light" blog.

    He is on shared hosting and isn't yet using a CDN (though he probably will be within the next 24 hours.

    He was hovering around the 3 second mark for starting to render just using the disk page cache from W3TC which is what most reviews of the plugin cover.

    He can't really influence his time to first byte on a shared hosting plan other than to serve a static page, so he thought there wasn't much more he could do.

    I pursuaded him to dig into the minification options.

    The site: http://docsheldon.com/
    Webpage speed test: http://www.webpagetest.org/result/101107_AYMY/

    0.857 seconds to start rendering on IE7 which is a worst case scenario.

    From time to first byte to start rendering we knocked about 1.5 seconds off the load time. The remaining .5 second is due to differences in server load and time to first byte.

    There are still some modest improvements to be made.

    I doubt 1/1000 W3TC users have exhausted the possibilities of using W3TC.

  19. Frederick Townes
    Member
    Plugin Author

    Posted 3 years ago #

    Thanks Andy, that's helpful feedback.

  20. j_marantz
    Member
    Posted 3 years ago #

    Hi,

    Frederick Townes has a number of good points. In particular, mod_pagespeed will not optimize the wordpress content generation flow.

    However, there are a few points I feel it's important to comment on, but I'd like to focus on the most important of these, which is the way mod_pagespeed extends cache lifetimes:

    'Extend Cache' seeks to improve the cacheability of a web page's resources without compromising the ability of the site owner to change the resources and have those changes propagate to users' browsers.

    Please read http://code.google.com/speed/page-speed/docs/filter-cache-extend.html to get an understanding of how this works.

    Frederick's point, "Provide control over the caching policies themselves, which actually need to be different for most sites", highlights the classic compromise between cache TTL and the ability to quickly propagate changes, that mod_pagespeed solves without compromising either.

    This has been an incredible win for mod_pagespeed in testing repeated page views.

  21. Frederick Townes
    Member
    Plugin Author

    Posted 3 years ago #

    "Provide control over the caching policies themselves, which actually need to be different for most sites", highlights the classic compromise between cache TTL and the ability to quickly propagate changes, that mod_pagespeed solves without compromising either.

    The case assumes that the origin server is used to handle static image requests, with complete use of W3TC, that is no longer the case. W3TC provides purge options for attachments in posts to ensure that the CDN is always delivering the latest version of an attachment and automatically purges any changes to existing files. Some techiques/technologies exist for the CDN to "rewrite" the file names of objects, but implementation is non-trivial at the moment.

    As for the origin, I do not endorse using the origin for static files for numerous reasons, so I have deliberately chosen not to pursue this "win" as on shared hosting (or under-powered hosting), the performance compromise realizes diminishing returns.

  22. xhtmlvalid
    Member
    Posted 3 years ago #

    mod_pagespeed is still beta and had some nasty bugs.

    I would not use it until those bugs are fixed. Besides that, W3TC and mod_pagespeed are 2 different worlds.

    Optimizing WP is not the same as optimizing Apache.

    If you run e.g. mod_deflate on your Apache there is no need to run mod_pagespeed. If you know how to code (X)HTML correctly you don't need it at all. If you knnow how to build optimized sites (JS/CSS/Images) there is no need for mod_pagespeed.

  23. Frederick Townes
    Member
    Plugin Author

    Posted 3 years ago #

    Besides that, W3TC and mod_pagespeed are 2 different worlds.

    Optimizing WP is not the same as optimizing Apache.

    There you go. That's the bottom line.

    If you run e.g. mod_deflate on your Apache there is no need to run mod_pagespeed

    It's not as simple as that because mod_deflate does not cache the files it creates, it's always compressing on-the-fly, unlike the deprecated mod_gzip. So using mod_deflate "out-of-the-box" without using W3 Total Cache for example will speed up your site while reducing the scale of your web server.

    Again, it all goes back to tuning applications to "unlock" server performance - inside out, not outside in.

  24. xhtmlvalid
    Member
    Posted 3 years ago #

    As I said, my friend... mod_pagespeed does not speed up WP ;)

    Your W3TC is doing excellent work (I can handle the problems I have with W3TC).

  25. Frederick Townes
    Member
    Plugin Author

    Posted 3 years ago #

    I just made those comments for people who don't already know. :)

  26. NerdInProgress
    Member
    Posted 3 years ago #

    I tried mod_pagespeed yesterday on a VPS - Ubuntu SE + Apache. A rough "first feel":

    CPU usage started rising steadily. Must admit that I was quite happy with how the site was running, and added pagespeed only because I heard it compresses images. (hint, hint)

    Installed, did something else for a while, saw the spike, disabled. I suppose the pages rendered fairly well, but didn't see anything mindbogglingly amazing. Not providing any data because I didn't stick with it long enough to generate anything reliable. Saw CPU spiking rapidly and that was that for me. Enhancements are for websites, not for crashing the servers. If nothing the defaults need to be set safer till people can configure them.

    If I test/tweak, I will update. At the moment, w3tc is doing just fine

  27. NerdInProgress
    Member
    Posted 3 years ago #

    FWIW, With w3tc, apc, memcache and varnish already, I don't anticipate pagespeed delivering miraculous improvement. The only thing remaining is the images. Seriously.

    Also, I am concerned with the compression of pagespeed, though I did not test it. I have seen that some scripts don't combine/minify happily. What will pagespeed do to them? If someone can share their experience, that would be good.

  28. j_marantz
    Member
    Posted 3 years ago #

    Hi NerdInProgress,

    mod_pagespeed doesn't aim for miracles; it aims for rigorous automated application of web best practices without impacting or altering your origin content or deployment flow. To the extent that your flow already exhibits the best practices, mod_pagespeed may not offer much.

    However, for a large number of sites on the net, including many using w3tc, mod_pagespeed finds opportunity for improvement. For a sampling of speed-up data from the 60k web sites that have installed mod_pagespeed, please see my Google IO talk, including video & slides: http://www.google.com/events/io/2011/sessions/make-the-web-faster.html

    We'd love to resolve the cpu spike. One thing that would help is some data:

    • to what extent did it spike? What was the load average? Did the cpu-load impact the performance as seen from a browser?
    • Was the spike transient or does it last a long time?
    • You mentioned you saw the main value being image optimization. Does your site have a lot of image content? Can you give the URL to your site?
    • Transient load average increases are a known issue with a cold server-side cache. However, once all the optimized images are cached the load should decay to a reasonable steady-state. Once the cache is warm (assuming it's large enough), much more content will be purely cacheable in browser-caches and any CDNs or other proxies serving your content, thus reducing the steady-state server load. We are working on reducing the transient load issues by throttling image rewrites.
    • Other causes of load in mod_pagespeed are usually related to server setup, DNS, and other networking issues associated with mod_pagespeed issuing HTTP client requests back to the same server. There are usually simple solutions to this problem and we are working on improvements that will reduce the frequency and severity of them by default. Please see the faq: http://code.google.com/p/modpagespeed/wiki/FAQ

    Also you'll get more help from the mod_pagespeed community -- should you be interested in pursuing it -- if you post questions at http://groups.google.com/group/mod-pagespeed-discuss or raise issues at http://code.google.com/p/modpagespeed/issues/list . I only saw this because I contributed to the thread above.

    Note also that we are working on adding more functionality to mod_pagespeed. We recently added domain-sharding and Javascript combining. We are working on -- but have not released -- image spriting. Techniques that are specific to the mobile experience are also in the works -- we already have in place a growing database of mobile user-agents so that we can generate content optimized for the client.

    Having said this, I want to state that I believe strongly that W3TC and mod_pagespeed are complementary. There was a comment earlier on this thread that described mod_pagespeed as an alternative but that is not the intent. Clearly generating great content at the origin is the first step toward high-performance web-sites, and only benefits mod_pagespeed by forcing it to do less work.

  29. NerdInProgress
    Member
    Posted 3 years ago #

    Hey, thanks for your very detailed reply. It makes me understand things better. I am a bit leery of spikes, since I recently was harassed off a server with CPU usage as the main reason for the site to be suspended. I may have overreacted.

    I will keep this information in mind, and when I have a day or two off, I will personally monitor the website when I run pagespeed and respond with more practical information.

    My site is not image heavy as such nor is it a big problem, but images have consistently been one area of low score historically, since I often forget to compress. So it was tempting that this can be automated, that is all.

    My site is at http://aamjanata.com There are other sites as well on this server - all running WP, but they are configured similar and perform similar.

    I am amazed and appreciate that you found this post and took the time to attend this. This, more than anything else gives me the confidence to try it trusting that I can get help fast if things go bad.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic