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

  Varnish的作者Poul-Henning Kamp是FreeBSD的内核开发者之一,他认为现在的计算机比起1975年已经复杂许多。在1975年时,储存媒介只有两种:内存与硬盘。但现在计算机系统的内存除了主存外,还包括了cpu内的L1、L2,甚至有L3快取。硬盘上也有自己的快取装置,因此squid cache自行处理物件替换的架构不可能得知这些情况而做到最佳化,但操作系统可以得知这些情况,所以这部份的工作应该交给操作系统处理,这就是Varnish cache设计架构。

  Varnish可以在FreeBSD 6.0和Linux 2.6内核上运行。

  1、编译安装varnish HTTP加速器:
引用
wget http://blog.s135.com/soft/linux/varnish/varnish-1.1.1.tar.gz
tar zxvf varnish-1.1.1.tar.gz
cd varnish-1.1.1
./configure --prefix=/usr/local/varnish
make && make install

  2、简单启动varnish守护进程,用本机80端口去反向代理加速127.0.0.1:81上的Apache服务器:
引用
/usr/local/varnish/sbin/varnishd -a :8080 -b 127.0.0.1:81 -p thread_pool_max=1500 -p thread_pools=5 -p listen_depth=512 -p client_http11=on -w 1,10000,120

  Varnish官方网站:http://www.varnish-cache.org/

  另有一份PDF文档,说明Varnish原理的:http://ishare.iask.sina.com.cn/cgi-bin/fileid.cgi?fileid=2163384

  我测试了一下,在同等配置环境下,Varnish的性能确实要超过Squid,稳定性也不错,值得继续去深入研究。


Tags: , ,
技术大类 » Cache与存储 | 评论(7) | 引用(0) | 阅读(12379)
jackbillow Email
2007-8-31 18:18
张兄,写的不错,我也测试了一下。性能是比squid高。
访客
2007-10-28 20:26
例子里面说的是一对一的代理, 应该支持像squid那样的虚拟主机代理吧。
phpsir Email Homepage
2008-6-11 11:16
IT流言终结者1:Varnish vs Squid
http://www.hiadmin.com/?p=223
您怎么看
freeke Email
2008-11-25 14:19
varnish 2.0 发布了,听说性能更加强了!
当代狂人
2008-12-9 18:58
另有一份PDF文档,说明Varnish原理的:http://ishare.iask.sina.com.cn/cgi-bin/fileid.cgi?fileid=2163384
老大,能不能来份中文的呀,看英文的实在很累哦...
当代狂人
2008-12-9 19:00
还有个疑问 如果varnish装在另外个机器上,域名我绑哪上面呀 apache的还是varnish服务器上呀?
当代狂人
2008-12-9 19:02
我看了你这文章,因为初次接触这方面的问题,我直接选择了varnish,squid的都没去考虑了。
分页: 1/1 第一页 1 最后页
发表评论
表情
emotemotemotemotemot
emotemotemotemotemot
emotemotemotemotemot
emotemotemotemotemot
emotemotemotemotemot
打开HTML
打开UBB
打开表情
隐藏
记住我
昵称   密码   游客无需密码
网址   电邮   [注册]