Friday 21 February 2014

TCP, HTTP and web performance

This is a study note to Udemy class
https://www.udemy.com/tcp-http-spdy-deep-dive/

Web loading performance impacts the user feeling about the website. The research shows 100ms is the ideal time for web loading time.


By general, we can improve the web loading time in the below four areas:
Makeup/content:
Make fewer HTTP request
Optiomize css and scripts
Minimize cookies
Browser:
       User progressive enhancement
       Load scripts without blocking
       Use AJAX and defferred scripts
Network:
       Use caching and compression
       Use CDN
       Reduce DNS lookups
       Avoid redirctions
       Prefect commonly used resources
Server:
       Load balancing
       Backend server scripts
       Optimize database

Beside the webserver and backend processing time, the network overload has a great impact on the web loading time.

TCP was designed and devlopped in 1980 under the lower network condition. It was very good to handle the low bandwidth network. It is stream focusing with the features such as slow start, sliding window, congestion windows, nagel argithem etc.

RTT is very important for web response time. It is controlled by the light traveling time between you and the server plus lots of other factors such as network device hops, bandwidth.

Then how web load time is influenced by the TCP/HTTP
1.       1 RTT to establish the TCP
2.       1 RTT to send the HTTP request and get the response time
3.       1 RTT to get the other date further than the 3 packages
4.       extermly slow down when package lost, Retransission happens.

What we can do to improve the response time
1.       paralley TCP sessions
2.       reuse TCP sessions (persistent HTTP connections)
3.       pre-establish TCP sessions
4.       increase initial congestion window
5.       use CDN to reduce the RTT
6.       TCP fast open (HTTP GET request with TCP SYN)

Persistent HTTP Sessions
TCP session is not closed after the HTTP response is sent. The feature is supported by all major web sites and browsers. It can save TCP session control overload but will have to keep session in web server side (more threads or worker process). Timeout is set for apache

Initial congestion window: google experiment shows 10 is the suitable value for current internet congestion condition. It can send about 15k data to the browser so the content can be shown if the page is well designed.

HTTP request is sent in SYN package. Only experimental.


Web loading performance impacts the user feeling about the website. The research shows 100ms is the ideal time for web loading time.


By general, we can improve the web loading time in the below four areas:
Makeup/content:
Make fewer HTTP request
Optiomize css and scripts
Minimize cookies
Browser:
       User progressive enhancement
       Load scripts without blocking
       Use AJAX and defferred scripts
Network:
       Use caching and compression
       Use CDN
       Reduce DNS lookups
       Avoid redirctions
       Prefect commonly used resources
Server:
       Load balancing
       Backend server scripts
       Optimize database

Beside the webserver and backend processing time, the network overload has a great impact on the web loading time.

TCP was designed and devlopped in 1980 under the lower network condition. It was very good to handle the low bandwidth network. It is stream focusing with the features such as slow start, sliding window, congestion windows, nagel argithem etc.

RTT is very important for web response time. It is controlled by the light traveling time between you and the server plus lots of other factors such as network device hops, bandwidth.

Then how web load time is influenced by the TCP/HTTP
1.       1 RTT to establish the TCP
2.       1 RTT to send the HTTP request and get the response time
3.       1 RTT to get the other date further than the 3 packages
4.       extermly slow down when package lost, Retransission happens.

What we can do to improve the response time
1.       paralley TCP sessions
2.       reuse TCP sessions (persistent HTTP connections)
3.       pre-establish TCP sessions
4.       increase initial congestion window
5.       use CDN to reduce the RTT
6.       TCP fast open (HTTP GET request with TCP SYN)

Persistent HTTP Sessions
TCP session is not closed after the HTTP response is sent. The feature is supported by all major web sites and browsers. It can save TCP session control overload but will have to keep session in web server side (more threads or worker process). Timeout is set for apache

Initial congestion window: google experiment shows 10 is the suitable value for current internet congestion condition. It can send about 15k data to the browser so the content can be shown if the page is well designed.

HTTP request is sent in SYN package. Only experimental.


No comments:

Post a Comment