海运的博客

Centos6安装HHVM

发布时间:September 24, 2014 // 分类:HHVM // No Comments

安装源:

rpm -ivh http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
cd /etc/yum.repos.d
wget http://www.hop5.in/yum/el6/hop5.repo

安装HHVM:

yum install hhvm --setopt=protected_multilib=false
关闭多版本检查,libgcc i686版本冲突
--setopt=protected_multilib=false

HHVM集成的PHP扩展:
https://github.com/facebook/hhvm/wiki/Extensions

JIT编译器HHVM提升PHP性能

发布时间:December 26, 2013 // 分类:HHVM // No Comments

Debian7下安装:

echo 'deb http://dl.hhvm.com/debian wheezy main' >> /etc/apt/sources.list.d/hhvm.list
apt-get update
apt-get install hhvm

运行于Server模式:

Server {
  Port = 80
  ExposeHPHP = false
  SourceRoot = /var/www
}

Eval {
  Jit = true
  JitWarmupRequests=0
}

Log {
  Level = Error
  UseLogFile = true
  File = /var/log/hhvm/error.log
  Access {
    * {
      File = /var/log/hhvm/access.log
      Format = %h %l %u %t \"%r\" %>s %b
    }
  }
}

VirtualHost {
  * {
    Pattern = .*
    RewriteRules {
      dirindex {
        pattern = ^/(.*)/$
        to = $1/index.php
        qsa = true
      }
    }
  }
}

StaticFile {
  FilesMatch {
    * {
      pattern = .*\.(dll|exe)
      headers {
        * = Content-Disposition: attachment
      }
    }
  }
  Extensions {
    css = text/css
    gif = image/gif
    html = text/html
    jpe = image/jpeg
    jpeg = image/jpeg
    jpg = image/jpeg
    png = image/png
    tif = image/tiff
    tiff = image/tiff
    txt = text/plain
  }
}

运行于Fastcgi模式:

Server {
  Port = 9000
  Type=fastcgi
  ExposeHPHP = false
}

Eval {
  Jit = true
  JitWarmupRequests=0
}

Log {
  Level = Error
  UseLogFile = true
  File = /var/log/hhvm/error.log
  Access {
    * {
      File = /var/log/hhvm/access.log
      Format = %h %l %u %t \"%r\" %>s %b
    }
  }
}

启动HHVM:

hhvm -m daemon --config server.hdf

默认请求超过11次才启动JIT模式,修改为立即启动为JIT模式。

  JitWarmupRequests=0

CLI:

hhvm -v "Eval.Jit=true" f.php

集成的扩展:https://github.com/facebook/hhvm/wiki/Extensions
性能提升多少?看测试脚本:https://github.com/ckwalsh/php_hhvm_bench

分类
最新文章
最近回复
  • 头很黑: 除了发送eth转账 ,还能转账其他的代币吗 比如eos
  • 米扑博客: 总结的很棒
  • 米扑博客: 很赞的博客
  • 常易北: 满分顶楼主!!!我也是,现在网上瞎几把扫别人云主机的智障太多了!
  • track: NAT 部分没处理,这块感觉有问题。
  • yu: 查到有用的资料很幸福!
  • boscotsang: 请问下服务器端如何控制权限让通过权限认证的客户端才能连接?现在这样只要有自编译的客户端程序都可...
  • yck932: 大侠,请问哪里有 tunnels 详细参考资料,谢谢
  • bubble: 现在linux 4.9以上的内核有个bbr的参数,用这个bbr比用锐速效果更好,可参考我的博文...
  • wang: openwrt 只有 tmp/etc/miniupnpd.conf 修改后又重置了,其他路径找...