Redis主节点内存占用过高
0. 基本情况
Redis采用集群模式,560个主节点,主从比为1:1,单台机器上为16个节点。info memory观察到主节点A单个Redis内存used_memory_rss_human为9.2G(设置的maxmemory_human为6G)超过最大值设置。
1.查看客户端连接情况
[root@ A ~]# redis-cli -p 9001 info clients
# Clients
connected_clients:4705
client_longest_output_list:204928
client_biggest_input_buf:0
blocked_clients:0
通过client_longest_output_list发现有大量的输出排队,进一步观察所有的客户端均存在这个情况。
在A机器上刷客户端输出list:
CLIENT_A:9001# Clients
client_longest_output_list:491335
CLIENT_A:9002# Clients
client_longest_output_list:520840
CLIENT_A:9003# Clients
client_longest_output_list:486498
CLIENT_A:9004# Clients
client_longest_output_list:485387
CLIENT_A:9005# Clients
client_longest_output_list:480000
CLIENT_A:9006# Clients
client_longest_output_list:537211
CLIENT_A:9007# Clients
client_longest_output_list:487594
CLIENT_A:9008# Clients
client_longest_output_list:490037
CLIENT_A:9009# Clients
client_longest_output_list:478734
CLIENT_A:9010# Clients
client_longest_output_list:524717
CLIENT_A:9011# Clients
client_longest_output_list:487200
CLIENT_A:9012# Clients
client_longest_output_list:491687
CLIENT_A:9013# Clients
client_longest_output_list:483900
CLIENT_A:9014# Clients
client_longest_output_list:524557
CLIENT_A:9015# Clients
client_longest_output_list:497967
CLIENT_A:9016# Clients
client_longest_output_list:484250
2.输出内存占用不为0 的内容
[root@ A redis-node]# redis-cli -p 9001 client list |grep -v "omem=0"
id=843 addr=client_B:53475 fd=2248 name= age=582784 idle=0 flags=S db=0 sub=0 psub=0 multi=-1 qbuf=0 qbuf-free=0 obl=0 oll=456078 omem=7446059139 events=rw cmd=replconf
通过cmd可知是主从同步占用大量输出内存
3.检查统计值
有问题Client A的从client_B
[root@localhost 9001]# redis-cli -p 9001
127.0.0.1:9001> info stats
# Stats
total_connections_received:2
total_commands_processed:25
instantaneous_ops_per_sec:0
total_net_input_bytes:1280055129
total_net_output_bytes:36461
instantaneous_input_kbps:192.22
instantaneous_output_kbps:0.00
rejected_connections:0
正常的机器C的从Client D
[root@CLIENT D redis-node]# redis-cli -p 9001
127.0.0.1:9001> info Stats
# Stats
total_connections_received:10
total_commands_processed:23220212769
instantaneous_ops_per_sec:18281
total_net_input_bytes:3405817622262
total_net_output_bytes:59530419
instantaneous_input_kbps:2882.54
instantaneous_output_kbps:0.03
rejected_connections:0
输入速度差了10倍,其他配置均一样,怀疑是网络问题。
4.检查网络时延
机器A的从client_B
[root@A redis-node]# traceroute client_B
traceroute to client_B (client_B), 30 hops max, 60 byte packets
1 *.*.*.254 0.752 ms 0.809 ms 0.900 ms
2 *.*.*.133 2.164 ms 2.170 ms 2.157 ms
3 * * *
4 * * *
5 *.*.*.2 163.542 ms 163.940 ms 164.181 ms
6 client_B (client_B) 160.995 ms 156.202 ms 158.603 ms
Clinet C的从Client D
[root@SHJX-YSP-GKTZCQ-SEV-128-35 ~]# traceroute Client D
traceroute to Client D (Client D), 30 hops max, 60 byte packets
1 *.*.*.254 0.732 ms 0.799 ms 0.897 ms
2 *.*.*.133 3.147 ms 3.182 ms 3.168 ms
3 * * *
4 * * *
5 *.*.*.2 5.537 ms 5.788 ms 5.961 ms
6 Client D (Client D) 1.953 ms 1.960 ms 1.956 ms
测试机器A到机器D性能
[root@ 42 9001]# traceroute Client D
traceroute to Client D (Client D), 30 hops max, 60 byte packets
1 *.*.*.254 (10.180.128.254) 0.738 ms 0.800 ms 0.889 ms
2 *.*.*.133 (10.180.176.133) 2.156 ms 2.190 ms 2.177 ms
3 * * *
4 * * *
5 *.*.*.2 5.768 ms 5.942 ms 6.114 ms
6 Client D (Client D) 1.940 ms 1.964 ms 1.948 ms
说明是机器A到client_B网络有问题
5.解决办法
更换从的机器到client_B到clinet E
启动后机器A上9001 内存使用情况
127.0.0.1:9001> info memory
# Memory
used_memory:2771776520
used_memory_human:2.58G
used_memory_rss:3403390976
used_memory_rss_human:3.17G
used_memory_peak:18154232496
used_memory_peak_human:16.91G
used_memory_peak_perc:15.27%
used_memory_overhead:758586508
used_memory_startup:8105584
used_memory_dataset:2013190012
used_memory_dataset_perc:72.84%
total_system_memory:540783263744
total_system_memory_human:503.64G
used_memory_lua:37888
used_memory_lua_human:37.00K
maxmemory:6442450944
maxmemory_human:6.00G
maxmemory_policy:volatile-ttl
mem_fragmentation_ratio:1.23
mem_allocator:jemalloc-4.0.3
active_defrag_running:0
lazyfree_pending_objects:0
127.0.0.1:9001>
6.解决后观察
Client E内存同步情况
127.0.0.1:9001> info stats
# Stats
total_connections_received:37
total_commands_processed:5318696
instantaneous_ops_per_sec:19310
total_net_input_bytes:1711079396
total_net_output_bytes:4954958
instantaneous_input_kbps:2967.88
instantaneous_output_kbps:70.17
rejected_connections:0
sync_full:0
修改后机器A上的9001 输出
[root@A redis-node]# redis-cli -p 9001 info clients
# Clients
connected_clients:4695
client_longest_output_list:0
client_biggest_input_buf:0
blocked_clients:
7.总结:
在redis设置同样而内存使用不同时,应先查看info命令对比正常机器的输出不同,优先关注Stats的输出情况以及本地的redis.log日志
Redis主节点内存占用过高的更多相关文章
- CLR Profile解决内存占用过高
CLR Profile解决内存占用过高的问题 炮哥:"嘿,哥们,忙啥呢,电脑卡成这逼样." 勇哥:"在用CLR Profile工具分析下FlexiPrint的内存占用情况 ...
- [2017-08-09]一则使用WinDbg工具调试iis进程调查内存占用过高的案例
最近遇到一个奇葩内存问题,跟了三四天,把Windbg玩熟了,所以打算分享下. 症状简介 我们团队的DEV开发环境只有一台4核16G的win2012r2. 这台服务器上装了SqlServer.TFS(项 ...
- 通过修改my.ini配置文件来解决MySQL 5.6 内存占用过高的问题
打开后台进程发现mysql占用的内存达到400+M. 修改一下my.ini这个配置文件的配置选项是可以限制MySQL5.6内存占用过高这一问题的,具体修改选项如下: performance_schem ...
- 【转】一则使用WinDbg工具调试iis进程调查内存占用过高的案例
最近遇到一个奇葩内存问题,跟了三四天,把Windbg玩熟了,所以打算分享下. 症状简介 我们团队的DEV开发环境只有一台4核16G的win2012r2.这台服务器上装了SqlServer.TFS(项目 ...
- Spring cloud开发内存占用过高解决方法
https://blog.csdn.net/wanhuiguizong/article/details/79289986 版权声明:本文为博主原创文章,转载请声明文章来源和原文链接. https:// ...
- (转)aix非计算内存 占用过高 案例一则
原文:http://www.talkwithtrend.com/Article/28621 两台小型机组成的RAC环境,在用topas查看资源使用情况时,发现一台机器的非计算内存占用过高: MEMOR ...
- Window下MySql 5.6 安装后内存占用很高的问题
Window下MySql 5.6 安装后内存占用很高的问题 刚刚准备玩一把mysql,初学者 环境是window 7和window sever 2008, mysql是最新的5.6, 发现的问题是安装 ...
- [转帖]Linux中buff/cache内存占用过高解决办法
Linux中buff/cache内存占用过高解决办法 https://www.cnblogs.com/rocky-AGE-24/p/7629500.html /proc/sys/vm/drop_cac ...
- 一个神奇的bug:OOM?优雅终止线程?系统内存占用较高?
摘要:该项目是DAYU平台的数据开发(DLF),数据开发中一个重要的功能就是ETL(数据清洗).ETL由源端到目的端,中间的业务逻辑一般由用户自己编写的SQL模板实现,velocity是其中涉及的一种 ...
随机推荐
- C#压缩文件夹至zip,不包含所选文件夹【转+修改】
转自园友:jimcsharp的博文C#实现Zip压缩解压实例[转] 在此基础上,对其中的压缩文件夹方法略作修正,并增加是否对父文件夹进行压缩的方法.(因为笔者有只压缩文件夹下的所有文件,却不想将选中的 ...
- jmeter的webservice接口测试(SOAP/XML-RPC Request)
摘自:https://www.cnblogs.com/imyalost/p/5804359.html 项目背景:公司的微信端H5界面新开发了会员注册功能,需要对其进行压力测试 项目目标:需要承受每分钟 ...
- 用sed写配置IP脚本参数
#!/bin/bash#配置ip地址参数脚本NET=/etc/sysconfig/network-scripts/ifcfg-ens33if grep -E "BOOTPROTO=dhcp& ...
- Colletions工具类常用方法
Collections 工具类常用方法: 排序 查找,替换操作 同步控制(不推荐,需要线程安全的集合类型时请考虑使用 JUC 包下的并发集合 排序操作 void reverse(List list)/ ...
- 在MONO Design中使用Flex3D
在项目开发组的努力下,HTML5 3D 的开发包变得越来越优秀,越来越健壮:基于HTML5 3D技术的MONO Design建模平台功能也变得越来越强大和完善,这个方便了很多使用我们HTML5 3D的 ...
- 【解题报告】洛谷 P2571 [SCOI2010]传送带
[解题报告]洛谷 P2571 [SCOI2010]传送带今天无聊,很久没有做过题目了,但是又不想做什么太难的题目,所以就用洛谷随机跳题,跳到了一道题目,感觉好像不是太难. [CSDN链接](https ...
- 爬虫之Requests库
官方文档:http://cn.python-requests.org/zh_CN/latest/ 一.引子 import requests resp = requests.get("http ...
- Python学习笔记之生成器、迭代器和装饰器
这篇文章主要介绍 Python 中几个常用的高级特性,用好这几个特性可以让自己的代码更加 Pythonnic 哦 1.生成器 什么是生成器呢?简单来说,在 Python 中一边循环一边计算的机制称为 ...
- PYGAME学习笔记_01
01_使用PYGAME创建图形窗口 1.1_游戏的初始化和退出 pygame.init() 写入并初始化所有PYGAME模块,使用其他模块之前,必须先调用init方法 pygame.quit() 卸载 ...
- BZOJ 3993 Luogu P3324 [SDOI2015]星际战争 (最大流、二分答案)
字符串终于告一段落了! 题目链接: (bzoj) https://www.lydsy.com/JudgeOnline/problem.php?id=3993 (luogu) https://www.l ...