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条)

报告相同问题?

悬赏问题

  • ¥20 iqoo11 如何下载安装工程模式
  • ¥15 本题的答案是不是有问题
  • ¥15 关于#r语言#的问题:(svydesign)为什么在一个大的数据集中抽取了一个小数据集
  • ¥15 C++使用Gunplot
  • ¥15 这个电路是如何实现路灯控制器的,原理是什么,怎么求解灯亮起后熄灭的时间如图?
  • ¥15 matlab数字图像处理频率域滤波
  • ¥15 在abaqus做了二维正交切削模型,给刀具添加了超声振动条件后输出切削力为什么比普通切削增大这么多
  • ¥15 ELGamal和paillier计算效率谁快?
  • ¥15 蓝桥杯单片机第十三届第一场,整点继电器吸合,5s后断开出现了问题
  • ¥15 file converter 转换格式失败 报错 Error marking filters as finished,如何解决?