[英]How can I make multiple VMs work on the same script in GCP?
I have a Python script which is supposed to create quite a lengthy list, currently the VM I am using has an 8 core processor and 30GB RAM however that is not enough as the machine runs out of memory before it can generate the list.我有一个 Python 脚本,它应该创建一个相当长的列表,目前我使用的 VM 有一个 8 核处理器和 30GB RAM,但这还不够,因为机器在生成列表之前就用完了 memory。 I am wondering, is it possible to have say 5 similar VMs and have them work on the same script and pool their resources together?
我想知道,是否可以说 5 个类似的虚拟机并让它们在同一个脚本上工作并将它们的资源集中在一起? I was thinking of using a MIG however I am wondering where would I then store the script and how would they be able to communicate among them?
我正在考虑使用 MIG 但是我想知道我将在哪里存储脚本以及它们如何能够在它们之间进行通信?
Resolved this issue by changing my Python script to use a generator instead of saving the list to a var and simply for loop through that generator, no need for extra processing power.通过将我的 Python 脚本更改为使用生成器而不是将列表保存到 var 并简单地循环通过该生成器来解决此问题,无需额外的处理能力。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.