Varnish - 高效的 HTTP accelerator

原贴:http://www.iuiuiu.com/plog/post/2/313

Varnish - 高效的 HTTP accelerator

04/11/2007

这几天在 google 找别的东西的时候看到 Varnish,其项目主页上的简单介绍:

Varnish is a state-of-the-art, high-performance HTTP accelerator. Varnish is targeted primarily at the FreeBSD 6 and Linux 2.6 platforms, and will take full advantage of the virtual memory system and advanced I/O features offered by these operating systems.

Varnish 的主要开发者是 Poul-Henning Kamp,是 FreeBSD 方面的专家。Varnish 从根上设计的就是作为反向代理使用的,作者认为 squid 等有点过时了,没有考虑到现在硬件的发展,而 Varnish 是相当的 modern~~,在他写的这篇 ppt 中有详细介绍。Varnish 网站上称在相同硬件条件下效率要比 squid 高 10-20 倍, 目前在挪威最大的报社 Verdens Gang (http://www.vg.no/)上运行,据说用 1 台 Varnish 替代了原来 12 台 squid,效率还是很可观的。

安装使用也比较简单,启动 varnishd 加速本机的 8080 端口:

varnishd -a :80 -b localhost:8080
或者使用 Varnish configuration language (VCL) 文件来配置:
backend webserver {
        set backend.host = "localhost";
        set backend.port = "8080";
}

sub vcl_recv {
        if (req.http.host ~ "") {
                set req.backend = webserver;
        } else {
                error 404 "You requested a document from an unknown virtual host.";
        }
}

项目主页上提供的文档不是很多,google 到一篇 Working with Varnish and Plone,有大致的解释和示例,更多的信息得去 man 里找。

0 Comments Add your own

 
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值