doujiao9574 2015-06-08 16:55
浏览 57
已采纳

用于php的Gwan或nginx

I have large photo file and would like to use gwan as it fast. Is there any performance benefits in comparison to nginx fast-cgi. Does gwan fast at timd to first byte? Is it faster at connecting time? Is commputing time faster? Is throughput faster?Furthermore can you install hhvm on gwan. If you can, how would you install hhvm?would it give a performance benefit to php(how much)?

  • 写回答

2条回答 默认 最新

  • dougong5817 2015-06-09 08:44
    关注

    The downside of FasCGI is that it's itself a backend server: instead of having only G-WAN as a server, you are limited by the speed of the backend server when G-WAN sends it requests and waits its replies:

                Internet                   LAN
    [clients] ============ [G-WAN] ----------------- [FastCGI + PHP]
              latency1     latency2     latency3      latency4  latency5
    

    In this case, the latency of a FastCGI server and the extra LAN latency are slowing-down G-WAN.

    A more efficient way is to have G-WAN load and run the HHVM itself, which has been done with PH7, another thread-safe PHP runtime provided with G-WAN v4+:

                Internet
    [clients] ============ [G-WAN + PHP]
              latency1     latency2 latency3 
    

    It is technically possible to implement *.hhvm G-WAN scripts like it has been done for G-WAN *.ph7, *.java, *.scala and *.cs (C#) scripts. This requires writting a G-WAN C module to load the HHVM in the G-WAN memory-sapce (something that may take time depending on the level of support provided by the Facebook HHVM team).

    One could also use the G-WAN CGI interface to invoke HHVM as a local process (like G-WAN was forced to do for the thread-unsafe Zend PHP). But the results in terms of performance greatly depend on the initialization and processing times of the HHVM executable (not to mention the extra per-request overhead). This third way is simpler to implement but necessarily slower than a native HHVM G-WAN module.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 素材场景中光线烘焙后灯光失效
  • ¥15 请教一下各位,为什么我这个没有实现模拟点击
  • ¥15 执行 virtuoso 命令后,界面没有,cadence 启动不起来
  • ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
  • ¥20 有关区间dp的问题求解
  • ¥15 多电路系统共用电源的串扰问题
  • ¥15 slam rangenet++配置
  • ¥15 有没有研究水声通信方面的帮我改俩matlab代码
  • ¥15 ubuntu子系统密码忘记
  • ¥15 保护模式-系统加载-段寄存器