我有一个相当简单的设置,其中有许多不同的工作人员监控不同的资源。当他们中的一个人发现新内容时,他们会向 Google PubSub 发布一条消息,然后我让一名工作人员拉取 PubSub 主题以获取消息并通过 Google Cloud Messenger 发送它们。
这应该非常简单,并且大部分都有效。但是,我遇到了一个有趣的情况,当我拉取时,我有时只会返回消息,如果 PubSub 主题为空,这将是有意义的。然而,这个话题并不是空洞的,而且还在不断扩大。我的工人拉的消息现在通常晚了大约 45 分钟。
根据 Stack Driver,我的 PubSub 消息队列现在有 10,000 条消息等待传递。:(
这是进行拉动的工人的代码:https ://github.com/Regner/en-notifications
19:05:36.000 INFO:root:Polling for new notifications...
19:05:25.000 INFO:root:Polling for new notifications...
19:05:15.000 INFO:root:Polling for new notifications...
19:05:04.000 INFO:root:Polling for new notifications...
19:04:55.000 INFO:root:Polling for new notifications...
19:04:44.000 INFO:root:Polling for new notifications...
19:04:44.000 INFO:requests.packages.urllib3.connectionpool:Starting new HTTPS connection (1): gcm-http.googleapis.com
19:04:44.000 INFO:root:Sending message to the following topic "/topics/zkb-kills-1000181"
19:04:44.000 INFO:root:Got message ID 17004238187730 with attributes {u'subtitle': u'Mhorbids One just lost a Executioner worth 3,431,051.31 ISK in Evaulon.', u'service': u'en-zkillboard', u'title': u'zKillboard', u'url': u'https://zkillboard.com/kill/52505094/', u'topic': u'zkb-kills-1000181', u'collapse_key': u'zkb-kills-1000181'}.
19:04:44.000 INFO:root:Polling for new notifications...
其他一些信息: * 这一切都作为带有 Google Container Engine 的容器运行 * 我已经尝试启动更多的拉取容器副本,但它似乎并没有改变拉取消息的速度。
我真的很感激任何帮助弄清楚为什么会这样。这真的让我很困惑。
提前感谢您提供的任何帮助。
雷格纳