Pulsar client numIoThreads and numListenerThreads per consumer instance or for all consumer instances

huangapple go评论84阅读模式
英文:

Pulsar client numIoThreads and numListenerThreads per consumer instance or for all consumer instances

问题

让我们假设我有以下的Pulsar配置:

对于topicX,我有点困惑。这里的三个线程和15个监听器线程是针对所有的消费者,还是这些数字会乘以消费者的数量?你能澄清一下吗?

所以对于topicX,这意味着我们有9个I/O线程和45个监听器线程。

我似乎在文档中找不到这个信息,有参考资料吗?

英文:

Let's say I have the following pulsar config:

pulsar:
  topicX:
    client:
      config:
        numIoThreads: 3
        numListenerThreads: 15
    consumer:
      config:
        receiverQueueSize: 20
      count: 3
  topicY:
    client:
      config:
        numIoThreads: 3
        numListenerThreads: 15
    consumer:
      config:
        receiverQueueSize: 20
      count: 10

I'm a bit confused about topicX. Are there just three threads and 15 listener threads for all the consumers, or are these numbers multiplied by the consumer count? Can you clarify?

So for topicX that would mean that we have 9 io threads and 45 listener threads.

I can't seem to find this in the documentation, any reference?

答案1

得分: 1

ioThreadslistenerThreads 都是 Pulsar 客户端创建的所有生产者和消费者共享的资源。因此,无论您从该 Pulsar 客户端创建多少个消费者和/或生产者,您都会拥有总共的 3 个 I/O 线程和 15 个监听线程。

英文:

Both the ioThreads and listenerThreads are shared resources across all the producer and consumers that are created from the Pulsar Client. Thus, you would have a total of 3 io threads, and 15 listener threads regardless of how many consumers and/or producers you create from that Pulsar Client.

答案2

得分: 0

我理解的是,IO 线程是客户端与代理之间的连接数,监听器线程是在该客户端使用的所有消费者之间共享的线程池。 Javadoc 是我找到的唯一一个更深入讨论此事的地方。

英文:

Just to clarify, you are not using Spring for Apache Pulsar, correct? I only mention this to be sure this is just a core Pulsar Java client configuration question (excellent question btw).

My understanding is that the io threads are the number of connections from the client to the broker and the listener threads are a pool shared across all consumers used by that client. The Javadoc is really the only place I have found that talks more in depth about it.

huangapple
  • 本文由 发表于 2023年7月20日 19:41:56
  • 转载请务必保留本文链接:https://go.coder-hub.com/76729482.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定