What is SPDY? How to deploy Spdy?_ servers other

Source: Internet
Author: User
Tags server error log web services http 2

On the left is normal HTTPS loading and the right side is SPDY loading. Isn't it amazing?

What is SPDY?

SPDY is a Google-developed application layer protocol based on Transmission Control (TCP), and the development team is pushing SPDY to become a formal standard (now the Internet draft). The SPDY protocol is designed to shorten load times and improve security for Web pages through compression, multiplexing, and prioritization. (SPDY is the Speedy of the sound, meaning faster)

The relationship between SPDY and HTTP

The SPDY protocol only optimizes HTTP in terms of performance, and its core idea is to minimize the number of connections and not make much changes to HTTP semantics. Specifically, SPDY uses HTTP methods and headers, but deletes some headers and writes the parts of the HTTP management connection and data transfer format, so it is basically compatible with HTTP.

Google in the SPDY white Paper said to infiltrate the protocol stack and replace the Transport Layer Protocol (TCP), but because it is difficult to deploy or implementation, so Google is prepared to first of the application layer protocol HTTP to improve, first on the SSL to add a session layer to achieve SPDY protocol, and HTTP get and POST message formats remain unchanged, that is, all existing server-side applications do not have to make any changes.

So at the moment, the purpose of SPDY is to enhance HTTP, which is a better implementation and support for HTTP. As for the future SPDY is widely used will not play a cat for the Prince, replace the HTTP and completely subvert the entire Internet is Google's thing.

Why re-establish a SPDY?

Distance from the father of the World Wide Web Tim Berners-Li Faming and drive HTTP to become the Internet's most popular protocol for the past more than 10 years (now the HTTP 1.1 specification has stagnated for 13 years), with the rapid development of WEB technology, especially HTML5, including the WebSockets protocol and the current network environment changes, transmission content changes, the original HTTP specification has been gradually unable to meet the needs of people, HTTP needs further development, so the Httpbis team has been set up and authorized to consider HTTP 2.0, hoping to solve the current HTTP restrictions imposed. And SPDY is Google's attempt to become the next generation of Internet communications in the run-up to 1.1 across 2.0, which has long been considered the only viable option for HTTP 2.0.

Lack of HTTP protocol

1. One-way connection request inefficient

The biggest disadvantage of the HTTP protocol is that each TCP connection can only correspond to one HTTP request, that is, each HTTP connection requests only one resource, and the browser can only be resolved by establishing multiple connections. In addition, in HTTP, the request is strict first-in-first out (FIFO), if the middle of a request processing time is longer will block the subsequent request.

(Note: Although the HTTP pipelining has improved the connection request, the complexity has increased significantly and is not universal)

2. HTTP only allows the client to initiate a request

The server can only wait for the client to send a request, and it is a shackle to meet preload status.

3. HTTP Header Redundancy

HTTP headers are sent over and over in the same session, with redundant information in the middle, such as user-agent, Host, etc. that do not need to be sent repeatedly, wasting bandwidth and resources.

Advantages of the SPDY protocol

1. Multiple Multiplexing request optimization

SPDY stipulates that there can be unlimited concurrent requests within a SPDY connection, allowing multiple concurrent HTTP requests to share a single TCP session. This SPDY by reusing multiple requests on a single TCP connection. Instead of opening the connection individually for each request, you can transfer all the resources on a Web page by simply establishing a TCP connection, not only reducing the time of the message interaction, but also avoiding the delay in creating a new connection, making TCP more efficient.

In addition, SPDY multiplexing can be set to the priority level, rather than the traditional HTTP as strict as the first in the first out of a processing request, it will choose the first transfer of CSS such more important resources, and then transfer the site icon and other less important resources, you can avoid the use of non-critical resources to occupy the network channel problem, promote Performance of TCP.

2. Support Server Push Technology

The server can initiate communication to the client and push data to the client, which allows the user to maintain a fast network.

3. SPDY Compressed HTTP headers

Discarding unnecessary header information and compressing the latency and bandwidth of redundant data transfer.

4. Enforce the use of SSL transport protocol

Google believes that the future direction of the Web must be a secure network connection, all requests for SSL encryption, information transmission is more secure.

The significance of SPDY protocol

According to Google, the only thing SPDY was created to do is make the Web faster (strive to made the whole web fast), and the name SPDY (Speedy) also seems to imply this. So what is the meaning of SPDY?

1. Ordinary Users:

For the user, the SPDY hidden under the browser is not any different than HTTP, but we can feel that Google service is unusually fast under Chrome, which is SPDY's credit. In addition, the Web site information transmission encryption without fear of information interception, greatly increased security and confidentiality.

2. Front End personnel:

For the front-end engineers, to enhance the efficiency of the page is a very important thing, most of the current use such as CSS sprites methods to optimize the site, for the page load when each picture, icon request a connection or even use in different pages to refer to different pictures to reduce the number of pictures in a page. And now with SPDY request optimizations, you can rearrange the order of requests, which can greatly mitigate the impact of picture requests when the page is loaded. Like the Geek Park registration page, if the number of users, such as the Geek Park 2012 Innovation Conference or the 27th stage of the Great Wall, can obviously feel the request will drag the overall page load slow or even change card, I believe that for this, often Taobao or brush micro Bo will be deeply experienced, Once the network speed is slightly slower, there will be page loading anomalies, as well as Apple App Store (except for the server due to the delay of the area), pea pod applications such as the application of the distribution platform icon refresh slow, etc., as shown in the following video.

3. Operation and maintenance personnel:

SPDY reduces the number of connections and also reduces the resources consumed by each client on the server, freeing up more memory and CPUs. In addition, SPDY can increase the browsing speed by one times, the page load delay improvement of 64%.

The SPDY agreement supported by the public

If you're using a Chrome browser and using Google's Web services like Gmail, you're no longer accessing these services via HTTP. When you open the chrome://net-internals/in the browser #spdy you will find that you are already using the Spdy protocol. (in addition to Google's own Gmail, Google Plus, etc., other public sites such as Twitter and Webtide have also supported the deal.) At home, Pea Pod 2.0 based on WebKit also said it would introduce Chrome's spdy technology to further improve speed.

As shown in the previous illustration, the implementation of the SPDY requires both the browser client and the WEB server to support it. In the client browser this fast Google's own Chrome and chromium full range, needless to say, have supported SPDY, and Mozilla's Firefox 13 also defaults to SPDY support. Amazon's Silk use of SPDY's depth is no worse than Google's own Chrome and Firefox.

The Netty, jeety, varnish, Erlang and hightide application servers and Node.js-oriented servers have also been declared to support SPDY, including the most popular and broadest Apache in the Web server. (Nginx also said it will support SPDY)

How do I deploy SPDY?

Google recently officially released the most popular WEB server Apache plug-in mod_spdy, download it after installation of your Apache server can use the SPDY protocol and compatible Spdy protocol browser such as Chrome, FireFox and other communications. As previously stated, SPDY is run on HTTPS, and non-HTTPS traffic is not affected by mod_spdy.

SPDY Deployment Requirements:

1. Apache 2.2 (≥2.2.4)
2. Mod_ssl Module Open

SPDY Deployment steps:

1. Download Mod_spdy module

Download the installation package of the corresponding system to the download page

2. Install Mod_spdy module

Run the following command line at the system terminal

Dpkg-i Mod-spdy-*.deb
Apt-get-f Install

-System for Debian/ubuntu

------------------------------------------------------------

Yum Install at (if you don't already have ' at ' installed)
Rpm-u mod-spdy-*.rpm

-System for Centos/fedora

3. Reboot server (Apache)

Sudo/etc/init.d/apache2 Restart (debian/ubuntu)

4. Determine whether to open or not

Open the Chrome browser and enter and go to the chrome://net-internals/#spdy page to see if the host name appears in the tab. If a description has been deployed, if the query does not appear in the server error log (Error.log).

Web Basics for the future?

In the latest protocol document, Google has SPDY into two tiers, one of which is described as Http-like, with the intention of replacing HTTP (Google's latest article has been called SPDY "a replacement for http"). The HTTP 2.0 standard-setting Workgroup (HTTPBIS) also says that SPDY is hopeful of replacing the current HTTP transport implementation.

Given the share of Chrome and Android and the push of standards, I believe SPDY will have a good future. So it is also wise to choose to support SPDY at this moment.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.