标签归档:facebook

facebook hack 试用

fedora 20下安装hhvm

添加hhvm源:
vim /etc/yum.repos.d/hhvm.repo

[hhvm]
name=HHVM for Fedora $releasever - $basearch
baseurl=http://dl.hhvm.com/fedora/$releasever/$basearch/

更新

wget http://dl.hhvm.com/conf/hhvm.gpg.key
sudo rpm --import hhvm.gpg.key
sudo yum install hhvm

性能比较

PHP hello world

hhvm -m daemon -p 9910 t.php
ab -n10000 -c100 http://localhost:9910/t.php  # 15687/sec
ab -n10000 -c100 http://localhost/t.php # nginx+fpm: 11016/sec

Yii test

hhvm -m daemon -p 9910 yiitest/index.php 
ab -n10000 -c100 http://localhost:9910/yiitest/index.php # 4039/sec
ab -n10000 -c100 http://localhost/yiitest/index.php # nginx+fpm: 259/sec

vim hack.php

<?hh
echo 'hello';

test hack.php

hhvm -m daemon -p 9910 hack.php 
ab -n10000 -c100 http://localhost:9910/hack.php # 15169/sec 基本无变化,可能因为程序太简单