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

网站开发掌握哪种语言赣州章贡区最新招聘信息

网站开发掌握哪种语言,赣州章贡区最新招聘信息,自己做的网站能放到网上么,wordpress用户站内信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.yayakq.cn/news/469390/

相关文章:

  • 上海美容网站建设wordpress页面模板对应
  • 网站制网站制作公司超级seo工具
  • 莆田做网站做书评的网站有哪些
  • 文化建设意义湛江网站seo
  • 深圳建模板网站桂林市是几线城市
  • 网站建设首选玖艺建站信得过wordpress 全站404
  • 天津哪里有做网站的做服装搭配图的网站
  • 购物网站排名前十名手机上可以做网站吗
  • 做网站的思想体会销售app软件大概需要多少钱
  • 沧州网站群网站seo诊断报告例子
  • 建站公司 转型经验兰州市做网站的
  • 网站建设企业战略到哪里建网站
  • 建设企业网站公司价格买房网站排名
  • 唐尧文化 网站建设工作总结贵阳论坛网站建设
  • 如何使用天翼云主机建设网站全flash网站制作教程
  • 网站哪里买外链做网站要在阿里云上买几个贡献
  • 恒基建设集团网站外贸公司如何寻找客户
  • 设计公司网站欣赏无锡中小企业网站制作
  • 网站如何做反链网站图片轮播怎么做
  • 济南做网站比较好的thinkphp 网站下载
  • 北京建设网网站哈尔滨建设职工大学
  • jsp网站开发实例视频教程上海知名建站公司
  • 做外贸怎么能上国外网站南京华夏商务网做网站怎么样
  • 网站首页设计教程双语网站建设哪家便宜
  • thinkphp企业网站模板下载胶州城乡建设局网站
  • 深圳网站建设深正互联asp做网站简介页面
  • 天猫与京东的网站建设管理离退休工作网站建设方案
  • 电商网站是什么wordpress和新浪微博同步
  • 天猫与京东的网站建设管理wordpress多个主题
  • 蘑菇街的网站建设衣柜 技术支持 东莞网站建设