kanganxi
V2EX  ›  PHP

Yii2 请求比较慢的问题

  •  
  •   kanganxi · Sep 30, 2017 · 4668 views
    This topic created in 3321 days ago, the information mentioned may be changed or developed.

    同一台服务器,用 thinkphp5 的请求比较快,但是 Yii2 一个请求基本上都在 2 秒左右,在 yiichina 看到有人说是 ipv6 的问题,我做了设置,也关闭调试,但是还是没有改善,请求强大的 V 友支招

    9 replies  •  2017-10-01 05:35:40 +08:00
    alinwu05
    alinwu05
    Sep 30, 2017
    1
    你需要把具体的请求列出来,单纯拿 Yii2 和 TP 比容易误导别人,具体问题具体分析吧
    holyghost
    holyghost
    Sep 30, 2017
    2
    加上 yii2-debug 呢

    cubelate
    cubelate
    Sep 30, 2017
    3
    这个位置打 log 吧,看下慢的地方在哪里。比如我之前遇到过 laravel 默认开启 session,测试时发送了大量无 cookie 的请求,一下子生成大量的 session 文件,直接文件系统卡死了。
    kanganxi
    kanganxi
    OP
    Sep 30, 2017
    4
    @alinwu05 您说的对,我调试看看,感谢回复
    kanganxi
    kanganxi
    OP
    Sep 30, 2017
    5
    @holyghost 感谢兄弟回复
    kanganxi
    kanganxi
    OP
    Sep 30, 2017
    6
    @cubelate 非常感谢
    justplaymore
    justplaymore
    Sep 30, 2017
    7
    你需要的是 profile 工具。
    owenliang
    owenliang
    Sep 30, 2017
    8
    分析 session 文件过多倒是很有可能。
    Miy4mori
    Miy4mori
    Oct 1, 2017 via iPhone
    9
    多半是因为开了 xdebug
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   3790 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 40ms · UTC 05:30 · PVG 13:30 · LAX 21:30 · JFK 00:30
    ♥ Do have faith in what you're doing.