-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
rr 模式下,qps 不变,rpc 下游节点增多时,平均耗时和99线耗时明显上升 #1828
Comments
这个是客户端的延迟数据对吧,服务端延迟怎么样呢?先排除是服务端的问题哈。 |
@lorinlee 是客户端延迟数据,服务端延迟基本都在1ms左右,服务端都是万兆网卡,请求基本在200B以内,没有打满。 另外同时启动两个测试,一个连26个下游,一个只连一个下游,还是一样的结果。一个下游的测试耗时比较低,多个下游的测试耗时明显高出很多。 请问可能还有哪些原因呢 |
用的是什么连接方式?qps大约多少?网络的rtt大约多少? |
@cdjingit 使用的是单连接模式,qps 保持在3000,测试程序和下游节点都在同一机房,网络的rtt在0.05ms左右 |
@Missmiaom 有试过使用其他的lb策略吗,延迟是否有变化呢 |
@lorinlee 试过la模式,耗时情况好很多。 但是,在 la 模式下把发给下游的ip和请求数量列出来了 发现每次测试刚开始的时候,请求分布比较均匀,测试到后面(约1分钟后),请求都大量集中在一个节点上,并且每次测试请求集中的节点都不是同一个下游节点,看起来像随机的,请求集中的节点能收到几万个请求,而其他节点只能收到几十个请求 在 rr 模式下,测试请求均匀分布在下游所有节点上 |
@Missmiaom 有试过random吗,方便试下看延迟情况如何呢 |
@lorinlee 这里是下游多节点,random模型的测试情况: [Latency] 也是耗时比较高,下游请求均匀分布。T.T |
保持下游的qps一致试试,比如一个下游的时候3000qps,26个下游的时候3000*26 qps试试。 |
@wwbmmm 现在测试了26个节点 3000*26 qps的情况,rr模式,耗时情况确实好很多!!! 很接近单节点 3000 qps的情况。 另外还测试了 单节点 100 qps,耗时情况也非常好,响应基本都在1ms左右。 这个可能是什么原因呢 |
下游26个节点,是在同一台机器上的吗? |
@wwbmmm 不是噢,4个节点一个物理机 |
@wwbmmm 下游qps越高,耗时情况越好,并且 rpc_press 工具的 thread_num 参数越小,耗时情况也越好。 下面针对线程数的一个测试,下游26个节点,rr模式: qps=78000 thread_num=1,一个线程最多64000qps,这个耗时情况比较好 ================================================== qps=78000 thread_num=0 rpc_press决定线程数,可以达到78000qps,这个耗时情况不是很理想,但是也比 26个节点总共3000 qps 好非常多了 ================================================== |
rpc_press是最新版吗?如果不是,建议更新到包含这个PR的版本试试:#1763 |
@wwbmmm 我们之前用的代码是 0.9.7 版本。我们使用了最新的 master 分支代码,并把我们实现的协议 patch 上去后,再测试发现:
这个问题我们在线上服务中遇到了,然后使用了 rpc_press 发现和线上情况类似。但是看 #1763 如果理解没错的话应该是优化 rpc_press 发送时间间隔,以稳定发送 qps,请问为什么还会让耗时情况变好呢? 另外,我们线上服务是使用异步请求,多线程发送,bthread_usage 也并不高,有空闲 |
旧版rpc_press的问题是发送qps不稳定,有时瞬间发送大量请求,然后又空闲一段时间没有请求。 |
还有可能是tcp_autocorking导致的, |
实现了基于 length + body 的自定义协议,使用 rpc press 压测发现,下游只有一个节点时,时耗稳定并且耗时很小,如果增加下游节点(使用 rr 模式),耗时99线明显上升。
下游节点机器、性能、网络均大致相同,正常情况下处理时耗较短,并且耗时高的 ip 均匀分布。
以下是 1 个下游节点的测试情况:
2022/07/04-15:38:47 sent:3001 success:3002 error:0 total_error:0 total_sent:261105
2022/07/04-15:38:48 sent:3001 success:3001 error:0 total_error:0 total_sent:264106
2022/07/04-15:38:49 sent:3002 success:3001 error:0 total_error:0 total_sent:267108
2022/07/04-15:38:50 sent:3001 success:3001 error:0 total_error:0 total_sent:270109
[Latency]
avg 428 us
50% 408 us
70% 448 us
90% 589 us
95% 656 us
97% 693 us
99% 788 us
99.9% 3003 us
99.99% 3833 us
max 3860 us
以下是 26 个下游节点的测试情况:(平均值和 99 线上升明显)
2022/07/04-15:36:32 sent:3000 success:2998 error:3 total_error:3 total_sent:138053
2022/07/04-15:36:33 sent:3003 success:3001 error:0 total_error:3 total_sent:141056
2022/07/04-15:36:34 sent:3000 success:3001 error:0 total_error:3 total_sent:144056
2022/07/04-15:36:35 sent:3001 success:3002 error:0 total_error:3 total_sent:147057
2022/07/04-15:36:36 sent:3001 success:3001 error:0 total_error:3 total_sent:150058
[Latency]
avg 4793 us
50% 8525 us
70% 8744 us
90% 8847 us
95% 8894 us
97% 8999 us
99% 9361 us
99.9% 10528 us
99.99% 30792 us
max 48065 us
请问有哪些可能的原因呢?
The text was updated successfully, but these errors were encountered: