Kafka之 vm.max_map_count
Maximum number of memory map areas a process may have (aka vm.max_map_count).
进程可以具有的最大内存映射区域数(也称为vm.max_map_count)。
See the Linux kernel documentation.
You should keep an eye at this OS-level property when considering the maximum number of partitions a broker may have.
在考虑broker可能具有的最大分区数时,您应该关注此OS级属性
By default, on a number of Linux systems, the value of vm.max_map_count is somewhere around 65535.
Linux 系统 vm.max_map_count 的默认值是 65535
Each log segment, allocated per partition, requires a pair of index/timeindex files, and each of these files consumes 1 map area.
每个分区分配的每个日志段需要一对index / timeindex文件,每个文件占用1个映射区域。
In other words, each log segment uses 2 map areas.
换句话说,每个日志段使用2个映射区域
Thus, each partition requires minimum 2 map areas, as long as it hosts a single log segment.
因此,每个分区至少需要2个映射区域,只要它承载单个日志段即可。
That is to say, creating 50000 partitions on a broker will result allocation of 100000 map areas
and likely cause broker crash with OutOfMemoryError (Map failed) on a system with default vm.max_map_count.
举个例子,如果你创建 50000 分区在一个 broker,将会创建 100000 个map areas 映射取;
在具有默认vm.max_map_count的系统上可能导致代理崩溃并出现OutOfMemoryError(映射失败)
Keep in mind that the number of log segments per partition varies depending on the segment size,
load intensity, retention policy and, generally, tends to be more than one.
请记住,每个分区的日志段数取决于段大小,负载强度,保留策略,通常往往不止一个
对于这个问题我是这么考虑的,Kafka使用page cache技术,也就是用户态内存映射内核态内存,这样可以让刷盘快速。前提就是这种映射关系也是有数量限制的,所以一般都会把这个数值配成大于10万
posted on 2021-02-01 17:23 MaXianZhe 阅读(2933) 评论(0) 编辑 收藏 举报
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· AI与.NET技术实操系列:基于图像分类模型对图像进行分类
· go语言实现终端里的倒计时
· 如何编写易于单元测试的代码
· 10年+ .NET Coder 心语,封装的思维:从隐藏、稳定开始理解其本质意义
· .NET Core 中如何实现缓存的预热?
· 25岁的心里话
· 闲置电脑爆改个人服务器(超详细) #公网映射 #Vmware虚拟网络编辑器
· 基于 Docker 搭建 FRP 内网穿透开源项目(很简单哒)
· 零经验选手,Compose 一天开发一款小游戏!
· 一起来玩mcp_server_sqlite,让AI帮你做增删改查!!