體驗 Hhvm
-
Upload
chen-cheng-wei -
Category
Software
-
view
1.350 -
download
6
description
Transcript of 體驗 Hhvm
體驗HHVMchengwei @ Laravel 台灣 (2014.10.4)
內容概要
!
‧HHVM 概述
‧Laravel Homestead + HHVM
‧HHVM 成效
‧HHVM 安裝 (ubuntu)
!陳正瑋 @ 得寬科技 DevOps
!一步一步的往DevOps之路前進...
What is HHVM ?‧ http://zh.wikipedia.org/wiki/
HipHop_for_PHP
‧ http://hhvm.com/
‧ https://www.facebook.com/hhvm
‧ https://github.com/facebook/hhvm
‧ HHVM, the new PHP? https://www.youtube.com/watch?v=fxHEuOXdCP0
‧ HHVM: the alternative PHP Runtimehttps://www.youtube.com/watch?v=P9WhAUpMFdg
more …
HipHop for PHP!
來自於FACEBOOK !
HPHPc → HPHPi → HHVM !
HPHPc 靜態編譯,將php轉為C++ !
HPHPi = HipHop interpreter !
HHVM 是以 HPHPi 為基礎,應用JIT技術
更多技術細節,請洽Google⼤大神
HHVM!
Just-in-time PHP compiler
更多技術細節,請洽Google⼤大神
HHVM!
It is a different PHP runtime
更多技術細節,請洽Google⼤大神
Nginx
php-fpm
mysql
index.php
Nginx
HHVM
mysql
index.php
重點前⾯面都不重要,真正的
Source: Zeev Suraski http://zsuraski.blogspot.tw/2014/07/benchmarking-phpng.html
Real World Apps - Benchmarks (requests per second)
0
75
150
225
300
SugarCRM CE 6.5.16 - login page Wordpress 3.9 Drupal 7.28 homepage
PHP 5.4 (no OPcache) PHP 5.5 PHP 5.6 hhvm 3.1 (prebuilt binaries) PHPNG
Laravel + HHVM
Laravel Homestead!
official, pre-packaged Vagrant "box"
Laravel Homestead Included Software
Homestead v0.1.9
‧ Ubuntu 14.04 ‧ PHP 5.6 ‧ HHVM ‧ Nginx ‧ MySQL ‧ Postgres ‧ Node ‧ Redis ‧ Memcached ‧ Beanstalkd ‧ Laravel Envoy ‧ Fabric + HipChat Extension
Before Installation!
VitualBox https://www.virtualbox.org/wiki/Downloads !Vagrant http://www.vagrantup.com/downloads.html
VirtualBox
Installation & Setup!
http://laravel.tw/docs/homestead#installation-and-setup !http://laravel.com/docs/4.2/homestead#installation-and-setup !https://github.com/laravel/homestead
nginx.conf : php-fpm
nginx.conf : HHVM
HHVM 成效!“自從用了 HHVM ,程式跑超快的,Server 的數量越來越少,老闆的心情越來越好,看來加薪升職的日子指日可待。 ” !
~ 某超級不負責任之江湖傳言
Tools!
Anbu Profiler for Laravel PHP https://github.com/daylerees/anbu !laravel-debugbar https://github.com/barryvdh/laravel-debugbar !The Computer Language Benchmarks Game http://benchmarksgame.alioth.debian.org/u32/program.php?test=nbody&lang=php&id=3 !ab - Apache HTTP server benchmarking tool http://httpd.apache.org/docs/2.2/programs/ab.html
LIVE DEMO
Round:1 Homestead: php-fpm vs HHVM
測試數據php-fpm
HHVM
LIVE DEMO
Round:2 Cloud hosting: php-fpm vs HHVM
測試數據
php-fpm
HHVM
測試數據 (ab)
php-fpm
nginx + php-fpm + Wordpress
測試數據 (ab)
HHVM
nginx + HHVM + Wordpress
HHVM 安裝( ubuntu 14.04 )
!詳細步驟可參閱 http://fideloper.com/hhvm-nginx-laravel
總結!
‧Homestead 對於開發者的便利性
‧HHVM 的發展值得關注
‧HHVM 需要更多測試與調教