如何指定我希望我的应用运行的实例?
在int main(int argc, char *argv[])
{
void *context = zmq_ctx_new();
// Socket to talk to server
void *subscriber = zmq_socket(context, ZMQ_SUB);
int rc = zmq_connect(subscriber, "tcp://127.0.0.1:5000");
assert(rc == 0);
rc = zmq_setsockopt(subscriber, ZMQ_SUBSCRIBE, "", strlen(""));
assert(rc == 0);
// Process 100 updates
int update_nbr;
long total_temp = 0;
for (update_nbr = 0; update_nbr < 100; update_nbr++) {
char msg[256];
rc = zmq_recv(subscriber, msg, 256, 0);
std::cout << "Received World " << msg << std::endl;
}
zmq_close(subscriber);
zmq_ctx_destroy(context);
return 0;
}
之后,会自动为该新版本创建一个新实例。如果我创建一个新实例(一个CPU比自动创建的实例多),它就会保持空闲状态。
答案 0 :(得分:0)
app.yaml
中的:
resources:
cpu: 8
memory_gb: 64