运行 aws 中的简单动态应用程序是否需要 Elastic Load Balancing?

Does Elastic Load Balancing is required to run a simple dynamic application in aws?

我是aws的新手。我上个月通过 Elastic Beanstalk 在 aws 上托管了我的 .net 网站。它是一个简单的 5 页 .net 核心网站,没有任何数据库。用户也太少了。

现在的问题是我收到了弹性负载平衡费用非常高(几乎 95%)的月度账单。我的问题是:

  1. 我的网站 运行 需要弹性负载平衡服务吗?没有它不行吗

  2. 如果我将弹性负载均衡删除会怎么样呢?有没有办法暂时禁用它并检查?

  3. 如果弹性负载平衡是必要的,那么我如何将其使用控制在最低水平或优化它以降低成本?

好的,现在下面的答案部分解决了我的问题。现在,当我将实例更改为单个实例时,出现以下错误:

Do I need elastic load balancing service to run my website? Can't it be done without it.

是的,您可以将 EB 环境从 load-balanced 更改为 single-instance 类型。 single-instance 不使用负载平衡器。它只是具有弹性IP的单个实例。

If I will delete the elastic load balancing than what happen? Is there a way to disable it for a while and check?

如果您手动删除它,想法就会崩溃。正确的方法是使用 EB 配置选项将 load-balanced 更改为 single-instance。然后会发生什么,这取决于您使用负载均衡器做什么?例如,如果您将它用于 SSL 证书,您将失去 HTTPs,并且必须以不同的方式进行设置。

If elastic load balancing is necessary than how can I control its use to minimum level or optimize it for low cost?

没必要。这就是 single-instance EB 环境存在的原因。

Do I need elastic load balancing service to run my website? Can't it be done without it.

当然是您的网站 can run without a load balancer,当您的网站流量过多并且您不想让单个实例过载时, 会使用负载均衡器 。在这种情况下,负载平衡器会在不同实例之间均匀地平衡负载。

它为您的网站提供一个单一的 DNS 名称,所有流量都通过该名称进入(人们使用负载均衡器的另一个原因)

If I will delete the elastic load balancing than what happen? Is there a way to disable it for a while and check?

如果您通过 beantalk 提供负载均衡器,然后手动删除它肯定会破坏,改为将您的环境配置更改为单实例,并且as @marcin pointed out other things will also be taken like https,load balancer health of ec2 instances,stickiness with cookies. https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/using-features-managing-env-types.html

If elastic load balancing is necessary than how can I control its use to minimum level or optimize it for low cost?

完全取决于您网站上的流量您实例的容量。如果你的实例在计算方面足够大,内存就不需要负载均衡器。(如果它很大,自然你的实例将可以免费满足所有请求)。