Opcache performance measurement

Ye' old general discussion board. Basically, for everything that isn't covered elsewhere. Come here to shoot the breeze, shoot your mouth off, or whatever suits your fancy.
This forum is not for asking programming related questions.

Moderator: General Moderators

Post Reply
nirajvara
Forum Newbie
Posts: 2
Joined: Mon Feb 09, 2015 7:17 am

Opcache performance measurement

Post by nirajvara »

I have the php version php56w-5.6.4-1.w7.x86_64 installed on centos-7 and installed the OPcacge php56w-opcache-5.6.4-1.w7.x86_64.


Now I want to check the performance of opcache anybody have any scripts which can help me do the same ? or how I can measure the performance of opcache ??


In linux how would I check via command prompt or via php code file that Opcache is Enable/Disable ????


Please guide for the same.
User avatar
Weirdan
Moderator
Posts: 5978
Joined: Mon Nov 03, 2003 6:13 pm
Location: Odessa, Ukraine

Re: Opcache performance measurement

Post by Weirdan »

You could use ab (Apache Benchmark) or Siege to repeatedly call a page you're interested in and get stats you could compare.
nirajvara
Forum Newbie
Posts: 2
Joined: Mon Feb 09, 2015 7:17 am

Re: Opcache performance measurement

Post by nirajvara »

Hi

Thank you fur your reply. I was using the AB and made a one php for loop scripts also and I checked with enable Opcache and disabled the opcache but getting the same results !!!


Now How would I reach to any conclusion ?????


Document Path: /1.php
Document Length: 488895 bytes

Concurrency Level: 300
Time taken for tests: 22.339 seconds
Complete requests: 20000
Failed requests: 0
Write errors: 0
Total transferred: 9781920000 bytes
HTML transferred: 9777900000 bytes
Requests per second: 895.29 [#/sec] (mean)
Time per request: 335.086 [ms] (mean)
Time per request: 1.117 [ms] (mean, across all concurrent requests)
Transfer rate: 427620.84 [Kbytes/sec] received

Connection Times (ms)
min mean[+/-sd] median max
Connect: 0 9 13.4 4 139
Processing: 22 325 52.8 319 644
Waiting: 3 155 118.8 106 485
Total: 31 334 50.6 327 646

Percentage of the requests served within a certain time (ms)
50% 327
66% 341
75% 352
80% 360
90% 390
95% 432
98% 448
99% 475
100% 646 (longest request)



With Opcache enabled

Server Software: Apache/2.4.6
Server Hostname: 127.0.0.1
Server Port: 80

Document Path: /1.php
Document Length: 488895 bytes

Concurrency Level: 300
Time taken for tests: 22.952 seconds
Complete requests: 20000
Failed requests: 0
Write errors: 0
Total transferred: 9781920000 bytes
HTML transferred: 9777900000 bytes
Requests per second: 871.39 [#/sec] (mean)
Time per request: 344.279 [ms] (mean)
Time per request: 1.148 [ms] (mean, across all concurrent requests)
Transfer rate: 416202.35 [Kbytes/sec] received

Connection Times (ms)
min mean[+/-sd] median max
Connect: 0 9 12.0 4 113
Processing: 22 334 95.5 311 907
Waiting: 3 159 158.2 95 892
Total: 33 343 92.9 320 913

Percentage of the requests served within a certain time (ms)
50% 320
66% 334
75% 346
80% 356
90% 411
95% 543
98% 729
99% 775
100% 913 (longest request)
User avatar
Weirdan
Moderator
Posts: 5978
Joined: Mon Nov 03, 2003 6:13 pm
Location: Odessa, Ukraine

Re: Opcache performance measurement

Post by Weirdan »

Have you checked that it's actually enabled/disabled (with php -v or phpinfo())? Also, the advantage of bytecode cachers like opcache may not be apparent on small scripts. Try something bigger. Wordpress, Magento or something of a similar scale.
Post Reply