{"id":4033,"date":"2012-12-19T07:33:22","date_gmt":"2012-12-19T11:33:22","guid":{"rendered":"http:\/\/www.webperformance.com\/load-testing-tools\/blog\/?p=4033"},"modified":"2023-06-29T11:25:25","modified_gmt":"2023-06-29T15:25:25","slug":"google-pagespeed-performance-with-php","status":"publish","type":"post","link":"https:\/\/www.webperformance.com\/load-testing-tools\/blog\/2012\/12\/google-pagespeed-performance-with-php\/","title":{"rendered":"Google Pagespeed 1.1 Performance with PHP"},"content":{"rendered":"<p>For the past week I&#8217;ve been testing out the performance of the new <a href=\"https:\/\/developers.google.com\/speed\/pagespeed\/mod\">Google Pagespeed module<\/a> for Apache, mod_pagespeed, and with the memory locking option turned on, <a href=\"\/load-testing-tools\/blog\/2012\/12\/google-pagespeed-performance-with-memory-locking\/\">the performance was a definite improvement<\/a> for static pages. The fact is, though, there are much faster web servers for static content, and CDNs make scaling static pages very, every easy. Standard testing procedure, though, is to start as simple as possible, and test every variation separately. The next step, then is to test how Pagespeed works on dynamic pages.<\/p>\n<p>As before, this new test uses our own corporate site, except now the pages use PHP to attach the header and footer. Calls to outside services like analytics were removed to concentrate the test just on this server, and the think time is 4 seconds per page.<\/p>\n<ol>\n<li>https:\/\/www.webperformance.com<\/li>\n<li>https:\/\/www.webperformance.com\/load-testing-tools<\/li>\n<li>https:\/\/www.webperformance.com\/load-testing-services<\/li>\n<\/ol>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-4034\" title=\"Ave Page Load Times\" src=\"https:\/\/www.webperformance.com\/load-testing-tools\/blog\/wp-content\/uploads\/2012\/12\/Screen-Shot-2012-12-13-at-2.07.03-PM.png\" alt=\"\" width=\"390\" height=\"351\" \/><\/p>\n<p>The superficial reason for the performance is CPU load, which starts to consume the server at around 400 users.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-4037\" title=\"CPU Load\" src=\"https:\/\/www.webperformance.com\/load-testing-tools\/blog\/wp-content\/uploads\/2012\/12\/Screen-Shot-2012-12-13-at-2.21.12-PM.png\" alt=\"\" width=\"350\" height=\"288\" \/><\/p>\n<h2>Conclusions<\/h2>\n<p>I expected to see that mod_pagespeed added more overhead than running plain PHP. This was clearly not the case, since by around 450 users mod_pagespeed was markedly faster than the default. PHP has never been known for its high performance, which explains PHP accelerators like <a href=\"https:\/\/www.webperformance.com\/library\/reports\/SugarAPC\/index.html\">APC<\/a> and <a href=\"\/load-testing-tools\/blog\/2007\/11\/impact-of-zend-optimizer-on-php-performance\/\">Zend Optimizer<\/a>. This is obviously not a comprehensive analysis, so it&#8217;s likely the performance greatly depends on page content. The only way to know what the effects will be on your server is to do a load test and compare.<\/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><\/p>\n<p>StartServers      20<br \/>\nMinSpareServers   25<br \/>\nMaxSpareServers   100<br \/>\nServerLimit      8192<br \/>\nMaxClients       8192<br \/>\nMaxRequestsPerChild  10000<\/p>\n<p><\/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<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\" rel=\"noopener\">ulimit changes<\/a> as well.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>For the past week I&#8217;ve been testing out the performance of the new <a href=\"https:\/\/developers.google.com\/speed\/pagespeed\/mod\">Google Pagespeed module<\/a> for Apache, mod_pagespeed, and with the memory locking option turned on, <a href=\"\/load-testing-tools\/blog\/2012\/12\/google-pagespeed-performance-with-memory-locking\/\">the performance was a definite improvement<\/a> for static pages. The fact is, though, there are much faster web servers for static content, and CDNs make scaling static pages very, every easy. Standard testing procedure, though, is to start as simple as possible, and test every variation separately. The next step, then is to test how Pagespeed works on dynamic pages.<br \/>\nAs before, this new test uses our own corporate site, except now &hellip; <a href=\"https:\/\/www.webperformance.com\/load-testing-tools\/blog\/2012\/12\/google-pagespeed-performance-with-php\/\">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,41],"tags":[23,158,159,154,13,161,160],"class_list":["post-4033","post","type-post","status-publish","format-standard","hentry","category-apache-httpd","category-performance-reports","tag-apache","tag-google","tag-load-times","tag-pagespeed","tag-performance","tag-php-2","tag-speed"],"_links":{"self":[{"href":"https:\/\/www.webperformance.com\/load-testing-tools\/blog\/wp-json\/wp\/v2\/posts\/4033","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=4033"}],"version-history":[{"count":18,"href":"https:\/\/www.webperformance.com\/load-testing-tools\/blog\/wp-json\/wp\/v2\/posts\/4033\/revisions"}],"predecessor-version":[{"id":6353,"href":"https:\/\/www.webperformance.com\/load-testing-tools\/blog\/wp-json\/wp\/v2\/posts\/4033\/revisions\/6353"}],"wp:attachment":[{"href":"https:\/\/www.webperformance.com\/load-testing-tools\/blog\/wp-json\/wp\/v2\/media?parent=4033"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.webperformance.com\/load-testing-tools\/blog\/wp-json\/wp\/v2\/categories?post=4033"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.webperformance.com\/load-testing-tools\/blog\/wp-json\/wp\/v2\/tags?post=4033"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}