Optimize your website -part 1

November 16, 2013 in Knowledge Sharing, Web Design

Problem

Lots of our team members found the web site is really slow these days, they are asking us to investigate the issue and optimize our website

Benefits

Improve our website performance will greatly improve our work efficiency and customer experience, while I am doing the investigation ,I also find that it will greatly help the SEO ranking.
页面第一字节响应时间与关键词排名的关系:
fisrtbit

Testing tool

We running the online tool  http://www.webpagetest.org to test our website’s performance and we get the following result:

20131118204442

Capture2

Compare the two image we could get a conclusion that:

Our site performance it greatly decided by Time to First Byte.

Report from google:

Capture3

What is Time to First Byte?

From wiki page we got:

Time To First Byte or TTFB is a measurement that is often used as an indication of the responsiveness of a webserver or other network resources.

It is the duration from the virtual user making an HTTP request to the first byte of the page being received by the browser. This time is made up of the socket connection time, the time taken to send the HTTP request, and the time taken to get the first byte of the page. This can be measured using Microsoft’s Application Center Test (ACT).
1.首字节时间 (Time to first byte)
解释:Time to First Byte是指客户端发送一个HTTP GET请求,接收从服务器请求资源的第一个字节所耗用的时间,中间包括了DNS查询、服务器接受响应,查询数据库,服务器反馈时间,可以看做后端时间。后端时间受哪些因素影响?网站架构影响;内存泄露;连接数太多、太多进程;外部资源消耗;SQL效率低消耗数据库资源;数据库调用缓慢;服务器资源不够或负载过大
Find the Time to First Byte Using Curl
curl -w “Connect time: %{time_connect} Time to first byte: %{time_starttransfer} Total time: %{time_total} \n” -o /dev/null http://www.possiblelab.com

Using this command in our website ,we get

~$ curl -w "Connect time: %{time_connect} Time to first byte: %{time_starttransfer} Total time: %{time_total} \n" -o /dev/null possiblelab.com
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
Connect time: 0.197 Time to first byte: 0.768 Total time: 0.768

Improve Server Response Time

This rule triggers when PageSpeed Insights detects that your server response time is above 200 ms.

Overview

Server response time measures how long it takes to load the necessary HTML to begin rendering the page from your server, subtracting out the network latency between Google and your server. There may be variance from one run to the next, but the differences should not be too large. In fact, highly variable server response time may indicate an underlying performance issue.

Recommendations

You should reduce your server response time under 200ms. There are dozens of potential factors which may slow down the response of your server: slow application logic, slow database queries, slow routing, frameworks, libraries, resource CPU starvation, or memory starvation. You need to consider all of these factors to improve your server’s response time. The first step to uncovering why server response time is high is to measure. Then, with data in hand, consult the appropriate guides for how to address the problem. Once the issues are resolved, you must continue measuring your server response times and address any future performance bottlenecks.

Gather and inspect existing performance and data. If none is available, evaluate using an automated web application monitoring solution (there are hosted and open source versions available for most platforms), or add custom instrumentation.
Identify and fix top performance bottlenecks. If you are using a popular web framework, or content management platform, consult the documentation for performance optimization best practices.
Monitor and alert for any future performance regressions!

Likes(1)Dislikes(0)

2 responses to Optimize your website -part 1

  1. Well done!

    Likes(0)Dislikes(0)
  2. 好文,学习了.

    Likes(0)Dislikes(0)

Leave a reply

You must be logged in to post a comment.