APC is supposed to make PHP faster
I have installed APC and PHP with:
apt-get install php-pear php5-cli php5-cgi php5-dev php-apc
The matter is I do not see any performance boost with APC enabled. APC is installed with default settings and I have tried to change some of these also according to advices given by Linode but nothing happens - sometimes it evens makes performance worse.
Basically I have used ab to do some stresstest. My testpage is some regular HTML with a single phpinfo() in it giving the page a total size of around 50K.
Anyone got a clue as to why?
3 Replies
I see, this link also suggests what you say.
APC caches the result of this compilation, so that when a script is executed, it can skip the compilation and just interpret the pre-compiled bytecode.
On a simple script, the compilation time is an inconsequential part of the execution time. But on a more complex web app, with hundreds or thousands (or more) lines of code, skipping that step can save a large amount of time (and CPU power). Hence why those benchmarks you linked to show no savings for small stuff, but show huge savings for WordPress, Drupal, and Phorum.