kanganxi
V2EX  ›  PHP

Yii2 请求比较慢的问题

  •  
  •   kanganxi · Sep 30, 2017 · 4206 views
    This topic created in 3152 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
        1
    alinwu05  
       Sep 30, 2017
    你需要把具体的请求列出来,单纯拿 Yii2 和 TP 比容易误导别人,具体问题具体分析吧
    holyghost
        2
    holyghost  
       Sep 30, 2017
    加上 yii2-debug 呢

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