PHP Accelerator: Difference between revisions
adds imagery |
m Text replacement - "<(\/?)source" to "<$1syntaxhighlight" |
||
| (2 intermediate revisions by one other user not shown) | |||
| Line 8: | Line 8: | ||
== Installation == | == Installation == | ||
Assuming you already have Apache2 and PHP5 (with dev extensions so PECL can run phpize), it's as easy as | Assuming you already have Apache2 and PHP5 (with dev extensions so PECL can run phpize), it's as easy as | ||
< | <syntaxhighlight lang="bash"> | ||
# make sure we have the development headers and apxs2 binary for threaded versions of apache2 | # make sure we have the development headers and apxs2 binary for threaded versions of apache2 | ||
sudo apt-get install apache2-threaded-dev | sudo apt-get install apache2-threaded-dev | ||
| Line 24: | Line 24: | ||
cd /var/www | cd /var/www | ||
sudo ln -s /usr/share/php/apc.php | sudo ln -s /usr/share/php/apc.php | ||
</ | </syntaxhighlight> | ||
== MediaWiki == | == MediaWiki == | ||
MediaWiki can take advantage of the APC cache if you tell it to. | MediaWiki can take advantage of the APC cache if you tell it to. | ||
see [[mw:Manual:Configuration_settings#Cache|The Manual for cache settings]], and set [[mw:Manual:$wgMainCacheType]] in LocalSettings.php: | see [[mw:Manual:Configuration_settings#Cache|The Manual for cache settings]], and set [[mw:Manual:$wgMainCacheType]] in LocalSettings.php: | ||
< | <syntaxhighlight lang="php"> | ||
$wgMainCacheType = CACHE_ACCEL; | $wgMainCacheType = CACHE_ACCEL; | ||
</ | </syntaxhighlight> | ||
== Troubleshooting == | == Troubleshooting == | ||
| Line 51: | Line 51: | ||
The graphs were produced using '''ab''' and '''gnuplot''' ab is Apache Bench, a benchmarking and stress-testing tool. Using -g to produce CSV output suitable for feeding to spreadsheets or gnuplot, you can generate the graphs. | The graphs were produced using '''ab''' and '''gnuplot''' ab is Apache Bench, a benchmarking and stress-testing tool. Using -g to produce CSV output suitable for feeding to spreadsheets or gnuplot, you can generate the graphs. | ||
< | <syntaxhighlight lang="bash"> | ||
ab -g ~/ab-without-apc.csv -n 50 -c 1 http://freephile.com/wiki/index.php/Main_Page | ab -g ~/ab-without-apc.csv -n 50 -c 1 http://freephile.com/wiki/index.php/Main_Page | ||
</ | </syntaxhighlight> | ||
produces this output: | produces this output: | ||
<pre> | <pre> | ||
| Line 123: | Line 123: | ||
[[Category:PHP]] | [[Category:PHP]] | ||
[[Category:Wiki]] | [[Category:Wiki]] | ||
[[Category: | [[Category:SysAdmin]] | ||
[[Category:Performance]] | |||