redis make test时出现Active defrag big keys in tests/unit/memefficiency.tcl

自己测试用的服务器配置

CPU: 2核 内存: 2 GB 实例类型: I/O优化 操作系统: CentOS 7.4 64位

redis 版本使用的最新的5.0.0

make 通过
make teset的时候出现警告信息

!!! WARNING The following tests failed:

*** [err]: Active defrag big keys in tests/unit/memefficiency.tcl Expected condition ‘$max_latency <= 120’ to be true (130 <= 120)

度娘和谷歌都没查到相应信息

定位到报错的文件

源码长这样

			# test the the fragmentation is lower
            after 120 ;# serverCron only updates the info once in 100ms
            set frag [s allocator_frag_ratio]
            set max_latency 0
            foreach event [r latency latest] {
                lassign $event eventname time latency max
                if {$eventname == "active-defrag-cycle"} {
                    set max_latency $max
                }
            }
            if {$::verbose} {
                puts "frag $frag"
                puts "max latency $max_latency"
                puts [r latency latest]
                puts [r latency history active-defrag-cycle]
            }
            assert {$frag < 1.1}
            # due to high fragmentation, 10hz, and active-defrag-cycle-max set to 75,
            # we expect max latency to be not much higher than 75ms
            assert {$max_latency <= 120}

大意是测试碎片程度是否更低,因为高碎片化,需要低于75毫秒的延迟率

很明显,服务器的配置被redis 5.0 很狠的鄙视了一下

本来想改掉active-defrag-cycle-max 和判断条件,但是既然是警告不是报错也就算了,

继续make install

成功,

Hint: It’s a good idea to run ‘make test’
INSTALL install
INSTALL install
INSTALL install
INSTALL install
INSTALL install

虽然依然有恼人的提示 It’s a good idea to run ‘make test’ ,但好在安装成功没出问题

测试

redis-server 终于出现熟悉的欢迎页面了,

[root@iz8vb5y2p7474h7pk9pgg4z ~]# redis-server 31737:C 26 Oct 2018
06:07:40.501 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo 31737:C
26 Oct 2018 06:07:40.501 # Redis version=5.0.0, bits=64,
commit=00000000, modified=0, pid=31737, just started 31737:C 26 Oct
2018 06:07:40.501 # Warning: no config file specified, using the
default config. In order to specify a config file use redis-server
/path/to/redis.conf
.
.-__ ''-._ _.- .. ‘’-._ Redis 5.0.0 (00000000/0) 64 bit .-.-```. ```\/ _.,_ ''-._ ( ' , .-` | `, ) Running in standalone mode |`-._`-...-` __...-.-.|’_.-'| Port: 6379 |-. ._ / _.-' | PID: 31737-._ -._-./ .-’ .-’
|-._-.
-.__.-' _.-'_.-'| |-.
-._ _.-'_.-' | http://redis.io-._ -._-..-’.-’ .-’
|-._-.
-.__.-' _.-'_.-'| |-.
-._ _.-'_.-' |-._ -._-.
.-’_.-’ _.-’
-._-..-’ _.-’
-._ _.-'-.
.-’

31737:M 26 Oct 2018 06:07:40.502 # WARNING: The TCP backlog setting of
511 cannot be enforced because /proc/sys/net/core/somaxconn is set to
the lower value of 128. 31737:M 26 Oct 2018 06:07:40.502 # Server
initialized 31737:M 26 Oct 2018 06:07:40.502 # WARNING
overcommit_memory is set to 0! Background save may fail under low
memory condition. To fix this issue add ‘vm.overcommit_memory = 1’ to
/etc/sysctl.conf and then reboot or run the command ‘sysctl
vm.overcommit_memory=1’ for this to take effect. 31737:M 26 Oct 2018
06:07:40.502 # WARNING you have Transparent Huge Pages (THP) support
enabled in your kernel. This will create latency and memory usage
issues with Redis. To fix this issue run the command ‘echo never >
/sys/kernel/mm/transparent_hugepage/enabled’ as root, and add it to
your /etc/rc.local in order to retain the setting after a reboot.
Redis must be restarted after THP is disabled. 31737:M 26 Oct 2018
06:07:40.502 * Ready to accept connections

下一步就是定义redis 配置文件了,下次启动将以配置文件启动

评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值