Manual:Mctest.php
Appearance
MediaWiki file: mctest.php | |
---|---|
Location: | maintenance/ |
Source code: | master • 1.42.3 • 1.41.4 • 1.39.10 |
Classes: | McTest |
Details
mctest.php is a MediaWiki maintenance script that makes several 'set', 'incr', 'get' requests on every memcached server and shows a report.
Options/Arguments
Option | Description | Required | Default value |
---|---|---|---|
--i | Number of iterations | Optional | 100 |
--cache | Use servers from this $wgObjectCaches store | Optional | |
--driver | Either "php" or "pecl" | Optional | php |
--server[:port] | Memcached server to test, with optional port | Optional |
Usage
php maintenance/mctest.php [ --i| --cache| --driver| --server[:port] ]
Basic test
Terminal
$ php maintenance/mctest.php Warming up connections to cache servers...done Single and batched operation profiling/test results: 127.0.0.1:11211 add: 100/100 8ms set: 100/100 7ms incr: 100/100 9ms get: 100/100 (7ms) delete: 100/100 (1ms) setMulti (IB): ✓ 2ms getMulti (IB): 100/100 0ms changeTTLMulti (IB): ✓ 1ms deleteMulti (IB): ✓ 1ms setMulti (DB): ✓ 2ms getMulti (DB): 100/100 0ms changeTTLMulti (DB): ✓ 1ms deleteMulti (DB): ✓ 1ms
Test with custom iterations
Terminal
$ php maintenance/mctest.php --i 500 Warming up connections to cache servers...done Single and batched operation profiling/test results: 127.0.0.1:11211 add: 500/500 9ms set: 500/500 7ms incr: 500/500 7ms get: 500/500 (9ms) delete: 500/500 (7ms) setMulti (IB): ✓ 14ms getMulti (IB): 500/500 3ms changeTTLMulti (IB): ✓ 7ms deleteMulti (IB): ✓ 7ms setMulti (DB): ✓ 13ms getMulti (DB): 500/500 3ms changeTTLMulti (DB): ✓ 7ms deleteMulti (DB): ✓ 7ms
Test with custom server and port
Terminal
$ php maintenance/mctest.php "127.0.0.1:12345" Warming up connections to cache servers...done Single and batched operation profiling/test results: 127.0.0.1:12345 add: 0/100 0ms set: 0/100 0ms incr: 100/100 0ms get: 0/100 (0ms) delete: 0/100 (0ms) setMulti (IB): ✗ 0ms getMulti (IB): 0/100 0ms changeTTLMulti (IB): ✗ 0ms deleteMulti (IB): ✗ 0ms setMulti (DB): ✗ 0ms getMulti (DB): 0/100 0ms changeTTLMulti (DB): ✗ 0ms deleteMulti (DB): ✗ 0ms
Common error
- MediaWiki isn't configured for Memcached usage
- This error occurs when your MediaWiki installation is not configured properly with memcached server.
- MediaWiki isn't configured with a cache named '$cache'
- This indicates that you have not configured the '$cache' properly in $wgObjectCaches. Check LocalSettings.php for configuration details.