Skip to content

When to create pubsub client subscription? #10320

Answered by coryan
iamsamskup asked this question in Q&A
Discussion options

You must be logged in to vote

In principle this will work. You did not mention the expected message rates over these topics, some optimization may be required if the message rate is sufficiently high (at a guess, anything over 1,000 messages/second).

I expect that fine tuning the implicitly created background thread pools, connection pools, and other low-level details may require some work. Here are some starting ideas:

  • Each subscriber in you loop creates a thread pool to service the request. You may need to create your own thread pool using GrpcCompletionQueueOption, or reduce the size of the pool on each subscriber GrpcBackgroundThreadPoolSizeOption.

  • Each subscriber creates a pool of gRPC channels, the default c…

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@iamsamskup
Comment options

@coryan
Comment options

Answer selected by iamsamskup
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants