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. 传统应用、服务器集群、分布式、SOA各种架构的简单解释

    传统架构:无论是SE应用还是WEB应用,传统架构都是表现层---业务层---持久层---数据库   1000并发(tomcat单台500并发,tomcat一般做集群的话,节点数量不能太多,5个左右): ...

  2. CodeForces - 864C-Bus-(模拟加油站问题)

    https://vjudge.net/problem/CodeForces-864C 题意:两地之间有个加油站,往返走k个单程,最少加油多少次. 大佬几十行代码就解决,我却要用一百多行的if语句模拟解 ...

  3. django项目 报错:ImportError: cannot import name choice

    今天项目开发中遇到一个错误,排查了很久才发现原因,现在分享出来,希望对大家有所帮助. 错误描述:在项目中添加了一个random.py的类,导入random中的choice,并在randstr方法中使用 ...

  4. 将对象序列化成XML字符串

    using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.We ...

  5. Oracel递归查询start with ...connect by prior在Mysql中的实现

    Oracle是一个强大的数据库,有很多的函数和语法可以带来很多便利,有些函数和语法在Mysql中有代替的,但是有些没有现成可用的方法,比如Oracle的递归,在Mysql中怎么实现呢? 例子: Ora ...

  6. 实际项目中如何使用git命令

    使用工具:Git Bash 工作空间项目存放路径C:/用户/git/demoProject 操作步骤: 1.切换到git项目路径 cd  git/demoProject 2.git status   ...

  7. 【JAVA】String[]配列の相関

    配列の作成: ①String[] str = new String[5]; ②String[] str = new String[]{"","","& ...

  8. Synchronized的几种用法

    https://blog.csdn.net/luoweifu/article/details/46613015

  9. php判断用户是否关注微信公众号

    方法一: <?php     $access_token = "https://api.weixin.qq.com/cgi-bin/token?grant_type=client_cr ...

  10. Gulp入门及简单使用

    前言 什么是gulp?gulp有什么用?为什么用gulp? gulp是前端开发的一种构建工具. 构建工具可以帮助我们工程化地开发项目,比如搭建本地服务器.编译CSS预处理器.保存文件后自动刷新浏览器而 ...