当我出于某种原因从 Cloud Run 实例调用其他云 API 时,响应会出现巨大延迟。一切都在 1 个项目中运行。即使从本地机器调用也更快(几秒钟) - 但部署在云中,一些请求需要几分钟才能完成。正如我所见,它与所有 API 相关(除了 Firestore、Translate 和 TTS API)。这肯定与冷启动无关。
代码示例(Node JS)和日志如下:
console.log('Received the request for stats');
const usersCollection = this.firestore.collection('users')
const snapshot = await this.usersCollection.get();
console.log('Fetched all users from Firestore');
