• Like
  • Save
PHP 5.5 Zend OPcache
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

PHP 5.5 Zend OPcache

  • 26,612 views
Published

 

Published in Technology
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Be the first to comment
No Downloads

Views

Total Views
26,612
On SlideShare
0
From Embeds
0
Number of Embeds
30

Actions

Shares
Downloads
0
Comments
0
Likes
8

Embeds 0

No embeds

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
    No notes for slide

Transcript

  • 1. 2013/04/26 @shin1x16th Kansai PHP StudyPHP5.5Zend OPcache
  • 2. @shin1x1(c) 2013 Masashi Shinbara @shin1x1http://www.1x1.jp/blog/https://github.com/shin1x1PHP / DevOps / AWS /Varnish / Fabric / Chef
  • 3. Agenda(c) 2013 Masashi Shinbara @shin1x11. PHP5.5 beta4 install2. Zend OPcache3. Benchmark4. Data Cache
  • 4. PHP5.5 beta4 install(c) 2013 Masashi Shinbara @shin1x1
  • 5. PHP5.5 beta4 install(c) 2013 Masashi Shinbara @shin1x1# for RHEL6 / CentOS6$ sudo yum install httpd-devel libxml2-devel# for extract .xz file$ sudo yum insall xz
  • 6. PHP5.5 beta4 install(c) 2013 Masashi Shinbara @shin1x1$ curl -OL http://downloads.php.net/dsp/php-5.5.0beta4.tar.xz$ tar xvf php-5.5.0beta4.tar.xz$ cd php-5.5.0beta4$ ./configure --enable-mbstring --with-apxs2$ make$ sudo make install
  • 7. PHP5.5 beta4 install(c) 2013 Masashi Shinbara @shin1x1$ php -vPHP 5.5.0beta4 (cli) (built: Apr 25 201321:21:51)Copyright (c) 1997-2013 The PHP GroupZend Engine v2.5.0-dev, Copyright (c)1998-2013 Zend Technologies
  • 8. Zend OPcache(c) 2013 Masashi Shinbara @shin1x1
  • 9. Zend OPcache(c) 2013 Masashi Shinbara @shin1x1•aka Zend Optimizer+https://github.com/zend-dev/ZendOptimizerPlus•opcode cache•opcode optimization•no user data cache
  • 10. Zend OPcache(c) 2013 Masashi Shinbara @shin1x1$ sudo cp -a php.ini-production /usr/local/lib/php.ini$ sudo echo "zend_extension=opcache.so">> /usr/local/lib/php.ini
  • 11. Zend OPcache(c) 2013 Masashi Shinbara @shin1x1$ php -vPHP 5.5.0beta4 (cli) (built: Apr 26 201313:26:28)Copyright (c) 1997-2013 The PHP GroupZend Engine v2.5.0-dev, Copyright (c)1998-2013 Zend Technologieswith Zend OPcache v7.0.2-dev,Copyright (c) 1999-2013, by ZendTechnologies
  • 12. Zend OPcache(c) 2013 Masashi Shinbara @shin1x1$ php -i | grep -i opcacheopcache.blacklist_filename => no value => no valueopcache.consistency_checks => 0 => 0opcache.dups_fix => Off => Offopcache.enable => On => Onopcache.enable_cli => Off => Offopcache.enable_file_override => Off => Offopcache.error_log => no value => no valueopcache.fast_shutdown => 0 => 0opcache.force_restart_timeout => 180 => 180opcache.inherited_hack => On => Onopcache.interned_strings_buffer => 4 => 4opcache.load_comments => 1 => 1opcache.log_verbosity_level => 1 => 1opcache.max_accelerated_files => 2000 => 2000....
  • 13. Zend OPcache(c) 2013 Masashi Shinbara @shin1x1https://github.com/zend-dev/ZendOptimizerPlus
  • 14. Benchmark(c) 2013 Masashi Shinbara @shin1x1
  • 15. Benchmark(c) 2013 Masashi Shinbara @shin1x1<?phpclass HelloController extends AppController {  public $uses = array();  public function index() {    var_dump("Hello");    exit;  }}•CakePHP 2.3.2
  • 16. Benchmark(c) 2013 Masashi Shinbara @shin1x1$ ab -c 50 -n 1000 http://localhost/hello•CakePHP 2.3.2
  • 17. Benchmark(c) 2013 Masashi Shinbara @shin1x1•Zend OPcache offRequests per second: 41.05 [#/sec]
  • 18. Benchmark(c) 2013 Masashi Shinbara @shin1x1•Zend OPcache offRequests per second:270.55 [#/sec]•Zend OPcache onRequests per second: 41.05 [#/sec]
  • 19. Data Cache(c) 2013 Masashi Shinbara @shin1x1
  • 20. APCu(c) 2013 Masashi Shinbara @shin1x1•APCu - APC User Cachehttps://github.com/krakjoe/apcuhttp://pecl.php.net/package/APCu
  • 21. Yac(c) 2013 Masashi Shinbara @shin1x1•Yac(Yet Another Cache)https://github.com/laruence/yachttp://www.laruence.com/2013/03/18/2846.html?
  • 22. Summary(c) 2013 Masashi Shinbara @shin1x1•Zend OPcache が標準バンドル•php.ini で設定が必要(beta4時点)•データストアは別拡張で
  • 23. @shin1x1(c) 2013 Masashi Shinbara @shin1x1