asher
V2EX  ›  问与答

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

  •  
  •   asher · Jan 1, 2014 · 6178 views
    This topic created in 4598 days ago, the information mentioned may be changed or developed.
    linode 服务器,装的是 lnmp 套件,centos 系统。
    菜鸟一枚,需要进行什么命令排查能详细点的话恳请详细点。
    谢谢。。
    Supplement 1  ·  Jan 2, 2014
    搞定。确实是某几个文件代码有不同。谢谢楼上的兄弟。
    5 replies    1970-01-01 08:00:00 +08:00
    Jat001
        1
    Jat001  
       Jan 1, 2014
    slowlog in php-fpm.conf.
    example:
    slowlog = /var/log/php/slow.log
    request_slowlog_timeout = 1
    chairuosen
        2
    chairuosen  
       Jan 2, 2014
    1,从程序下手,优化程序。
    2,从环境下手,配缓存,CDN之类的。
    asher
        3
    asher  
    OP
       Jan 2, 2014
    @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  
       Jan 2, 2014
    category.php 都执行了什么操作?

    目测是SQL没有优化的原因
    a2z
        5
    a2z  
       Jan 2, 2014
    顺带打开mysql的log slow query看一下就知道了。

    这种情况处理过很多次,基本就是sql里where的地方没加索引,要么就是用了太多低效率的nested query
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   4924 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 129ms · UTC 01:08 · PVG 09:08 · LAX 18:08 · JFK 21:08
    ♥ Do have faith in what you're doing.