valkey的部署学习

valkey的部署学习


背景

因为Redis labs说自己被大厂薅羊毛薅的太猛了.
所以修改了 Redis 的开源协议.
并且收回了很多外部commiter的提交权限.

导致开源社区很混乱. 
Linux基金会基于这种修改行为.
自己fork了redis 7.2.4的分支创建了
valkey 7.2.5 的版本

又是一出 mariadb和mysql应分支的故事.
所以想总结和简单测试一下. valkey的使用. 

下载与编译

https://github.com/valkey-io/valkey

直接release 下载就可以了.

安装方式也很简单.

编译

tar -zxvf valkey-7.2.5.tar.gz
cd valkey-7.2.5
make 就可以安装了. 

可以复制部分文件过去.
命令为:
mkdir -p /opt/redis/
然后再当前目录下执行.

for i in `find -iname valkey-*  |egrep -v "c$|d$|o$|tcl$"`; do scp $i  /opt/redis/ ; done
scp valkey.conf /opt/redis/

安装与简单验证

./valkey-server  valkey.conf
2969729:C 18 Apr 2024 11:14:10.969 # WARNING Memory overcommit must be enabled! Without it, 
a background save or replication may fail under low memory condition. 
Being disabled, it can also cause failures without low memory condition, s
ee https://github.com/jemalloc/jemalloc/issues/1328.
 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.
2969729:C 18 Apr 2024 11:14:10.970 * oO0OoO0OoO0Oo Valkey is starting oO0OoO0OoO0Oo
2969729:C 18 Apr 2024 11:14:10.970 * Valkey version=7.2.5, bits=64, commit=00000000, modified=0, pid=2969729, just started
2969729:C 18 Apr 2024 11:14:10.970 * Configuration loaded
2969729:M 18 Apr 2024 11:14:10.970 * monotonic clock: POSIX clock_gettime
                .+^+.
            .+#########+.
        .+########+########+.           Valkey 7.2.5 (00000000/0) 64 bit
    .+########+'     '+########+.
 .########+'     .+.     '+########.    Running in standalone mode
 |####+'     .+#######+.     '+####|    Port: 6379
 |###|   .+###############+.   |###|    PID: 2969729
 |###|   |#####*'' ''*#####|   |###|
 |###|   |####'  .-.  '####|   |###|
 |###|   |###(  (@@@)  )###|   |###|          https://valkey.io
 |###|   |####.  '-'  .####|   |###|
 |###|   |#####*.   .*#####|   |###|
 |###|   '+#####|   |#####+'   |###|
 |####+.     +##|   |#+'     .+####|
 '#######+   |##|        .+########'
    '+###|   |##|    .+########+'
        '|   |####+########+'
             +#########+'
                '+v+'

2969729:M 18 Apr 2024 11:14:10.970 # Warning: Could not create server TCP listening socket 127.0.0.1:6379: bind: Address already in use
2969729:M 18 Apr 2024 11:14:10.970 # Failed listening on port 6379 (tcp), aborting.

说明

跟redis完全一样.. 端口和提示信息也一样..
关了redis之后再使用. 

性能比较

服务器信息:
Neoverse-N1
2c/8g的虚拟机. 阿里云

Redis版本 7.2.3 
valkey版本 7.2.5

编译时间:
redis: 2m0.873s
valkey:2m0.984s

简单性能对比
全部使用默认值,不做调优进行验证.
benchmark

./redis-benchmark -h 127.0.0.1 -p 6379 -n 100000 -c 20 -q

简单简单指令 Redis性能比较好
复杂一点的指令 valkey的比较好一些. 

总体来说 valkey 比微软的哪个靠谱多了..那个我们的应用启动都启动不起来

benchmark结果

类型 PING SET GET INCR HSET MSET
Redis7.2.3 164203 162074 164203 162866 160771 143884
valkey7.2.5 162601 161030 162337 164203 162074 150375
posted @ 2024-04-22 06:47  济南小老虎  阅读(10)  评论(0编辑  收藏  举报