{"id":3976,"date":"2012-12-07T10:48:36","date_gmt":"2012-12-07T14:48:36","guid":{"rendered":"http:\/\/www.webperformance.com\/load-testing-tools\/blog\/?p=3976"},"modified":"2023-06-29T11:28:04","modified_gmt":"2023-06-29T15:28:04","slug":"google-pagespeed-scalability-benchmark","status":"publish","type":"post","link":"https:\/\/www.webperformance.com\/load-testing-tools\/blog\/2012\/12\/google-pagespeed-scalability-benchmark\/","title":{"rendered":"Google Pagespeed Scalability Benchmark"},"content":{"rendered":"<h2>Premise<\/h2>\n<p><a href=\"https:\/\/developers.google.com\/speed\/pagespeed\/\">Google Pagespeed<\/a> is an easy way to optimize web page rendering time without having to recode your website. The <a href=\"https:\/\/developers.google.com\/speed\/pagespeed\/insights\">pagespeed analyzer<\/a> gives suggestions on what needs to be changed, while <a href=\"https:\/\/developers.google.com\/speed\/pagespeed\/mod\">mod_pagespeed<\/a> is an Apache add-on that makes those modifications automagically.<\/p>\n<p>The one question that hasn&#8217;t been answered is &#8220;what is the performance cost for installing mod_pagespeed&#8221;.  Pagespeed addresses only client-side performance, which is completely different from server scalability.  The actual page load times that customers see in practice is affected by both the page design and layout, <i>and<\/i> the actual speed of the server under load.  This is a little project to take a look at what happens when a mod_pagespeed equipped Apache web server encounters load.<\/p>\n<h2>What You&#8217;re Getting<\/h2>\n<p>To start off, let&#8217;s take a look at what mod_pagespeed did to the web pages when the server is accessed by a single user. Without optimization our homepage got a score of 77\/100, with dozens of suggestions for changes.  (Our site is laid out to be easy to edit and maintain rather than being optimized for maximum performance.)  With mod_pagespeed turned on, the score jumped to 95\/100.  Looking at the analysis, it appears that mod_pagespeed mainly changed the caching settings and combined images into CSS sprites.  <\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.webperformance.com\/load-testing-tools\/blog\/wp-content\/uploads\/2012\/12\/Screen-Shot-2012-12-05-at-5.09.06-PM.png\" alt=\"\" title=\"Single Page Performance\" width=\"492\" height=\"274\" class=\"aligncenter size-full wp-image-3978\" \/><\/p>\n<p>In the above chart the network requests run concurrently with page rendering, so the perceived improvement in both network transfer time and page render time is around 20%, which isn&#8217;t bad for simply installing an Apache module.  The question is, how long does this performance improvement last when the server is subjected to load?  This question is somewhat difficult to answer since under load the render time isn&#8217;t available, so we use &#8220;load times&#8221;, which is the time it takes for all of the content to be loaded across the network.<\/p>\n<p>This is valid for load comparisons because load times represent the vast majority of the perceived time it takes for the user to view the page. On top of that, its impossible to actually measure render time because of the subjectivity involved. Does the user perceive that the page has rendered when 80% is rendered? 90% For many pages the user considers the page rendered when the part they&#8217;re reading is finished, and the parts that are uninteresting (below the fold for example) don&#8217;t matter.  <\/p>\n<h2>Performance under Load<\/h2>\n<p>The test I set up compared a typical high-performance Apache configuration, with file caching and the typical httpd.conf modifications.  (Details will be provided at the end of the post.)<br \/>\nThe following chart compare web page load times between this typical optimized Apache2 installation, and the same installation with mod_pagespeed installed.  When mod_pagespeed was turned on, the web page load times quickly doubled, so that by somewhere around 300 to 400 concurrent users the advantages of running mod_pagespeed were outweighed by the overhead in running the module.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.webperformance.com\/load-testing-tools\/blog\/wp-content\/uploads\/2012\/12\/Screen-Shot-2012-12-05-at-5.52.40-PM.png\" alt=\"\" title=\"Web Page Load Times\" width=\"432\" height=\"384\" class=\"aligncenter size-full wp-image-3981\" \/><\/p>\n<p>The reason appears to be additional system load from mod_pagespeed, which is roughly double over a non-optimized system. The system was definitely not I\/O bound, as I&#8217;ve benchmarked the EC2 to EC2 bandwidth of this virtual server to be around 600Mb\/s, and these tests topped out at only 200Mb\/s.  <\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.webperformance.com\/load-testing-tools\/blog\/wp-content\/uploads\/2012\/12\/Screen-Shot-2012-12-06-at-2.06.54-PM.png\" alt=\"\" title=\"Pagespeed CPU Load\" width=\"465\" height=\"332\" class=\"aligncenter size-full wp-image-3985\" \/><\/p>\n<h2>Recommendations<\/h2>\n<p>The test was designed to zero in on the effects of mod_pagespeed, but in real life your site is likely to be dynamic, not static.  As such, these results may or may not apply to you; the only way to tell is to do the experiment on your own site. However, if your site has many static pages, the obvious conclusion is that mod_pagespeed makes sense to install only if your site is lightly loaded, and you can verify that the modified pages are actually faster than the default pages.  In my case there was about a 20% speedup, which was noticeable.  You&#8217;ll want to check that all dynamic pages and scripts function however, since mod_pagespeed broke our shopping cart, and there could possibly have bad interactions with dynamic parts of your site as well.<\/p>\n<p>The obvious best practice here is, if absolute page load times are important, then it is worth it to take the time to make the recommended Google Pagespeed changes by hand; that way you retain the full power of the server.<\/p>\n<h2>Reproducing the Results<\/h2>\n<p>The server I used to test was an EC2 m1.large virtual server running Red Hat Enterprise Linux Server release 6.3 (Santiago). The mod_pagespeed module was installed via yum and used version mod-pagespeed-stable.x86_64 1.1.23.2-2258.  Apache was configured to use <a href=\"http:\/\/httpd.apache.org\/docs\/2.2\/mod\/mod_disk_cache.html\">mod_disk_cache<\/a> and the following pre-fork MPM settings:<br \/>\n<code><br \/>\n<ifmodule prefork.c><br \/>\nStartServers      20<br \/>\nMinSpareServers   25<br \/>\nMaxSpareServers   100<br \/>\nServerLimit      8192<br \/>\nMaxClients       8192<br \/>\nMaxRequestsPerChild  10000<br \/>\n<\/ifmodule><br \/>\n<\/code><br \/>\nThe test case consisted of these three pages from our site with the PHP removed so that PHP didn&#8217;t enter into the performance equation, configured for think times of 4 seconds and connection speeds of 5Mb\/s:<code><br \/>\nhttps:\/\/www.webperformance.com<br \/>\nhttps:\/\/www.webperformance.com\/load-testing-tools<br \/>\nhttps:\/\/www.webperformance.com\/load-testing-services<br \/>\n<\/code><br \/>\nNote that I tried to use the worker MPM but could not get it to run with mod_pagespeed without crashes.  You&#8217;ll want to be sure to apply these <a href=\"\/load-testing-tools\/blog\/2012\/12\/setting-apache2-ulimit-for-maximum-prefork-performance\/\" target=\"_blank\">ulimit changes<\/a> as well.<\/p>\n<p>Michael Czeiszperger<br \/>\nWeb Performance, Inc.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Premise<br \/>\n<a href=\"https:\/\/developers.google.com\/speed\/pagespeed\/\">Google Pagespeed<\/a> is an easy way to optimize web page rendering time without having to recode your website. The <a href=\"https:\/\/developers.google.com\/speed\/pagespeed\/insights\">pagespeed analyzer<\/a> gives suggestions on what needs to be changed, while <a href=\"https:\/\/developers.google.com\/speed\/pagespeed\/mod\">mod_pagespeed<\/a> is an Apache add-on that makes those modifications automagically.<br \/>\nThe one question that hasn&#8217;t been answered is &#8220;what is the performance cost for installing mod_pagespeed&#8221;.  Pagespeed addresses only client-side performance, which is completely different from server scalability.  The actual page load times that customers see in practice is affected by both the page design and layout, and the actual speed of the server under load. &hellip; <a href=\"https:\/\/www.webperformance.com\/load-testing-tools\/blog\/2012\/12\/google-pagespeed-scalability-benchmark\/\">Continue reading &raquo;<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[34,8,41],"tags":[],"class_list":["post-3976","post","type-post","status-publish","format-standard","hentry","category-apache-httpd","category-load-testing","category-performance-reports"],"_links":{"self":[{"href":"https:\/\/www.webperformance.com\/load-testing-tools\/blog\/wp-json\/wp\/v2\/posts\/3976","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.webperformance.com\/load-testing-tools\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.webperformance.com\/load-testing-tools\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.webperformance.com\/load-testing-tools\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.webperformance.com\/load-testing-tools\/blog\/wp-json\/wp\/v2\/comments?post=3976"}],"version-history":[{"count":37,"href":"https:\/\/www.webperformance.com\/load-testing-tools\/blog\/wp-json\/wp\/v2\/posts\/3976\/revisions"}],"predecessor-version":[{"id":6357,"href":"https:\/\/www.webperformance.com\/load-testing-tools\/blog\/wp-json\/wp\/v2\/posts\/3976\/revisions\/6357"}],"wp:attachment":[{"href":"https:\/\/www.webperformance.com\/load-testing-tools\/blog\/wp-json\/wp\/v2\/media?parent=3976"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.webperformance.com\/load-testing-tools\/blog\/wp-json\/wp\/v2\/categories?post=3976"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.webperformance.com\/load-testing-tools\/blog\/wp-json\/wp\/v2\/tags?post=3976"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}