LVS、nginx

Stella981
• 阅读 476

lvs 工作在第四层 所以受到的主要限制 是CPU、网卡瓶颈限制 服务器一般都是千兆  对于操作系统来说是工作在内核空间

nginx 工作在第七层 受到的限制 CPU、网卡、内存都会有,而且受操作系统影响,每处理一个请求都要消耗一定的内存, 单个nginx进程处理能力有限,一般用CPU个数进程,

lvs的负载能力要强于nginx,但功能上要弱于nginx,所以搭配使用效果更好.

haproxy的作者 解释 为什么LVS性能更好:
Exactly. The difference is between LBs that process a stream and which
are proxy-based, and the ones which process packets and are basically
routers. In order to parse and modify a stream, you need some memory,
while you don't need this to route packets (beyond the routing queue).
L4 load balancers often store a session table which is a few hundreds
of bytes per session, as opposed to a few tens of kB of buffers for
proxies. However, L4 LBs have to deal with TIME_WAIT, which proxies
don't since it's done in the system, so in practice, the ratio is not
really tens-of-thousands to millions but rather tens-of-thousands to
hundreds-of-thousands when the connection rate are high.

> and why in HAProxy
> you can have "only" thousends of connections while LVS like LBs can
> annouce millions...
> So in haproxy, whatever the mode, tcp or http, you'll always have
> thousends of connexions.

In fact it depends a lot on the configured memory and on the kernel
tuning. With todays 64-bit systems and cheap RAM, there's plenty of
margin. We had one user who reported 1 million established connections
in a bench, and several ones reported more than 300k in production. In
Linux, by default, processes are limited to 1 million FDs so you need
to patch the kernel or to run in multi-process mode for this. I assume
it's not that crazy to run several processes when you have to deal with
1 million concurrent connections :-)
 
 
if you don't need any form of session persistence or content switching,
LVS might be more suited for this usage.

http://www.intgoo.com/archives/56.html

http://mp.weixin.qq.com/s?__biz=MzA3OTgyMDcwNg==&mid=2650625058&idx=1&sn=a9404e234c6a52b2db2fb099c85e49af&scene=0

不过lvs + KEEPALIVE + nginx配置起来还是蛮折腾的,有钱直接上F5吧。。。

点赞
收藏
评论区
推荐文章
blmius blmius
2年前
MySQL:[Err] 1292 - Incorrect datetime value: ‘0000-00-00 00:00:00‘ for column ‘CREATE_TIME‘ at row 1
文章目录问题用navicat导入数据时,报错:原因这是因为当前的MySQL不支持datetime为0的情况。解决修改sql\mode:sql\mode:SQLMode定义了MySQL应支持的SQL语法、数据校验等,这样可以更容易地在不同的环境中使用MySQL。全局s
Jacquelyn38 Jacquelyn38
2年前
2020年前端实用代码段,为你的工作保驾护航
有空的时候,自己总结了几个代码段,在开发中也经常使用,谢谢。1、使用解构获取json数据let jsonData  id: 1,status: "OK",data: 'a', 'b';let  id, status, data: number   jsonData;console.log(id, status, number )
皕杰报表之UUID
​在我们用皕杰报表工具设计填报报表时,如何在新增行里自动增加id呢?能新增整数排序id吗?目前可以在新增行里自动增加id,但只能用uuid函数增加UUID编码,不能新增整数排序id。uuid函数说明:获取一个UUID,可以在填报表中用来创建数据ID语法:uuid()或uuid(sep)参数说明:sep布尔值,生成的uuid中是否包含分隔符'',缺省为
Stella981 Stella981
2年前
Keepalived+Nginx实现高可用和双主节点负载均衡
简介Nginx可以实现高并发反向代理,lvs集群可以实现负载均衡,但是他们都有一个共同的弊端,就是Nginx,lvs架构中Director是单点故障,有没有一个好的方案解决这个问题呢?答案是有。通过Keepalived就可以实现,前端Nginx,lvs中Director服务器的高可用和负载均衡,通过shell命令或者脚本可以实现对服务器状态和服务的监控!
Wesley13 Wesley13
2年前
mysql设置时区
mysql设置时区mysql\_query("SETtime\_zone'8:00'")ordie('时区设置失败,请联系管理员!');中国在东8区所以加8方法二:selectcount(user\_id)asdevice,CONVERT\_TZ(FROM\_UNIXTIME(reg\_time),'08:00','0
Stella981 Stella981
2年前
LVS,HAPROXY,NGINX各自的优缺点
Nginx/LVS/HAProxy的基于Linux的开源免费的负载均衡软件。LVS:使用集群技术和Linux操作系统实现一个高性能、高可用的服务器,它具有很好的可伸缩性、可靠性和可管理性,是一款强大实用的开源软件。LVS的优点:1:抗负载能力强、是工作在网络4层之上仅作分发之用,没有流量的产生,这个特点也决定了它在负载均衡软件里的性能最强的,也保
Stella981 Stella981
2年前
Django中Admin中的一些参数配置
设置在列表中显示的字段,id为django模型默认的主键list_display('id','name','sex','profession','email','qq','phone','status','create_time')设置在列表可编辑字段list_editable
Stella981 Stella981
2年前
Nginx
!(https://imagestatic.segmentfault.com/255/117/25511790966008dc5b00fd8)Nginx进程模型分析在介绍Nginx的进程模型之前我们先来给大家解释下一些常见的名词,这能辅助我们更好的了解Nginx的进程模型。作为Web服务器,设计的初衷就是为了能够处理更多的客户端的请
Nginx工作原理
Nginx的进程模型Nginx服务器由一个Master进程和多个Worker进程组成:Master进程:管理Worker进程。对外接口:接收外部的操作(信号);对内转发:根据外部操作的不同,通过信号管理Worker;监听:监控Worker进程的运行状态,Worker进程异常终止后,自动重启Worker进程。Worker进程:所有Worker进程都是平等的,用于处理网络请求。进程数量:在nginx.conf中配置,一般设置为核心数,充分利用CPU资源,同时,避免进程数量过多,避免进程竞争CPU资源,增加上下文切换的损耗。
Python进阶者 Python进阶者
3个月前
Excel中这日期老是出来00:00:00,怎么用Pandas把这个去除
大家好,我是皮皮。一、前言前几天在Python白银交流群【上海新年人】问了一个Pandas数据筛选的问题。问题如下:这日期老是出来00:00:00,怎么把这个去除。二、实现过程后来【论草莓如何成为冻干莓】给了一个思路和代码如下:pd.toexcel之前把这