开源HTTP加速器-Varnish
2010-10-23 10:54:41 阿炯

本站赞助商链接,请多关照。

Varnish是一款高性能的开源HTTP加速器,挪威最大的在线报纸 Verdens Gang 使用3台Varnish代替了原来的12台squid,性能居然比以前更好。



Varnish is a web accelerator written with performance and flexibility in mind. It's modern architecture gives it a significantly better performance than many of it's competing products. Varnish store web pages in memory so the web servers don't have to create the same web page over and over again. The web server only recreate a page when it is changed. Additionally Varnish can serve web pages much faster then any application server is capable of - giving the website a significant speed up.

Installation on Debian
Varnish is distributed in the Debian package repositories, but the version there might be out of date, and we generally recommend using the packages provided by varnish-cache.org or packages from backports.debian.org.

To use the varnish-cache.org repository and install varnish, do the following:
1. curl http://repo.varnish-cache.org/debian/GPG-key.txt | apt-key add -
2. echo "deb http://repo.varnish-cache.org/debian/ lenny varnish-2.1" >> /etc/apt/sources.list
3. apt-get update
4. apt-get install varnish

来自 Varnish 的消息称,单台Varnish服务器可支持每秒27万请求数,而且瓶颈主要是在网络带宽上。该报道还称,如果采用Varnish的集群模式,这个数字还可到达10万每秒。

测试环境:
Varnish 2.1.3 on 64bit Linux.
Httperf for client load.
两台拥有两个Xeon x5670(6核)的服务器,一台运行Varnish,一台作为测试客户端,采用千兆网连接。

最新版本:4.0
该版本主要改进包括:
完全支持流对象
后台获取失效的对象
新的 varnishlog 查询语言,允许对请求进行自动分组
复杂的请求时间戳和字节计数
安全方面的提升

详细介绍请看发行说明

最新版本:5.0
Varnish 5.0更改了大部分内置APIs和增加一些在Varnish 4.1基础上的新特性。其他更新内容:
单独的VCL文件和VCL标签
支持非常实验性的HTTP/2
碎片导向器
Hit-For-Pass 现在变成 Hit-For-Miss
Ban Lurker 提升
请求体经常发送/"cacheable POST"
ESI和后端请求聚合("waitinglist")提升
后端代理协议的请求
默认VCL搜索路径

查看完整更新内容


官方主页:http://www.varnish-cache.org/

该文章最后由 阿炯 于 2016-10-22 14:15:21 更新,目前是第 3 版。