Closed ensonic closed 7 years ago
@ensonic I'm tagging this with the back-end
tag because we don't have any visibility to server-side latency issues here: this repository is just the client wrapper.
@tmatsuo Can you suggest anything?
We are planning this in the near future. At the moment, we are waiting on the API support to be finalized.
@lukesneeringer what are you planning in the near future? Any comment on why the pull invocations are slow, especially when there are no messages?
/cc @tswast
Soon to be obselete because #3637. @ensonic Sorry, I should have answered your question when you asked it in March. Erm...how embarrassing. But, I basically rewrote the library based on requests from the Pub/Sub team.
os: ubuntu:xenial (running on GKE) python 3.5.2 library versions: google-auth==0.6.0 google-auth-httplib2==0.0.2 google-cloud-core==0.22.1 google-cloud-pubsub==0.22.0 google-gax==0.15.6 googleapis-common-protos==1.5.2 grpc-google-cloud-pubsub-v1==0.14.0 grpc-google-iam-v1==0.11.1 grpcio==1.1.0
I wrapped code like this:
The running code produces a log like this:
What stands out for me is that pull is quite slow, especially when there are no messages (len=0). Is this a bug or a design limitation? The code is a process that pulls new messages on a set of topics and processes them. The processing is super light (and runs in a different thread off a Queue). Would you recommend to change the subscription to be push based as demo'ed here: https://cloud.google.com/pubsub/docs/subscriber#receive_push? Where to get the PUBSUB_VERIFICATION_TOKEN from is not clear in this example though, I am not on appengine.