问题
I've been working on a project utilizing the Gcloud pubsub platform on the node.js flexible runtime and for some reason have had some pretty crazy latency that has been increasing in severity over time. At first, only messages of a certain kind would sometimes experience heavy latency. However, as I've continued working over the past few days, now all messages are experiencing latency reaching over several minutes regardless of type. It's reached the point where testing has become impossible because the latency is taking so long.
What could be done to help alleviate the issue? I have not edited the code receiving the messages except for the function handling the messages. I'm receiving them through the subscription.on() function.
Please let me know what information I can provide to help reproduce the error. Thanks in advance.
Edit: I was able to get it working again by deleting the topic & subscriptions and recreating them. Now latency is at a minimum, but I'm still not sure what caused this issue. Maybe a large backlog of unprocessed messages? Any ideas would help to avoid this in the future.
来源:https://stackoverflow.com/questions/51736428/pubsub-latency-reaching-minutes