pop消费模式下消费速度和消费者数量以及topic queue数量的关系 #7942
Unanswered
LittleBoy18
asked this question in
Q&A
Replies: 1 comment
-
锁竞争影响性能,理论上得需要很高并发,4个并发显然不够,并且 Broker 处理拉取请求的并发是有限制的,默认最多会有 32 个线程在竞争,我理解也不严重(每个拉取请求获取锁后都是从内存中读数据,速度非常快,并不会长期持有锁) 况且很多时候消费瓶颈不在拉取上,而在消费逻辑上,从生产环境数据来看,一般每个 Broker 上设置单个 queue 足够 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
pop消费的时候broker会给queue加锁,理论上增加queue的数量会避免锁的竞争,消费速度会有明显提高,按照以下用例测试消费速度无明显提高,用例如下:
1、topic单queue,四个消费者同时进行pop消费
2、topic四个queue,四个消费者同时进行pop消费
pop消费模式下,消费速度只和消费者数量有关系不用考虑queue的数量吗?
Beta Was this translation helpful? Give feedback.
All reactions