Scaling-out WordPress – Performance Measures – APC influence of the fronts

APC Influence overview

Results overview

In this post, I’m going to evaluate what increase of performance we could expect from using APC (Alternative PHP Cache).
APC is a opcode cache. That means that with APC, the PHP executable that is embedded in each apache process does not have to compile in opcode each PHP script.
The opcode is compiled during the first execution and is maintained in a shared memory area, so the successive php executions can get directly the opcode from the memory for each new request. In theory, we gain the time to compile from PHP script to opcode for each successive request.

Installing APC

Installing APC is very easy and can be done with just one command

aptitude install php-apc

To check if APC is correctly installed, create a php file in the root directory of the WordPress site that contains:

<?php
print_r(apc_cache_info());
?>

Then access this page. If you see an array of values, it works.

Evaluate the influence of using APC on the front for the raw throughput

Again, the following results are obtained for a particular workload (accessing the home page of a WordPress blog with few posts). It is obvious that the results can be very different for a workload that generates more database requests.

In this post, I continue the series of tests that I presented in the “CPU and RAM influence on the fronts” post.
I am doing the same tests (ab execution) in the exact same configuration (same database size, same IT resources).

Test #7, APC activated, 1 Front, 1Vcpu, 2GB on server ade-esxi-02 (Intel(R) Core(TM) Quad CPU Q6600 @ 2.40GHz; No Hyperthreading; 8 GB DDR2 800) :

$ ab -kc 10 -n 20 http://tu-web-01/mysite/
Requests per second:    3.49 [#/sec] (mean)

dstat shows that the CPU hits 100% (0% Idle)


Test #8, APC activated, 1 Front, 2Vcpu, 2GB on server ade-esxi-02 (Intel(R) Core(TM) Quad CPU Q6600 @ 2.40GHz; No Hyperthreading; 8 GB DDR2 800) :

$ ab -kc 10 -n 20 http://tu-web-01/mysite/
Requests per second:    5.34 [#/sec] (mean)

dstat shows that the CPU hits 100% (0% Idle)


Test #9, APC activated, 1 Front, 4Vcpu, 2GB on server ade-esxi-02 (Intel(R) Core(TM) Quad CPU Q6600 @ 2.40GHz; No Hyperthreading; 8 GB DDR2 800) :

$ ab -kc 10 -n 20 http://tu-web-01/mysite/
Requests per second:    11.49 [#/sec] (mean)

dstat shows that the CPU hits 100% (0% Idle)

Conclusion in using APC

For this simple workload (accessing the Home page of a wordpress blog that contains 5 middle sized post), the following graph shows how the performance is related to APC as the CPU increases.

APC Influence on req/sec

APC Influence on req/sec

This graph shows an average increase of performance of 67% with APC.

I decided to use APC for the following tests.

go to Introduction

Facebooktwittergoogle_plusredditpinterestlinkedinmail

Leave a Reply

Your email address will not be published. Required fields are marked *