dsa122870 2016-02-10 01:15
浏览 848
已采纳

响应时间慢:Docker容器中的Laravel 5.2

When running Laravel 5.2 within a PHP-7 docker container I'm getting response times in 300ms - 400ms.

That is extremely slow although if I'm just echoing out phpinfo() on the same container the response time is 15ms - 50ms is anyone experiencing these slow response times with Laravel in a Docker container?

  • 写回答

2条回答

  • doujing8435 2016-02-10 01:43
    关注

    Okay, problem solved.

    On a local development environment using Docker 1.10 with the VirtualBox driver and a volume mounted to the host system (that would be Boot2Docker VM and OSX) the performance is incredibly woeful, as described above 300ms - 600ms.

    Use the same configuration without the mounted volumes 20ms - 30ms response times. My assumption is that because Laravel has intensive disk I/O due to the large amount of files it loads on each request this is impacted by how VirtualBox shares folders between the host and a VM.

    Issue is not a Docker or Laravel, its a VirtualBox VM issue.

    UPDATE:

    Comparing differing environments in a docker

    Note: the below are without artisan optimize --force or artisan config:cache

    • HHVM 13ms - 31ms (TCP port 9000)
    • HHVM 12ms - 22ms (Unix socket)
    • PHP-7 FPM 42ms - 73ms (TCP port 9000)
    • PHP-7 FPM 38ms - 55ms (Unix socket)

    WOW...!

    HHVM with artisan optimisations + unix sockets: 8ms - 12ms


    PHP-7 FPM with artisan optimisations + unix sockets: 38ms - 42ms

    Take a look at HHVM with optimizations and unix sockets. It's very fast.

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

报告相同问题?

悬赏问题

  • ¥15 求差集那个函数有问题,有无佬可以解决
  • ¥15 MATLAB动图问题
  • ¥15 【提问】基于Invest的水源涵养
  • ¥20 微信网友居然可以通过vx号找到我绑的手机号
  • ¥15 寻一个支付宝扫码远程授权登录的软件助手app
  • ¥15 解riccati方程组
  • ¥15 display:none;样式在嵌套结构中的已设置了display样式的元素上不起作用?
  • ¥15 使用rabbitMQ 消息队列作为url源进行多线程爬取时,总有几个url没有处理的问题。
  • ¥15 Ubuntu在安装序列比对软件STAR时出现报错如何解决
  • ¥50 树莓派安卓APK系统签名