Hitchwiki / hitchwiki

The Hitchhiker's Guide to Hitchhiking the World
https://hitchwiki.org
32 stars 9 forks source link

Configure PHP cache #105

Closed simison closed 6 years ago

simison commented 7 years ago

https://www.digitalocean.com/community/questions/how-to-install-alternative-php-cache-apc-on-ubuntu-14-04

https://github.com/Hitchwiki/hitchwiki/blob/master/scripts/bootstrap_vagrant.sh#L57-L64

omelnyk commented 7 years ago

APC is deprecated as of PHP 5.4, while scotchbox comes with PHP 5.6 and Ubuntu 16.04 comes with PHP 7.

We can rely on opcache (included and enabled in PHP by default) for opcode cache, but still need to figure out what backend to use for MediaWiki's object cache.

http://wordpress.stackexchange.com/a/174319 https://www.mediawiki.org/wiki/Manual:Cache https://www.semantic-mediawiki.org/wiki/PHP_Caching_solutions_and_performance

simison commented 7 years ago

Looks like adding XCache makes the most sense:

pmgouveia commented 7 years ago

"Accessed through ObjectCache::getLocalServerInstance().

Values in this store only kept on the local web server only (typically using APC as backend). Not replicated to the other servers or clusters.

This store defaults to a null interface if APC (or other supported PHP extensions) are not installed. It is also set to a null interface for maintenance scripts and other command-line modes. MediaWiki supports APC, APCu, XCache, and WinCache."

https://www.mediawiki.org/wiki/Manual:Caching#Main_cache

btw, the xcache website is down... ill try to configure apc on my server... and put here my procedure $ sudo apt-get install php5-apcu

$ sudo cp /etc/php5/mods-available/apcu.ini /etc/php5/apache2/

And some notes on configuring APC: https://www.digitalocean.com/community/tutorials/how-to-install-alternative-php-cache-apc-on-a-cloud-server-running-ubuntu-12-04

pmgouveia commented 7 years ago

To monitor apc usage: install this script! ^^ https://raw.githubusercontent.com/krakjoe/apcu/master/apc.php

From: https://anavarre.net/how-to-monitor-and-tune-apcu/

traumschule commented 7 years ago

php7.0-opcache is part of our dependencies - it should be safe to close this

$ php --version
PHP 7.0.22-0ubuntu0.16.04.1 (cli) ( NTS )
Copyright (c) 1997-2017 The PHP Group
Zend Engine v3.0.0, Copyright (c) 1998-2017 Zend Technologies
    with Zend OPcache v7.0.22-0ubuntu0.16.04.1, Copyright (c) 1999-2017, by Zend Technologies