-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
写入速度不稳定 #183
Comments
这个下降是在预期范围内的, 因为数据打了以后, 底层的引擎也需要做数据的compact 等等操作 |
感谢回复,请问如果磁盘使用量在80%以下,能不能保障这个平均写入速度维持在180w/分钟? |
@hea 写入速度依赖于磁盘的 IOPS、rocksdb 的 compact 频率。跟磁盘用量关系不大。 |
@tigerzhang 感谢回复,有什么方法可以避免这种问题吗,比如说,单台机器的数据量应该在50g左右,不宜过高,或者把compact 的任务调整到凌晨访问量小的时候 |
@tigerzhang 说得对. |
@hea 可以这样, 或者你可以加大点内存. 也一定可以增加性能 |
@baotiao 感谢回复,我把任务调整到凌晨,单机数据还80g左右,内存加到32G再试试 |
嗯 有问题随时联系我们 哈哈 |
你这个数据80G 的话 其实存在redis 里面的话会有320G 左右 |
请问 这个是说reids碎片率太高,还是说pika的80g是压缩后的,把320G的数据压缩到了80G |
说下目前的测试情况 硬件环境腾讯云 8核cpu,32G内存,100G SSD本地硬盘, 现象描述 最初写入速度 200w/分钟,之后每分钟的量都在变,有下降的趋势,下面是找了几条(不定时更新数据)
配置文件同上文比较只修改了
|
这个是我们实际测试的一个业务的线上数据, redis和 pika 的压缩比能够达到 1:4 |
@hea 能否用 iostat -xm 1 或者 dstat 看一下目前的磁盘IO, 以及你的单个value 的大小是多大 |
数据说明,这个value的大小应该没问题安装工具包
执行命令
|
跑了不到12个小时,硬盘不足10g就停了,这个下降看着是很明显的
iostat
|
感谢360 宋同学的分析
|
50个 客户端 ssdb 压测
|
ssdb 和 pika的对比,如果方式有问题,请多指教ssdb 硬件环境 腾讯云主机 8核32G 100G SSD本地盘 在最后10分钟的时候,ssdb平均能到80w/分钟,pika平均70w/分钟 ssdb结果 取ssdb info里的binlogs.max_seq,只有set操作dbsize= 2589389 上1分钟内写入量 1544697 | Wed Sep 6 16:14:01 CST 2017 dbsize= 923733909 上1分钟内写入量 845771 | Thu Sep 7 10:17:01 CST 2017 pika结果 开启了cosid(我们的业务最终需要放到codis里),取dbsize,pipeline 只有set操作,set的值和ssdb set的值一样dbsize=3343121 上1分钟内写入量 3049759 | Wed Sep 6 18:42:01 CST 2017 dbsize=1057203847 上1分钟内写入量 719243 | Thu Sep 7 10:18:01 CST 2017 |
pika set 性能测试硬件环境pika100 硬件环境 腾讯云主机 8核32G 100G SSD本地盘 测试方法50个redis客户端连接,set的key为uuid产生,value大小1k 说明pika slotmigrate 为 no(关闭codis迁移功能),结合上面的测试,slotmigrate 的开关对性能影响很大,但是本次测试的时间不足12小时,上面的测试是16个小时,继续跑下去,并不确定性能下降到什么程度,后续还在测试。 硬盘越大性能越好,同样是腾讯云的本地ssd盘,200G的写入性能也比100G的要高,单从set操作上看,每分钟差60w左右,不过都伴随这写的越多,写的也越慢 取数方法为每分钟取一次info中的total_commands_processed
|
@hea 那就是不写slot 性能其实比 ssdb 好得多.. 120w/分钟 |
pika set 性能测试环境pika2.2.5 测试方法50个redis客户端连接,set的key为uuid产生,value大小1k 说明pika slotmigrate 为 no(关闭codis迁移功能) 问题测试21小时左右,偶尔出现写入速度成倍下降,不确定是什么原因。 感谢360陈同学的回答这个属于正常 底下引擎有 compact 的时候 磁盘io 占满了 留疑:由于从zabbix里没有看到凸起的io,后续会再进行测试,验证这个结论
|
@hea |
|
环境腾讯云 8核32G 200SSD本地盘 说明pika slotmigrate 为 no(关闭codis迁移功能) 50个客户端写入pika func test(client *redis.Client){
for true{
pipe:=client.Pipeline();
u1 := uuid.NewV4().String()
key0 := u1+":user:0"
pipe.Incr(key0);
pipe.Incr(u1+":user:1");
pipe.Incr(u1+":user:2");
pipe.Incr(u1+":user:3");
pipe.Incr(u1+":user:4");
//检查是否处理过
pipe.Exists(u1)
pipe.Set(u1+":orderId","1",time.Hour*24);
pipe.LPush(u1+":user:4",
"{'openId':'5C2Y0__vYLYG0ahd6BdpVU','yyyappid':'97107fa23','action':'minus'," +
"'spend':1000," +
"'note':'note'," +
"'logTime':1503383236932,'userVc':542939,'clientName':'search','clientBusinessName':'game'}");
_ ,err:= pipe.Exec();
if(nil!=err){
fmt.Println(err)
}
}
} 写入统计
|
@hea 赞 |
环境腾讯云 8核32G 200SSD本地盘 说明pika slotmigrate 为 no(关闭codis迁移功能) 感谢 KernelMaker的分析与建议list的引擎 level 0文件很多,stall会让写变慢 我对比了一下前后日志,应该就是我昨天说的那个原因,写入量比较大,在Level 1较大时对应的score大于Level 0的score,导致Level 0的compact迟迟做不了,然后上层继续写入造成Level 0积压从而stall,提高compact线程数之后,Level 1 -> Level 2会加速,缓解了Level 0的积压,不会发生stall,所以你上层也就不会抖动了 配置文件调整
目前测试的结果比上次好很多
|
@hea @KernelMaker 这个结果非常好呢.. |
@hea |
感谢 baotiao 和 KernelMaker 对测试的支持与帮助 总结
测试结束将近20小时的持续写入(api有读取操作)
|
@hea 赞. |
…ess (#1805) * define rsync related header file and proto * feat:add throttle (#167) * add_throttle * feat: implement rsync network tansform (#169) implement rsync network transfer Co-authored-by: wangshaoyi <[email protected]> * fix action (#171) * fix action * fix * feat: add load local meta file (#175) * add load meta file * [feat] add rsync client/server code (#177) * implement rsync network transfer * add rsyncclient to syncslaveslot (#182) add rsyncclient to syncslaveslot * feat: add read meta file and data (#179) * add read meta file and data * fix compile error (#183) * fix bug * add rsyncclient to syncslaveslot * fix compile error * fix compile error --------- Co-authored-by: wangshaoyi <[email protected]> * fix compile error (#184) * fix bug * optimize: add_throttle (#189) optimize throttle * rsyncclient periodically flush meta table (#192) rsyncclient periodically flush meta table * change rsync response (#190) * change rsync response * add debug log for test * fix rsync client/server bugs * fix bugs * add debug log for test * fix bugs * fix bugs * fix bugs * rix rsync bugs (#194) * fix pika rsync bug * fix bugs * fix bugs * fix bugs 1 * fix bugs * fix rsync bugs (#195) * add debug log for test * fix rsync client/server bugs * fix bugs * add debug log for test * fix bugs * fix bugs * fix bugs * fix bugs * fix bugs * fix bugs 1 * fix bugs --------- Co-authored-by: wangshaoyi <[email protected]> * remove unused code * remove unused code * remove unused code * remove unused code * add copyright * fix by review comments (#213) Co-authored-by: wangshaoyi <[email protected]> * fix by review comments (#214) * fix by review comments Co-authored-by: wangshaoyi <[email protected]> * fix by review comments (#216) * fix by review comments --------- Co-authored-by: wangshaoyi <[email protected]> * Optimize rsync wangsy (#217) * fix by review comments Co-authored-by: wangshaoyi <[email protected]> * fix by review comments (#218) * fix by review comments --------- Co-authored-by: wangshaoyi <[email protected]> --------- Co-authored-by: wangshaoyi <[email protected]> Co-authored-by: Yuecai Liu <[email protected]> Co-authored-by: chejinge <[email protected]> Co-authored-by: luky116 <[email protected]>
…ess (OpenAtomFoundation#1805) * define rsync related header file and proto * feat:add throttle (OpenAtomFoundation#167) * add_throttle * feat: implement rsync network tansform (OpenAtomFoundation#169) implement rsync network transfer Co-authored-by: wangshaoyi <[email protected]> * fix action (OpenAtomFoundation#171) * fix action * fix * feat: add load local meta file (OpenAtomFoundation#175) * add load meta file * [feat] add rsync client/server code (OpenAtomFoundation#177) * implement rsync network transfer * add rsyncclient to syncslaveslot (OpenAtomFoundation#182) add rsyncclient to syncslaveslot * feat: add read meta file and data (OpenAtomFoundation#179) * add read meta file and data * fix compile error (OpenAtomFoundation#183) * fix bug * add rsyncclient to syncslaveslot * fix compile error * fix compile error --------- Co-authored-by: wangshaoyi <[email protected]> * fix compile error (OpenAtomFoundation#184) * fix bug * optimize: add_throttle (OpenAtomFoundation#189) optimize throttle * rsyncclient periodically flush meta table (OpenAtomFoundation#192) rsyncclient periodically flush meta table * change rsync response (OpenAtomFoundation#190) * change rsync response * add debug log for test * fix rsync client/server bugs * fix bugs * add debug log for test * fix bugs * fix bugs * fix bugs * rix rsync bugs (OpenAtomFoundation#194) * fix pika rsync bug * fix bugs * fix bugs * fix bugs 1 * fix bugs * fix rsync bugs (OpenAtomFoundation#195) * add debug log for test * fix rsync client/server bugs * fix bugs * add debug log for test * fix bugs * fix bugs * fix bugs * fix bugs * fix bugs * fix bugs 1 * fix bugs --------- Co-authored-by: wangshaoyi <[email protected]> * remove unused code * remove unused code * remove unused code * remove unused code * add copyright * fix by review comments (OpenAtomFoundation#213) Co-authored-by: wangshaoyi <[email protected]> * fix by review comments (OpenAtomFoundation#214) * fix by review comments Co-authored-by: wangshaoyi <[email protected]> * fix by review comments (OpenAtomFoundation#216) * fix by review comments --------- Co-authored-by: wangshaoyi <[email protected]> * Optimize rsync wangsy (OpenAtomFoundation#217) * fix by review comments Co-authored-by: wangshaoyi <[email protected]> * fix by review comments (OpenAtomFoundation#218) * fix by review comments --------- Co-authored-by: wangshaoyi <[email protected]> --------- Co-authored-by: wangshaoyi <[email protected]> Co-authored-by: Yuecai Liu <[email protected]> Co-authored-by: chejinge <[email protected]> Co-authored-by: luky116 <[email protected]>
…ess (OpenAtomFoundation#1805) * define rsync related header file and proto * feat:add throttle (OpenAtomFoundation#167) * add_throttle * feat: implement rsync network tansform (OpenAtomFoundation#169) implement rsync network transfer Co-authored-by: wangshaoyi <[email protected]> * fix action (OpenAtomFoundation#171) * fix action * fix * feat: add load local meta file (OpenAtomFoundation#175) * add load meta file * [feat] add rsync client/server code (OpenAtomFoundation#177) * implement rsync network transfer * add rsyncclient to syncslaveslot (OpenAtomFoundation#182) add rsyncclient to syncslaveslot * feat: add read meta file and data (OpenAtomFoundation#179) * add read meta file and data * fix compile error (OpenAtomFoundation#183) * fix bug * add rsyncclient to syncslaveslot * fix compile error * fix compile error --------- Co-authored-by: wangshaoyi <[email protected]> * fix compile error (OpenAtomFoundation#184) * fix bug * optimize: add_throttle (OpenAtomFoundation#189) optimize throttle * rsyncclient periodically flush meta table (OpenAtomFoundation#192) rsyncclient periodically flush meta table * change rsync response (OpenAtomFoundation#190) * change rsync response * add debug log for test * fix rsync client/server bugs * fix bugs * add debug log for test * fix bugs * fix bugs * fix bugs * rix rsync bugs (OpenAtomFoundation#194) * fix pika rsync bug * fix bugs * fix bugs * fix bugs 1 * fix bugs * fix rsync bugs (OpenAtomFoundation#195) * add debug log for test * fix rsync client/server bugs * fix bugs * add debug log for test * fix bugs * fix bugs * fix bugs * fix bugs * fix bugs * fix bugs 1 * fix bugs --------- Co-authored-by: wangshaoyi <[email protected]> * remove unused code * remove unused code * remove unused code * remove unused code * add copyright * fix by review comments (OpenAtomFoundation#213) Co-authored-by: wangshaoyi <[email protected]> * fix by review comments (OpenAtomFoundation#214) * fix by review comments Co-authored-by: wangshaoyi <[email protected]> * fix by review comments (OpenAtomFoundation#216) * fix by review comments --------- Co-authored-by: wangshaoyi <[email protected]> * Optimize rsync wangsy (OpenAtomFoundation#217) * fix by review comments Co-authored-by: wangshaoyi <[email protected]> * fix by review comments (OpenAtomFoundation#218) * fix by review comments --------- Co-authored-by: wangshaoyi <[email protected]> --------- Co-authored-by: wangshaoyi <[email protected]> Co-authored-by: Yuecai Liu <[email protected]> Co-authored-by: chejinge <[email protected]> Co-authored-by: luky116 <[email protected]>
硬件环境
腾讯云 8核cpu,16G内存,100G SSD本地硬盘,
现象描述
最初写入速度 200w/分钟,几分钟后维持在平均180w/分钟,但写入数据量达到80G后,写入速度下降到50w/分钟
问题
请问这个是合理的下降还是有什么配置可以优化?
感谢360宋同学的回复
单独压测pika slotmigrate 要为 no
因为现在打开codis之后,其实你的所有kv都是存在set数据结构下,这样每一次操作其实在引擎下面会转化成很多自操作,相比关闭之后会慢不少
写入方式为 golang 创建 50个redis客户端,然后50个协程调用test函数
下面是pika的配置信息
The text was updated successfully, but these errors were encountered: