gcloud - Cloud pubsub slow poll rate -


i have pubsub topic, 1 subscription, , 2 different subscribers pulling it. using stackdriver, can see subscription has ~1000 messages. each subscriber runs following poll loop:

client = pubsub.client() topic = client.topic(topic_name) subscription = pubsub.subscription(subscription_name)  while true:     messages = subscription.pull(return_immediately=true, max_messages=100, client=client)     print len(messages)     # put messages in local queue later processing. processes ack subsription 

my issue slow poll rate - though have plenty of messages waiting polled, i'm getting several messages each time. also, lots of responses without messages. according stackdriver, messages pulled rate ~1.5 messages/sec.

i tried use return_immediately=false, , improved bit - pull rate increased ~2.5 messages/sec, still - not rate expect have.

any ideas how increase pull rate? pubsub poll best practices?

in order increase pull rate, need have more 1 outstanding pull request @ time. how many depends on how fast , how many places publish. you'll need @ least few outstanding @ times. 1 of them returns, create pull request. way, whenever cloud pub/sub ready deliver messages subscriber, have requests waiting receive messages.


Comments

Popular posts from this blog

amazon web services - S3 Pre-signed POST validate file type? -

c# - Check Keyboard Input Winforms -