Web application Acceleration Scenario: Varnish

Source: Internet
Author: User
Tags http request varnish
In the absence of any optimizations, every HTTP request, the Web server must read the requested page's data from the server's disk and send it to the client. The speed of disk access and its slowness relative to memory access speed (memory access speed is 10 of the disk access speed of 5 to 6 times). By caching the visited pages in memory, the next access is read directly from memory, which can effectively speed up the access of the Web application. Traditional Proxy and Reverse proxy: In general, use the browser directly connected to other Internet sites to obtain network information, directly contact the destination site server, the destination site server to send back the information. The other server between the client and the Web server is called a proxy server, the browser does not directly to the Web server to retrieve the webpage, but sends the request to the proxy server, the signal is sent to the proxy server, the proxy server retrieves the information needed by the browser and transmits it to the browser. The work flow is as follows:


Most proxy server has buffering function, like a cache, there is a lot of storage space, the new data is constantly cached to the local storage, if the local memory is already existing user requested data and is up to date, directly to the memory data sent to the user, This can significantly improve browsing speed and efficiency. The proxy server does the job of forwarding the user HTTP request to the Web server and then sending the response data received from the Web server to the user's browser. So from the Web server point of view, the proxy server and the user browser is the same nature, they all play the role of HTTP proxy.
installation and configuration of the Varnish Download the source file and follow the procedure below to install it.

# tar zxvf varnish-3.0.1.tar.gz #cd varnish-3.0.1.tar.gz

Assuming that the installation is under/usr/local/varnish

#./configure--prefix =/usr/local/varnish #make #make Install

use the following command to start varnish

#varnishd-F/usr/local/varnish/etc/default.vcl-s malloc,128m \ t 127.0.0.1:2000-a:8080
or:

#service Varnish Start
Description:-F: Specifies the configuration file used by the varnish. -S: Determine the storage type and storage usage used by the varnish, either using the malloc type or using the file cache, just change malloc to file. -T: Specifies the address and port that the hypervisor listens to. Manage varnish-a with this program without restarting varnish: Specify the address and port that the varnish listens to.

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.