V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
sisyphus60
V2EX  ›  站长

「网站性能优化」,如何提高「Initial connection」性能?

  •  
  •   sisyphus60 · Jun 5, 2015 · 13511 views
    This topic created in 3981 days ago, the information mentioned may be changed or developed.

    年前搭了个人博客,用的是朋友的主机。同一个主机我的网站访问速度简直让人抓狂,最近变得更糟糕,chrome里查了网站访问情况,如下。我对网站优化一点不懂,谁帮忙分析下下面最糟糕选项[Initial connection]是什么飞机,我是不是要换主机了。
    image
    下面这个我那哥们的网站访问情况,同一个主机差别这么大?什么情况?
    image

    15 replies    2015-06-06 11:57:16 +08:00
    wy315700
        1
    wy315700  
       Jun 5, 2015
    你用了https吗,
    sisyphus60
        2
    sisyphus60  
    OP
       Jun 5, 2015
    @wy315700 用了https,地址栏左侧会有显示,是不是?我的没有
    wy315700
        3
    wy315700  
       Jun 5, 2015
    @sisyphus60 突然想起来是不是keepalive的梗
    两个网站是一台机器,你第一次连你的网站的时候是建立连接了,然后你访问你朋友的网站,自动使用了已经建立好的连接
    sisyphus60
        4
    sisyphus60  
    OP
       Jun 5, 2015
    @wy315700 应该不是的。我的什么时候都慢,他的什么时候都比我快
    wy315700
        5
    wy315700  
       Jun 5, 2015
    @sisyphus60 你访问他的网站 1没有DNS查询时间 2 没有建立连接时间,肯定是已经预读取了
    yangqi
        6
    yangqi  
       Jun 5, 2015
    你访问你网站的一个静态页面看下ttfb是多少,个人感觉是你博客程序没有优化好。

    ttfb是time to frist byte, 就是浏览器发送request到接收到服务器的第一个响应的时间,如果服务器上没有缓存,接收到request之后还要操作各种查询什么的,自然就慢了。
    sisyphus60
        7
    sisyphus60  
    OP
       Jun 5, 2015
    @wy315700 刚才又看了下,也是有的
    sisyphus60
        8
    sisyphus60  
    OP
       Jun 5, 2015
    @yangqi 不懂,怎么设置访问一个静态页面。
    发现我的网站ping的时间都比他的长。
    wy315700
        9
    wy315700  
       Jun 5, 2015
    @sisyphus60 你确定是一个主机一个IP,,,ping没理由啊
    yangqi
        10
    yangqi  
       Jun 5, 2015
    @sisyphus60 你和你朋友的不是同一个主机么?意思是一个公司的,但可能是不同的服务器?如果同一台机器ping的时间应该是一样的
    ryd994
        11
    ryd994  
       Jun 6, 2015 via Android
    是不是同一台机器,解析一下域名不就知道了嘛
    sNullp
        12
    sNullp  
       Jun 6, 2015
    你的网站慢,和 initial connection 并没有关系

    而是,你的 TTFB 有1秒,并且传输数据用了 181 ms,人家才400ms,传输数据 1ms。这些差距比 init connection 造成的影响大多了。
    sisyphus60
        13
    sisyphus60  
    OP
       Jun 6, 2015
    @wy315700 @yangqi @sNullp ,竟然是主题搞的鬼,我有的国外主题,但是字体资源都做处理了啊。
    sNullp
        14
    sNullp  
       Jun 6, 2015
    看起来像是这个主题每次你访问的时候要向国外的服务器请求什么,然后这个请求特别慢。
    sisyphus60
        15
    sisyphus60  
    OP
       Jun 6, 2015
    @sNullp 还是有些问题,访问速度不稳定,时快时慢
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   2853 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 79ms · UTC 15:22 · PVG 23:22 · LAX 08:22 · JFK 11:22
    ♥ Do have faith in what you're doing.