当前位置: 首页 > news >正文

乐清微网站建设在百度上做广告推广要多少钱

乐清微网站建设,在百度上做广告推广要多少钱,怎么建设一个网站,县公安网站建设方案HAProxy 高级功能 介绍 HAProxy 高级配置及实用案例 压缩功能 对响应给客户端的报文进行压缩,以节省网络带宽,但是会占用部分CPU性能 建议在后端服务器开启压缩功能,而非在HAProxy上开启压缩 注意:默认Ubuntu的包安装nginx开…

HAProxy 高级功能

介绍 HAProxy 高级配置及实用案例

压缩功能

对响应给客户端的报文进行压缩,以节省网络带宽,但是会占用部分CPU性能

建议在后端服务器开启压缩功能,而非在HAProxy上开启压缩

注意:默认Ubuntu的包安装nginx开启压缩功能

配置选项

compression algo  <algorithm> ...           #启用http协议中的压缩机制,常用算法有gzip,deflate#压缩算法<algorithm>支持下面类型:identity                                  #debug调试使用的压缩方式gzip                                      #常用的压缩方式,与各浏览器兼容较好deflate                                   #有些浏览器不支持raw-deflate                               #新式的压缩方式
compression type <mime type> ...            #要压缩的文件类型MIME#示例:
compression algo gzip deflate
compression type compression type text/plain text/html text/css text/xml text/javascript application/javascript

配置示例

listen  web_hostbind 10.0.0.7:80mode httpbalance  roundrobinlog globaloption httplogcompression algo gzip deflate   #启用压缩和指定算法compression type compression type text/plain text/html text/css text/xml text/javascript application/javascript    #指定压缩文件类型         server web1 10.0.0.17:80  cookie web1 check inter 3000 fall 3 rise 5server web2 10.0.0.27:80  cookie web2 check inter 3000 fall 3 rise 5#后端服务器准备一个文本文件
[root@web01 html]#ll -h
total 1.2M
-rw-r--r-- 1 nginx nginx 1.2M Nov 12 18:08 1.txt

验证压缩功能

--compressed:这个选项告诉 curl 请求服务器发送压缩的响应(如果服务器支持的话)。通常,服务器会使用 gzip 或 deflate 算法压缩数据以减少传输时间。[root@master-db ~]#curl -b /root/cookie.txt 172.16.1.211/1.txt -Iv --compressed 
* About to connect() to 172.16.1.211 port 80 (#0)
*   Trying 172.16.1.211...
* Connected to 172.16.1.211 (172.16.1.211) port 80 (#0)
> HEAD /1.txt HTTP/1.1
> User-Agent: curl/7.29.0
> Host: 172.16.1.211
> Accept: */*
> Accept-Encoding: deflate, gzip
> Cookie: WEBSRV=web01

没开启压缩功能前

 

开启压缩功能后

后端服务器健康性监测

三种状态监测方式

基于四层的传输端口做状态监测,此为默认方式
基于指定 URI 做状态监测,需要访问整个页面资源,占用更多带宽
基于指定 URI 的 request 请求头部内容做状态监测,占用较少带宽,建议使用此方式 

基于应用层http协议进行健康性检测

基于应用层http协议,采有不同的监测方式,对后端real server进行状态监测

注意: 此方式会导致在后端服务器生成很多的HAProxy发起的访问日志

option httpchk    #支持Listen和backendf块,启用七层健康性检测,对tcp 和 http 模式都支持,默认为:OPTIONS / HTTP/1.0,nginx默认不支持OTIONS
option httpchk <uri>
option httpchk <method> <uri>
option httpchk <method> <uri> <version>
#期望以上检查得到的响应码
http-check expect [!] <match> <pattern>
#示例:
http-check expect status 200
http-check expect ! rstatus ^5 #支持正则表达式
#关于HTTP/1.1的说明
<version> is the optional HTTP version string. It defaults to "HTTP/1.0" but 
some servers might behave incorrectly in HTTP 1.0, so turning it to HTTP/1.1 may 
sometimes help. Note that the Host field is         mandatory in HTTP/1.1, and 
as a trick, it is possible to pass it after "\r\n" following the version string.

配置示例

listen  web_hostbind 10.0.0.7:80mode httpbalance  roundrobin#option httpchk GET /monitor/check.html               #默认HTTP/1.0#option httpchk GET /monitor/check.html HTTP/1.0#option httpchk GET /monitor/check.html HTTP/1.1      #注意:HTTP/1.1强制要求必须有Host字段option httpchk HEAD  /monitor/check.html HTTP/1.1\r\nHost:\ www.wang.org #使用HEAD减少网络流量,新版不支持\r\nHost:\ www.wang.orghttp-check send hdr Host www   #注意:新版要求:HTTP/1.1强制要求必须有Host字段cookie  SERVER-COOKIE  insert  indirect nocacheserver web1 10.0.0.17:80  cookie web1 check inter 3000 fall 3 rise 5server web2 10.0.0.27:80  cookie web2 check inter 3000 fall 3 rise 5#在所有后端服务建立检测页面
[root@backend ~]#mkdir /var/www/html/monitor/[root@backend ~]#echo  monitor > /var/www/html/monitor/check.html#关闭一台Backend服务器
[root@backend1 ~]#systemctl stop httpd

验证http监测

查看到状态页,可以看到启用了七层检测功能:LastChk字段:L7  

listen www.web01.combalance roundrobinbind 0.0.0.0:80log globaloption httplogoption httpchk HEAD  / HTTP/1.1\r\nHost:\ www.web01.comcookie WEBSRV insert nocache indirectserver 10.0.0.52 10.0.0.52:80  check  inter 3000 fall 3 rise 5 cookie web01server 10.0.0.53 10.0.0.53:80  check  inter 3000 fall 3 rise 5 cookie web02

 

http://www.qdjiajiao.com/news/10901.html

相关文章:

  • 网站建设分站要备案申请百度账号注册
  • 微信怎么做网站企业网络营销策略分析案例
  • 网站规划与建设论文常用的网络营销工具有哪些
  • 合肥做双语外贸网站网站优化排名方法
  • 新加坡购物网站排名seo软件工具
  • 哈尔滨安康养老院收费标准福州seo优化
  • 高级工程师谷歌seo是什么
  • 建设020网站需要多少钱企业关键词排名优化哪家好
  • 私服网站如何做seo如何制作简易网站
  • wordpress 分享网站手机百度旧版本下载
  • Wordpress网站删除多余主题自己做网站
  • 如何在网站做推广一站式媒体发稿平台
  • 企业网站的维护怎么做网站推广
  • 自己做网站需要什么条件网站如何在百度刷排名
  • 建设的网站太卡网页怎么制作
  • 深圳外贸建站搭建哪家好苏州做网站的专业公司
  • 重庆做网站公司电话软文代写文案
  • 做网站用到什么开发语言最新的域名网站
  • 泰州做网站的室内设计师培训班学费多少
  • 常德网站开发关键词竞价排名
  • wordpress网站分享微信群谷歌关键词查询工具
  • 推销商务网站的途径有哪些seo西安
  • 广告设计专业就业前景怎么样网页seo是什么意思
  • 网站建设提供ftp手游推广赚佣金的平台
  • 长沙企业网站建设分公司搜索引擎关键词排名
  • 网站可信图标市场调研报告包括哪些内容
  • 宁波网站建设工作室美国搜索引擎排名
  • 娄底北京网站建设上海外贸网站seo
  • 做行业网站淘宝推广怎么做
  • 做文学网站算不算开公司最近一两天的新闻有哪些