Varnish cache

Varnish cache

Infobox_Software
name = Varnish



caption =
developer = Poul-Henning Kamp Linpro
latest_release_version = 1.1.2
latest_release_date = release date|2007|12|20
operating_system = Unix
genre = open source
license = BSD
website = http://varnish.projects.linpro.no/

Varnish is a HTTP accelerator designed for content-heavy dynamic web sites. In contrast to other HTTP accelerators, many of which began life as client-side proxies or origin servers, Varnish was designed from the ground up as an HTTP accelerator. The Varnish web site claims that Varnish is ten to twenty times faster than the popular Squid cache on the same hardware.

History

The project was initiated by the online branch of the Norwegian tabloid newspaper Verdens Gang. The architect and lead developer is Danish independent consultant Poul-Henning Kamp, with management, infrastructure and additional development being provided by the Norwegian Linux consulting company Linpro.

Varnish is open source (specifically, it is distributed under a two-clause BSD license), but commercial support is available from Linpro, amongst others. Currently, the rights to the code are jointly held by Verdens Gang and Linpro.

Architecture

Varnish stores data in virtual memory and leaves the task of deciding what is stored in memory and what gets paged out to disk to the operating system. This helps avoid the situation where the operating system starts caching data while they are moved to disk by the application.

Futhermore, varnish is heavily threaded, with each client connection being handled by a separate worker thread. When the configured limit on the number of active worker threads is reached, incoming connections are placed in an overflow queue; only when this queue reaches its configured limit will incoming connections be rejected.

The principal configuration mechanism is VCL ("Varnish Configuration Language"), a DSL used to write hooks which are called at critical points in the handling of each request. Most policy decisions are left to VCL code, making Varnish far more configurable and adaptable than most other HTTP accelerators. When a VCL script is loaded, it is translated to C, compiled to a shared object by the system compiler, and linked directly into the accelerator.

A number of run-time parameters control things such as the maximum and minimum number of worker threads, various timeouts etc. A command-line management interface allows these parameters to be modified, and new VCL scripts to be compiled, loaded and activated, without restarting the accelerator.

In order to reduce the number of system calls in the fast path to a minimum, log data is stored in shared memory, and the task of filtering, formatting and writing log data to disk is delegated to a separate application.

Performance

While Varnish is designed to reduce contention between threads to a minimum, its performance will only be as good as that of the system's pthreads implementation. Additionally, a poor malloc implementation may add unnecessary contention and thereby limit performance.

When the requested document is in cache, response time is typically measured in microsecondsFact|date=April 2008. This is significantly better than most HTTP serversFact|date=April 2008, so even sites consisting mostly of static content will benefit from Varnish.

Load balancing

Still in experimental stage as of December 2007 [ [http://varnish.projects.linpro.no/changeset/1931 Changeset 1931 - Varnish - Trac ] ] is the load balancing feature of Varnish. It will allow to distribute incoming requests to Varnish among several backend servers.

See also

* Squid cache
* Pound reverse proxy
* web accelerator which discusses host-based HTTP acceleration
* proxy server which discusses client-side proxies
* reverse proxy which discusses origin-side proxies

References

External links

* [http://varnish.projects.linpro.no/ official web site]


Wikimedia Foundation. 2010.

Игры ⚽ Нужно сделать НИР?

Look at other dictionaries:

  • Varnish — Aktuelle Version 3.0.1 (30. August 2011) Betriebssystem Unix Programmier­sprache C Kategorie Proxy Lizenz …   Deutsch Wikipedia

  • Varnish (disambiguation) — Varnish is a mixture used to harden primarily wood.* Varnish * Desert Varnish * Varnish cache A reverse proxy program …   Wikipedia

  • Poul-Henning Kamp — (sometimes known as PHK ) is a Danish FreeBSD developer, responsible for implementation of the widely used MD5 password hash algorithm, a vast quantity of systems code, including the FreeBSD GEOM storage layer, GBDE cryptographic storage… …   Wikipedia

  • X-Forwarded-For — The X Forwarded For (XFF) HTTP header is a de facto standard for identifying the originating IP address of a client connecting to a web server through an HTTP proxy. This is a non RFC standard request header which was introduced by the Squid… …   Wikipedia

  • Linpro — Infobox Company company name = Linpro company company type = Private (AS) foundation = 1995 location = Oslo, Norway key people = Dag Asheim: Founder and board member; Michael Max: Chairman; Trond Heier: CEO industry = Computer software… …   Wikipedia

  • X-Forwarded-For — Der X Forwarded For (XFF) ist ein De facto Standard HTTP Header Eintrag im Internet. Der Header dient dazu, die IP Adresse des Benutzers zu übermitteln, wenn dieser durch einen Proxy auf einen Webserver zugreift. Meistens gehören diese Proxys zu… …   Deutsch Wikipedia

  • Pound (networking) — Infobox Software name = Pound caption = developer = Apsis latest release version = 2.4.3 latest release date = operating system = Unix genre = open source license = GPL website = http://www.apsis.ch/pound/Pound is a lightweight open source… …   Wikipedia

  • Proxy server — For Wikipedia s policy on editing from open proxies, please see Wikipedia:Open proxies. Communication between two computers (shown in grey) connected through a third computer (shown in red) acting as a proxy. In …   Wikipedia

  • The Red Violin — Infobox Film name = The Red Violin imdb id = 0120802 producer = Niv Fichman director = François Girard writer = Don McKellar François Girard starring = Samuel L. Jackson Jason Flemyng Greta Scacchi Christoph Koncz music = John Corigliano… …   Wikipedia

  • Newspaper Rock State Historic Monument — Coordinates: 37°59′18″N 109°31′05″W / 37.98833°N 109.51806°W / 37.98833; 109.51806 …   Wikipedia

Share the article and excerpts

Direct link
Do a right-click on the link above
and select “Copy Link”