For the past week I’ve been testing out the performance of the new Google Pagespeed module for Apache, mod_pagespeed, and with the memory locking option turned on, the performance was a definite improvement 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.
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.
The superficial reason for the performance is CPU load, which starts to consume the server at around 400 users.
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 APC and Zend Optimizer. This is obviously not a comprehensive analysis, so it’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.
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 mod_disk_cache and the following pre-fork MPM settings:
StartServers 20
MinSpareServers 25
MaxSpareServers 100
ServerLimit 8192
MaxClients 8192
MaxRequestsPerChild 10000
The test case consisted of these three pages from our site with the PHP removed so that PHP didn’t enter into the performance equation, configured for think times of 4 seconds and connection speeds of 5Mb/s:
https://www.webperformance.com
https://www.webperformance.com/load-testing
https://www.webperformance.com/load-testing-services
Note that I tried to use the worker MPM but could not get it to run with mod_pagespeed without crashes. You’ll want to be sure to apply these ulimit changes as well.
Founder of Web Performance, Inc
B.S. Electrical & Computer Engineering
The Ohio State University
LinkedIn Profile