V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX 提问指南
asher
V2EX  ›  问与答

网站访问巨慢,Chrome开发者工具查看显示 waiting 时间长,基本都是 6s 以上。访问静态页没有这问题。请问如何解决这个问题?谢谢。

  •  
  •   asher · 2014-01-01 21:27:41 +08:00 · 5585 次点击
    这是一个创建于 3791 天前的主题,其中的信息可能已经有所发展或是发生改变。
    linode 服务器,装的是 lnmp 套件,centos 系统。
    菜鸟一枚,需要进行什么命令排查能详细点的话恳请详细点。
    谢谢。。
    第 1 条附言  ·  2014-01-02 01:17:09 +08:00
    搞定。确实是某几个文件代码有不同。谢谢楼上的兄弟。
    5 条回复    1970-01-01 08:00:00 +08:00
    Jat001
        1
    Jat001  
       2014-01-01 23:29:58 +08:00
    slowlog in php-fpm.conf.
    example:
    slowlog = /var/log/php/slow.log
    request_slowlog_timeout = 1
    chairuosen
        2
    chairuosen  
       2014-01-02 00:00:22 +08:00
    1,从程序下手,优化程序。
    2,从环境下手,配缓存,CDN之类的。
    asher
        3
    asher  
    OP
       2014-01-02 01:05:29 +08:00
    @chairuosen 代码放在其他服务器没这种问题的。

    @Jat001 请问这是什么意思呢?

    [01-Jan-2014 17:01:17] WARNING: [pool www] child 15865, script '/home/wwwroot/www.xxx.com/category.php' (request: "GET /category.php") executing too slow (6.709603 sec), logging
    [01-Jan-2014 17:01:17] NOTICE: child 15865 stopped for tracing
    [01-Jan-2014 17:01:17] NOTICE: about to trace 15865
    [01-Jan-2014 17:01:17] NOTICE: finished trace of 15865
    a2z
        4
    a2z  
       2014-01-02 08:42:55 +08:00
    category.php 都执行了什么操作?

    目测是SQL没有优化的原因
    a2z
        5
    a2z  
       2014-01-02 08:44:22 +08:00
    顺带打开mysql的log slow query看一下就知道了。

    这种情况处理过很多次,基本就是sql里where的地方没加索引,要么就是用了太多低效率的nested query
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   1502 人在线   最高记录 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 28ms · UTC 16:58 · PVG 00:58 · LAX 09:58 · JFK 12:58
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.