Wednesday, November 03, 2010

Make your websites run faster, automatically -- try mod_pagespeed for Apache

Last year, as part of Google’s initiative to make the web faster, we introduced Page Speed, a tool that gives developers suggestions to speed up web pages. It’s usually pretty straightforward for developers and webmasters to implement these suggestions by updating their web server configuration, HTML, JavaScript, CSS and images. But we thought we could make it even easier -- ideally these optimizations should happen with minimal developer and webmaster effort.

So today, we’re introducing a module for the Apache HTTP Server called mod_pagespeed to perform many speed optimizations automatically. We’re starting with more than 15 on-the-fly optimizations that address various aspects of web performance, including optimizing caching, minimizing client-server round trips and minimizing payload size. We’ve seen mod_pagespeed reduce page load times by up to 50% (an average across a rough sample of sites we tried) -- in other words, essentially speeding up websites by about 2x, and sometimes even faster.

(Video comparison of the AdSense blog site with and without mod_pagespeed)

Here are a few simple optimizations that are a pain to do manually, but that mod_pagespeed excels at:

  • Making changes to the pages built by the Content Management Systems (CMS) with no need to make changes to the CMS itself,
  • Recompressing an image when its HTML context changes to serve only the bytes required (typically tedious to optimize manually), and
  • Extending the cache lifetime of the logo and images of your website to a year, while still allowing you to update these at any time.

We’re working with Go Daddy to get mod_pagespeed running for many of its 8.5 million customers. Warren Adelman, President and COO of Go Daddy, says:

"Go Daddy is continually looking for ways to provide our customers the best user experience possible. That's the reason we partnered with Google on the 'Make the Web Faster' initiative. Go Daddy engineers are seeing a dramatic decrease in load times of customers' websites using mod_pagespeed and other technologies provided. We hope to provide the technology to our customers soon - not only for their benefit, but for their website visitors as well.”

We’re also working with Cotendo to integrate the core engine of mod_pagespeed as part of their Content Delivery Network (CDN) service.

mod_pagespeed integrates as a module for the Apache HTTP Server, and we’ve released it as open-source for Apache for many Linux distributions. Download mod_pagespeed for your platform and let us know what you think on the project’s mailing list. We hope to work with the hosting, developer and webmaster community to improve mod_pagespeed and make the web faster.

49 comments:

  1. This comment has been removed by the author.

    ReplyDelete
  2. nice... look forward to playing with it

    ReplyDelete
  3. Do you guys have a testbed with and without mod_pagespeed accessible externally, so users can try and "feel" the effects on their environments?

    ReplyDelete
  4. Will this be turned on automatically for all existing blogspot blogs?

    ReplyDelete
  5. Nice to know. Looking for it ahead.

    ReplyDelete
  6. Any plans to support Apache 2.2 on windows?

    ReplyDelete
  7. I'm very happy about which Linux flavors you have tested. The server for our website, and it's test and dev servers as well, are based on CentOS and my desktop (and development environment) is on Ubuntu =)

    I will be trying it this weekend :D Thanks

    ReplyDelete
  8. Fantastic. I wonder if you could set it up to work with Dreamhost too - I know you partner with them for other things.

    ReplyDelete
  9. Installed :D, lets see how this handles!

    ReplyDelete
  10. Is this anything like page speed for firefox - it seems like it has been improved or am i wrong?
    I would love to try it but don`t know if it would work on my site http://www.makeasizzlingwebsite.com that i host on Webs.com. If you expand on this post be sure to let me know.
    Looking forward to trying it.

    ReplyDelete
  11. Get this on Bluehost too please! I'll make sure to ping them about it too!

    ReplyDelete
  12. Very nice glad to see Google's money going towards projects that make the web a better. will be measuring the change with analytics event tracking.

    ReplyDelete
  13. That's great! Nice initiative!

    ReplyDelete
  14. WTB Gentoo ebuild for this...

    ReplyDelete
  15. Nice work Google!! I wanna try it!!

    ReplyDelete
  16. You should link to those 15 filters in your post: http://code.google.com/speed/page-speed/docs/filters.html

    ReplyDelete
  17. It would be great to see something like this for lightty as well.

    ReplyDelete
  18. I am a professional wedding photographer - and have been looking at solutions to speed up my websites.

    Extending the cache lifetime of the images on my site sounds great, but I am concerned about the recompression of my images. Will any image degradation be apparent? Will this still happen if I optimize my images manually prior to publishing?

    Cheers,
    Dan

    www.danoksnevadphotography.com
    www.danoksnevadphotography.com/blog

    ReplyDelete
  19. Will Windows be supported?

    Repeat: but trying to give some weight!

    ReplyDelete
  20. Please support FreeBSD.

    Regards,

    ReplyDelete
  21. Does it work on Gentoo Base System version 1.6?

    ReplyDelete
  22. This comment has been removed by the author.

    ReplyDelete
  23. how it will be possible and is there is any trick is available ?

    ReplyDelete
  24. I'm surprised no one has asked this yet...

    The module may be good on a per-page basis, however what's the overhead on the server?

    Surely doing all these on-the-fly modifications to your output will have en effect on your overall server-level performance?

    Does this module only have a place on shared hosting platforms rather than high performance bespoke platforms?

    ReplyDelete
  25. How long has this Apache module be in use on production servers so far? Would be cautious of chucking this on an important sites server if its fresh out the door with no real world usage yet.

    ReplyDelete
  26. This is very cool and funny timing: just posted slides from a recent talk I gave on Web UI performance tuning: http://www.slideshare.net/apemberton/ui-performance-tuning

    ReplyDelete
  27. Installed 64bit version on Ubuntu running Apache 2.2.8 this evening early tests seem promising using an ecommerce site on the server as a testbed http://www.jndarts.com 14.1 secs without 9.7 with. Strange things happen if you reload the same page though 5.1 without 8.1 with. Tested using Pingdom tools

    ReplyDelete
  28. ok good job google it uses all the speed up filters you need. Easy to use for none linux gurus.

    www.up2city.de 1.02 seconds without
    0.90 seconds

    but i already patched our server! so its ok

    @mick 14,1 !!!!! thats too much !! change the hoster or using php cache...

    ReplyDelete
  29. first error
    ERROR:googleurl_noicu/url_canon_noicu.cc ReadUTFChar not supported (non-icu build)
    at two server

    one use UTF8 one Iso as Charset

    ReplyDelete
  30. As Coops pointed out, I would be hesitant to placing this on shared servers. It seems to be that doing all that on the fly processing is going to significantly increase the overhead on the server itself.

    ReplyDelete
  31. Very nice and impressive article you have posted. Its very helpful, i have read and bookmark this site and will recommend it to more other peoples.
    Lizard Labs

    ReplyDelete
  32. I tried this on my server. Ubuntu 10.10 64 bit running Apache2. Seemed to work okay but some requests would just hang randomly. I never had that problem. I disabled mod_pagespeed and the hanging problem went away. Any idea what could be causing this?

    ReplyDelete
  33. This comment has been removed by the author.

    ReplyDelete
  34. Personally, I like Varnish. http://www.varnish-cache.org/

    ReplyDelete
  35. I'll try it too on a CentOS server that is powering an online game http://www.raceconflicts.com and let you know how it goes.
    Have high hopes in this couse speed is very important for me.

    ReplyDelete
  36. I'm not so crazy to run that mod on my producttion server ;) Right now I installed the mod on my local testing server (Ubuntu 10), just to see if something breaks.

    Do you think you can install that mod on a server where a controlpanel is used (cPanel, Directadmin...)

    ReplyDelete
  37. Has anyone run apache benchmark on this in a realistic environment. As others have said it seems like a LOT of server overhead per process, but we may be overestimating how expensive that is. I'm just not sure.

    ReplyDelete
  38. Well, I forwarded this blog url to my network administrator to look into google page speed, and this is the reply I got instantly :


    "Is http://code.google.com/speed/page-speed/docs/using_mod.html running it because its been down all morning."

    ReplyDelete
  39. DreamHost just enabled this for all their customers: http://blog.dreamhost.com/2010/11/04/mod_pagespeed-now-available/

    ReplyDelete
  40. I did some tests and it blew off my error.log to 31GB in short time.

    I think this module is a good start but for CMS, Forums or Blogs it is not usable...

    It threw too many errors with php driven sites. I will investigate some more

    ReplyDelete
  41. locks up my apache too. apache server procs just sit in W and never terminate. eventually i run out of server procs and the sit is wedged. need to restart then. nasty.

    solution?

    ReplyDelete
  42. @ CookielessDomain and @K

    we fixed up the logs issue and some deadlocks that were happening. the svn tree has those fixes and we'll be making packages available on Monday. Thanks for trying out mod_pagespeed!

    ReplyDelete
  43. @DanOksnevadPhotography

    mod_pagespeed attempts to preserve image quality of jpegs as much as possible; there are only very small differences between images before and after recompression. That said, if you are already optimizing your jpegs for download size at a given quality level, you may discover that mod_pagespeed attempts to optimize but decides the results were not worthwhile.

    The best way to decide if image optimization helps you is to try it out. If you don't like the appearance of the resulting images (I know that photographers are more keenly sensitive to small changes in jpeg compression quality), or you discover they don't seem to be rewritten at all (the image_rewrites statistic doesn't increase much after you've surfed for a while, but other statistics increase as you'd expect), then you may be better off turning off that specific filter. You can leave everything else on and still see benefits.

    ReplyDelete
  44. How can i implement this apache module in my site?
    What are the steps that i need to follow..

    ReplyDelete
  45. Make your websites run faster, automatically -- try mod_pagespeed for Apache.
    nice posts, thanks for sharing.. please visit my blog

    ReplyDelete