Phpopcache effect test
Test Environment
Lyolzj @ localhost/ usr/local/src/zendopcache-7.0.5 $ lscpu
Architecture: i686
CPU op-mode (s): 32-bit, 64-bit
Byte Order: Little Endian
CPU (s): 4
On-line CPU (s) list: 0-3
Thread (s) per core: 2
Core (s) per socket: 2
Socket (s): 1
Vendor ID: GenuineIntel
CPU family: 6
Model: 37
Stepping: 2
CPU MHz: 1199.000
BogoMIPS: 4521.76
Virtualization: VT-x
L1d cache: 32 K
L1i cache: 32 K
L2 cache: 256 K
L3 cache: 3072 K
Lyolzj @ localhost/usr/local/src/zendopcache-7.0.5 $ free-m
Total used free shared buffers cached
Mem: 1869 1654 215 265 4 526
-/+ Buffers/cache: 1123 745
Swap: 3320 1 3319
??Opcache test not installed??
Lyolzj @ localhost ~ $ AB-n 1000-c 10 http: // localhost/wordpress/
This is apachetings, Version 2.3 <$ Revision: 1528965 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/
Benchmarking localhost (be patient)
Completed100 requests
Completed200 requests
Completed300 requests
Completed400 requests
Completed500 requests
Completed600 requests
Completed700 requests
Completed800 requests
Completed900 requests
Completed1000 requests
Finished 1000 requests
Server Software: nginx/1.6.3
Server Hostname: localhost
Server Port: 80
Document Path:/wordpress/
Document Length: 8886 bytes
Concurrency Level: 10
Time taken for tests: 79.554 seconds
Complete requests: 1000
Failed requests: 0
Total transferred: 9099000 bytes
HTML transferred: 8886000 bytes
Requests per secondd: 12.57 [#/sec] (mean)
Time per request: 795.536 [MS] (mean)
Time per request: 79.554 [MS] (mean, internal SS all concurrent requests)
Transfer rate: 111.70 [Kbytes/sec] canceled ed
Connection Times (MS)
Min mean [+/-sd] median max
Connect: 0 0 0.0 0 0
Processing: 258 793 163.7 771 2227
Waiting: 249 777 163.1 755
Total: 258 793 163.7 771
Percentage of the requests served within a certain time (MS)
50% 771
66% 822
75% 849
80% 867
90% 926
95% 963
98% 1040
99% 1901
100% 2227 (longest request)
Lyolzj @ localhost ~ $ AB-n 1000-c 100 http: // localhost/wordpress/
This is apachetings, Version 2.3 <$ Revision: 1528965 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/
Benchmarking localhost (be patient)
Completed100 requests
Completed200 requests
Completed300 requests
Completed400 requests
Completed500 requests
Completed600 requests
Completed700 requests
Completed800 requests
Completed900 requests
Completed1000 requests
Finished 1000 requests
Server Software: nginx/1.6.3
Server Hostname: localhost
Server Port: 80
Document Path:/wordpress/
Document Length: 8886 bytes
Concurrency Level: 100
Time taken for tests: 81.475 seconds
Complete requests: 1000
Failed requests: 0
Total transferred: 9099000 bytes
HTML transferred: 8886000 bytes
Requests per secondd: 12.27 [#/sec] (mean)
Time per request: 8147.464 [MS] (mean)
Time per request: 81.475 [MS] (mean, internal SS all concurrent requests)
Transfer rate: 109.06 [Kbytes/sec] canceled ed
Connection Times (MS)
Min mean [+/-sd] median max
Connect: 0 0 1.0 0 5
Processing: 232 7758 1533.2 7921 9906
Waiting: 220 7740 1532.2 7908
Total: 237 7758 1532.3 7921
Percentage of the requests served within a certain time (MS)
50% 7921
66% 8258
75% 8488
80% 8682
90% 9020
95% 9289
98% 9531
99% 9674
100% 9906 (longest request)
Install opcache
Lyolzj @ localhost/usr/local/src $ sudo wget http://pecl.php.net/get/zendopcache-7.0.5.tgz
Lyolzj @ localhost/usr/local/src $ sudo tar-zxf zendopcache-7.0.5.tgz
Lyolzj @ localhost/usr/local/src $ cd zendopcache-7.0.5/
Lyolzj @ localhost/usr/local/src/zendopcache-7.0.5 $ ls
Config. m4 zend_accelerator_debug.c
Config. w32 zend_accelerator_debug.h
CREDITS ZendAccelerator. h
LICENSE zend_accelerator_hash.c
Optimizer zend_accelerator_hash.h
README zend_accelerator_module.c
Shared_alloc_mmap.c zend_accelerator_module.h
Shared_alloc_posix.c zend_accelerator_util_funcs.c
Shared_alloc_shm.c zend_accelerator_util_funcs.h
Shared_alloc_win32.c zend_persist.c
Tests zend_persist_calc.c
Zend_accelerator_blacklist.c zend_persist.h
Zend_accelerator_blacklist.h zend_shared_alloc.c
ZendAccelerator. c zend_shared_alloc.h
Lyolzj @ localhost/usr/local/src/zendopcache-7.0.5 $ sudo/usr/local/php5.4/bin/phpize
Processing ING:
PHP Api Version: 20100412
Zend Module Api No: 20100525
Zend Extension Api No: 220100525
Lyolzj @ localhost/usr/local/src/zendopcache-7.0.5 $ sudo./configure -- with-php-config =/usr/local/php5.4/bin/php-config
Lyolzj @ localhost/usr/local/src/zendopcache-7.0.5 $ sudo make
Lyolzj @ localhost/usr/local/src/zendopcache-7.0.5 $ sudo make install
Installing shared extensions:/usr/local/php5.4/lib/php/extensions/no-debug-non-zts-20100525/
Configure opcache
Add in php. ini
Zend_extension =/usr/local/php5.4/lib/php/extensions/no-debug-non-zts-20100525/opcache. so
[Opcache]
Opcache. memory_consumption = 128
Opcache. interned_strings_buffer = 8
Opcache. max_accelerated_files = 4000
Opcache. revalidate_freq = 60
Opcache. fast_shutdown = 1
Opcache. enable_cli = 1
Lyolzj @ localhost/usr/local/src/zendopcache-7.0.5 $ sudo netstat-ntlp
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
Tcp 0 0 127.0.0.1: 9000 0.0.0.0: * LISTEN 2549/php-fpm.conf)
Tcp 0 0 127.0.0.1: 3306 0.0.0.0: * LISTEN
Lyolzj @ localhost/usr/local/src/zendopcache-7.0.5 $ sudo kill 2549
Lyolzj @ localhost/usr/local/src/zendopcache-7.0.5 $ sudo/usr/local/php5.4/sbin/php-fpm-y/usr/local/php5.4/etc/php-fpm.conf
Lyolzj @ localhost ~ $ AB-n 1000-c 10 http: // localhost/wordpress/
This is apachetings, Version 2.3 <$ Revision: 1528965 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/
Benchmarking localhost (be patient)
Completed100 requests
Completed200 requests
Completed300 requests
Completed400 requests
Completed500 requests
Completed600 requests
Completed700 requests
Completed800 requests
Completed900 requests
Completed1000 requests
Finished 1000 requests
Server Software: nginx/1.6.3
Server Hostname: localhost
Server Port: 80
Document Path:/wordpress/
Document Length: 8886 bytes
Concurrency Level: 10
Time taken for tests: 27.116 seconds
Complete requests: 1000
Failed requests: 0
Total transferred: 9099000 bytes
HTML transferred: 8886000 bytes
Requests per secondd: 36.88 [#/sec] (mean)
Time per request: 271.158 [MS] (mean)
Time per request: 27.116 [MS] (mean, internal SS all concurrent requests)
Transfer rate: 327.70 [Kbytes/sec] canceled ed
Connection Times (MS)
Min mean [+/-sd] median max
Connect: 0 0 0.4 0 5
Processing: 190 270 55.9 260 628
Waiting: 185 263 54.2 254
Total: 190 270 56.1 260
Percentage of the requests served within a certain time (MS)
50% 260
66% 282
75% 301
80% 313
90% 341
95% 368
98% 398
99% 443
100% 632 (longest request)
Lyolzj @ localhost ~ $ AB-n 1000-c 100 http: // localhost/wordpress/
This is apachetings, Version 2.3 <$ Revision: 1528965 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/
Benchmarking localhost (be patient)
Completed100 requests
Completed200 requests
Completed300 requests
Completed400 requests
Completed500 requests
Completed600 requests
Completed700 requests
Completed800 requests
Completed900 requests
Completed1000 requests
Finished 1000 requests
Server Software: nginx/1.6.3
Server Hostname: localhost
Server Port: 80
Document Path:/wordpress/
Document Length: 8886 bytes
Concurrency Level: 100
Time taken for tests: 28.363 seconds
Complete requests: 1000
Failed requests: 0
Total transferred: 9099000 bytes
HTML transferred: 8886000 bytes
Requests per secondd: 35.26 [#/sec] (mean)
Time per request: 2836.330 [MS] (mean)
Time per request: 28.363 [MS] (mean, internal SS all concurrent requests)
Transfer rate: 313.28 [Kbytes/sec] canceled ed
Connection Times (MS)
Min mean [+/-sd] median max
Connect: 0 1 1.7 0 7
Processing: 86 2700 515.9 2804 3322
Waiting: 81 2692 515.3 2797 3311
Total: 94 2700 514.3 2804 3322
Percentage of the requests served within a certain time (MS)
50% 2804
66% 2853
75% 2886
80% 2909
90% 3025
95% 3127
98% 3186
99% 3223
100% 3322 (longest request)
Result
Changed from Time per request: 81.475 [MS] to Time per request: 28.363[MS]; increased by nearly 3 times.