云功能运行多少个进程? [英] On how many process do cloud function run?
问题描述
我想使用Google云功能来更新位于heroku上的其他数据库,因为firebase realtime database
不会删除它.
I would like to use google cloud functions to update an additional database living on heroku because firebase realtime database
is not cutting it.
但是heroku接受并发连接的限制,所以我想知道将通过云功能打开多少个并发连接?是1吗?没有限制吗?
However there is a limit of concurrent connections that are accepted on heroku, so I'm wondering how many of them will be opened via cloud functions ? Is it 1 ? Is there no limit ?
我的函数中有类似的东西
I've something like this in my functions
import { Pool } from 'pg';
const pool = new Pool(connectionString);
exports.onAuth = functions.auth.user().onCreate(event => {
pool.query(...)
});
推荐答案
Cloud Functions将旋转所需数量的服务器实例,以满足您对功能的需求.如果没有负载,它可能低至0,而如果有很多负载,则可能高得多.每个实例都可以为您的功能工作.您不能限制函数实例的数量-它只是根据需要自动缩放.因此,您可以认为它没有限制(只要您支付账单).
Cloud Functions will spin up as many server instances as is required to meet the demand on your functions. It could be as low as 0 if there is no load, and much higher if there is a lot of load. Each instance could be doing work for your function. You can't constrain the number of instances for your functions - it just scales automatically on demand. So you can think of it as having no limit (as long as you are paying your bills).
这篇关于云功能运行多少个进程?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!