简体   繁体   English

为什么不在 AWS 上获得 2 个纳米实例而不是 1 个微型实例?

[英]Why not get 2 nano instances instead 1 micro instance on AWS?

I'm choosing instances do run microservices on an AWS EKS cluster.我选择在 AWS EKS 集群上运行微服务的实例。

When reading about it on this article an taking a look on the aws docs it seems that choosing many small instances instead of on larger instance results on a better deal.这篇文章中阅读它并查看aws 文档时,似乎选择许多小实例而不是较大的实例会产生更好的效果。

There seems to be no downside on taking, for instance, 2 t3.nano (2 vCPU / 0.5GiB each) vs 1 t3.micro (2 vCPU / 1GiB each).例如,使用 2 t3.nano(每个 2 vCPU / 0.5GiB)与 1 t3.micro(每个 2 vCPU / 1GiB)似乎没有任何缺点。 The price and the memory are the same but the CPU provided has a huge difference the more instances you get.价格和 memory 是一样的,但是你得到的实例越多,提供的 CPU 就会有很大的不同。

I assume there are some processes running on each machine by default, but I found no places metioning its impact on the machine resources or usage.我假设默认情况下每台机器上都会运行一些进程,但我没有发现任何地方提到它对机器资源或使用的影响。 Is it negligible?可以忽略不计吗? Is there any advantage on taking one big instance instead?取一个大实例有什么好处吗?

The issue is whether or not your computing task can be completed on the smaller instances and also there is an overhead involved in instance-to-instance communication that isn't present in intra-instance communication.问题是您的计算任务是否可以在较小的实例上完成,并且实例间通信涉及的开销在实例内通信中不存在。

So, it is all about fitting your solution onto the instances and your requirements.因此,这一切都是为了让您的解决方案适合实例和您的要求。

There is no right answer to this question.这个问题没有正确答案。 The answer depends on your specific workload, and you have to try out both approaches to find out what works best for your case.答案取决于您的具体工作量,您必须尝试这两种方法才能找出最适合您的情况的方法。 There are advantages and disadvantages to both approaches.这两种方法都有优点和缺点。

For example, if the OS takes 200 MB for each instance, you will be left with only 600 MB both nano instances combined vs the 800 MB on the single micro instance.例如,如果操作系统为每个实例占用 200 MB,那么您将只剩下 600 MB 两个 nano 实例的组合,而单个微型实例上的 800 MB。

When the cluster scales out, initializing 2 nano instances might roughly take twice as much time as initializing one micro instance to provide the same additional capacity to handle the extra load.当集群向外扩展时,初始化 2 个 nano 实例所花费的时间大约是初始化一个 micro 实例所需的时间的两倍,以提供相同的额外容量来处理额外的负载。

Also, as noted by Cargo23, inter-instance communication might increase the latency of your application.此外,正如 Cargo23 所指出的,实例间通信可能会增加应用程序的延迟。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM