Varnish cache service installation and working principles

Source: Internet
Author: User
Tags varnish


Install varnish:


Yum-y install PCRE * ncurses-devel


Tar-zxvf varnish-2.1.2.tar.gz


CD Varnish-2.1.2


./Configure -- prefix =/usr/local/Varnish/-- enable-dependency-tracking -- enable-debugging-symbols -- enable-developer-Warnings


Make & make install



Varnishd workflow:


Varnishd processes HTTP requests, which are defined by varnish functions.

After the client sends a request to varnishd, varnish receives the request and enters the receive State. According to the VCL function rules, it determines that the request should enter the pass mode (after the backend host responds, it returns the request to the client, do not cache, the client obtains the latest content each time) or pipe mode (returns the cached unchanged content to the client), or enters Lookup (local query, search in the cache ).

When you enter the lookup status, the content will be searched in the cache. If you find the content, it will enter the hit status. If you do not find the content, it will enter the Miss status.

In the pass status, the backend request fetch status is displayed.

In the fetch status, obtain data from the backend and store the cache locally.

In the deliver status, return the obtained data to the client to complete this request.

The discard module automatically calls this module when the cached data expires or the cache space is insufficient.

 



Receive ------ Pass \ pipe

|

|

| Fetch -----

| Bytes |

|

Lookup --- Miss |

|

| Bytes

Hit ----------- deliver

 


This article is from the "fate" blog, please be sure to keep this source http://czybl.blog.51cto.com/4283444/1544830

Varnish cache service installation and working principles

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.