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 iOS 自定义输入法-第三方输入法
  • ¥15 很想要一个很好的答案或提示
  • ¥15 扫描项目中发现AndroidOS.Agent、Android/SmsThief.LI!tr
  • ¥15 怀疑手机被监控,请问怎么解决和防止
  • ¥15 Qt下使用tcp获取数据的详细操作
  • ¥15 idea右下角设置编码是灰色的
  • ¥15 全志H618ROM新增分区
  • ¥15 在grasshopper里DrawViewportWires更改预览后,禁用电池仍然显示
  • ¥15 NAO机器人的录音程序保存问题
  • ¥15 C#读写EXCEL文件,不同编译