2、varnish的软件清单

[root@centos69 ~]# rpm -ql varnish  
/etc/logrotate.d/varnish
/etc/rc.d/init.d/varnish
/etc/rc.d/init.d/varnishlog
/etc/rc.d/init.d/varnishncsa
/etc/sysconfig/varnish
/etc/varnish
/etc/varnish/default.vcl
/usr/bin/varnishadm
/usr/bin/varnishhist
/usr/bin/varnishlog
/usr/bin/varnishncsa
/usr/bin/varnishreplay
/usr/bin/varnishsizes
/usr/bin/varnishstat
/usr/bin/varnishtest
/usr/bin/varnishtop
/usr/sbin/varnish_reload_vcl
/usr/sbin/varnishd
/usr/share/doc/varnish-2.1.
/usr/share/doc/varnish-2.1./ChangeLog
/usr/share/doc/varnish-2.1./INSTALL
/usr/share/doc/varnish-2.1./LICENSE
/usr/share/doc/varnish-2.1./README
/usr/share/doc/varnish-2.1./README.redhat
/usr/share/doc/varnish-2.1./examples
/usr/share/doc/varnish-2.1./examples/default.vcl
/usr/share/doc/varnish-2.1./examples/zope-plone.vcl
/usr/share/man/man1/varnishadm..gz
/usr/share/man/man1/varnishd..gz
/usr/share/man/man1/varnishhist..gz
/usr/share/man/man1/varnishlog..gz
/usr/share/man/man1/varnishncsa..gz
/usr/share/man/man1/varnishreplay..gz
/usr/share/man/man1/varnishsizes..gz
/usr/share/man/man1/varnishstat..gz
/usr/share/man/man1/varnishtest..gz
/usr/share/man/man1/varnishtop..gz
/usr/share/man/man7/vcl..gz
/var/lib/varnish
/var/log/varnish
三台机器,两个后端web server
 
1、准备两台web server
 
 

2、创建10个测试页
 
for i in {..}; do echo "Page $i on Web1" > /var/www/html/test$i.html; done

修改

vim  default.vcl

# Default backend definition. Set this to point to your content server.
backend default {
.host = "192.168.142.134"; #指定后端web server地址
.port = "";
} sub vcl_recv {
# Happens before we check if we have this in cache already.
#
# Typically you clean up the request here, removing cookies you don't need,
# rewriting the request, etc.
} sub vcl_backend_response {
# Happens after we have read the response headers from the backend.
#
# Here you clean the response headers, removing silly Set-Cookie headers
# and other mistakes your backend does.
} sub vcl_deliver {
# Happens when we have all the pieces we need, and are about to send the
# response to the client.
#
# You can do accounting or modifying the final object here.
}

[root@CentOS71 varnish]#varnishadm -S /etc/varnish/secret -T 127.0.0.1:

-----------------------------
Varnish Cache CLI 1.0
-----------------------------
Linux,3.10.-.el7.x86_64,x86_64,-smalloc,-smalloc,-hcritbit
varnish-4.0. revision 07eff4c29 Type 'help' for command list.
Type 'quit' to close CLI session. help help [<command>]
ping [<timestamp>]
auth <response>
quit
banner
status
start
stop
vcl.load <configname> <filename>
vcl.inline <configname> <quoted_VCLstring>
vcl.use <configname>
vcl.discard <configname>
vcl.list
param.show [-l] [<param>]
param.set <param> <value>
panic.show
panic.clear
storage.list
vcl.show [-v] <configname>
backend.list [<backend_expression>]
backend.set_health <backend_expression> <state>
ban <field> <operator> <arg> [&& <field> <oper> <arg>]...
ban.list

缓存为王-varnish的更多相关文章

  1. Varnish 缓存加速, Varnish 菜鸟看过来,Varnish实战

    Varnish可以有效降低web服务器的负载,提升访问速度.按照HTTP协议的处理过程,web服务器接受请求并且返回处理结果,理想情况下服务器要在不做额外处理的情况下,立即返回结果,但实际情况并非如此 ...

  2. WEB缓存系统之varnish缓存项修剪

    前文我们聊了下varnish的状态引擎和不同类型的变量对应该使用在那个状态引擎中,以及每个状态引擎的对应处理事务:回顾请参考https://www.cnblogs.com/qiuhom-1874/p/ ...

  3. 如何构建日均千万PV Web站点(二) 之~缓存为王~

    随着网站业务的不断发展,用户的规模越来越大:介于中国无比蹩脚复杂的网路环境:南电信:北联通:中间竟然只用一条链路进行互联通信!有研究表明,网站访问延迟和用户流失率正相关,网站访问速度越慢,用户越容易失 ...

  4. 缓存反向代理-Varnish

    简介 Varnish是一款高性能.开源的缓存反向代理服务器.它从客户端接受请求,并尝试从缓存中响应请求,如果无法从缓存中提供响应,Varnish 向后端服务器发起请求,获取响应,将响应存储在缓存中,然 ...

  5. WEB缓存系统之varnish基础入门(一)

    前文我们聊了下http协议里的缓存控制机制以及varnish架构组件介绍,回顾请参考https://www.cnblogs.com/qiuhom-1874/p/12620538.html:今天我们来聊 ...

  6. WEB缓存系统之varnish状态引擎

    前文我们聊了下varnish的VCL配置以及语法特点,怎样去编译加载varnish的vcl配置,以及命令行管理工具varnishadm怎么去连接varnish管理接口进行管理varnish,回顾请参考 ...

  7. WEB缓存系统之varnish代理以及健康状态检测配置

    前文我们聊了下varnish的缓存项修剪配置,回顾请参考https://www.cnblogs.com/qiuhom-1874/p/12666406.html:今天我来说一下varnish作为代理服务 ...

  8. 项目实战5—企业级缓存系统varnish应用与实战

    企业级缓存系统varnish应用与实战 环境背景:随着公司业务快速发展,公司的电子商务平台已经聚集了很多的忠实粉丝,公司也拿到了投资,这时老板想通过一场类似双十一的活动,进行一场大的促销,届时会有非常 ...

  9. varnish缓存系统基础知识

    缓存系统类型 1.页面缓存/pageCache     缓存静态资源(html js css image)  例如:varnish    squid 2.数据缓存/dataCache      缓存应 ...

随机推荐

  1. Linux NGINX部署

    一.Nginx简介 Nginx是一个web服务器也可以用来做负载均衡及反向代理使用,目前使用最多的就是负载均衡,具体简介我就不介绍了百度一下有很多,下面直接进入安装步骤 二.Nginx安装 1.下载N ...

  2. Visual Studio 注释与取消注释快捷键

    注释:        先CTRL+K,然后CTRL+C 取消注释: 先CTRL+K,然后CTRL+U

  3. C# 乐观锁、悲观锁、共享锁、排它锁、互斥锁

    悲观锁(Pessimistic Lock), 顾名思义,就是很悲观,每次去拿数据的时候都认为别人会修改,所以每次在拿数据的时候都会上锁,这样别人想拿这个数据就会block直到它拿到锁.传统的关系型数据 ...

  4. intellij idea在project下同时打开多个工程(maven工程)

    前提:我的工程都是maven工程   我有两个工程,一个是接口contract,一个是接口的具体实现server.想要同时在一个工作空间下展示,方便调试开发,加载后效果如下   idea有worksp ...

  5. canel的网络策略

    资源: https://docs.projectcalico.org/v3.2/getting-started/kubernetes/installation/flannel 基于pod Egress ...

  6. 在Ubuntu中使用JDB调试代码

    在Ubuntu中使用JDB调试代码 了解JDB JDB是JDK安装的一部分,是基于文本和命令行的调试工具,JDB是可以免费获取且平台独立的,缺点是只有命令行格式. JDB基础命令 在方法中设置断点st ...

  7. 大数据学习笔记4 - Hadoop的优化与发展(Hadoop 2.0)

    前面介绍了Hadoop核心组件HDFS和MapReduce,Hadoop发展之初在架构设计和应用性能方面仍然存在不足,Hadoop的优化与发展一方面体现在两个核心组件的架构设计改进,一方面体现在Had ...

  8. http标码集合

    201 Created告诉客户端,请求成功,资源已经创建.新的资源的网址请看 202 Accepted告诉客户端,请求已经接受,但还没有处理,可以去Location字段查询进展. 200 Ok告诉客户 ...

  9. Maven解决NoPluginFoundForPrefixException错误

    Maven解决NoPluginFoundForPrefixException错误方法 错误出现的原因 你指的是一个不存在的插件,如由于错误的前缀. 您使用的是第三方的Maven插件没有部署到中央Mav ...

  10. 定时执行自动化脚本-(一)导入保存jmeter参数至文件的jar包

    1.先完成jmeter脚本编写,具体怎么写此处不再详述,可以参考其他文档. 2.有时你会发现jmeter脚本执行后,有些响应信息你需要提取到文件中,以便后续使用: 怎么实现呢?个人思路就是,先写个ja ...