梁斌penny_Penny Pinching在云中:在单个Azure App Service上运行和管理Web Apps的LOTS

梁斌penny

梁斌penny

I've blogged before about "penny pinching in the cloud." I'll update that series for 2017 soon, but the underlying concepts still apply. Many if you are still using bigger virtual machines than are needed when doing IaaS (Infrastructure as a Service) or when doing PaaS (Platform as a Service) folks are doing "one website per App Service." That's super expensive.

我以前写过关于“一分钱在云端”的博客。 我将在2017年更新该系列,但基本概念仍然适用。 很多人在使用IaaS(基础设施即服务)或PaaS(平台即服务)时仍在使用比需要的更大的虚拟机时,人们正在“每个App Service一个网站”。 那太贵了。

Remember that you can fit as many web applications as memory and CPU will into an Azure App Service Plan. An "App Service Plan" in Azure is effectively the Virtual Machine under your Web Apps. You don't need to think about it as it's totally managed and hidden - but - if you choose think about it you'll be able to squeeze more out of it and you'll pay less.

请记住,您可以在Azure应用服务计划中容纳尽可能多的Web应用程序,如内存和CPU。 Azure中的“应用程序服务计划”实际上是Web应用程序的虚拟机。 您完全不必担心它,因为它是完全托管和隐藏的-但是-如果您选择考虑它,则可以从中挤出更多的钱,而支付的费用却更少。

For example, I have 20 web applications running in a plan I named "DefaultServerFarm." It's a Small Standard Plan (S1) and I pay about $70 a month. Some folks use a Basic (B1) plan if they don't need to scale out and that's about $50 a month. Both B1 and S1 support "unlimited" web apps within them, to the limits of memory. That's what allows me to run 20 modest (but real) sites on the one plan and that's what makes it a good deal from a pricing perspective for me.

例如,有20个Web应用程序在名为“ DefaultServerFarm”的计划中运行。 这是一个小型标准计划(S1) ,我每月支付约70美元。 有些人如果不需要扩展,则使用基本(B1)计划,每月大约50美元。 B1和S1都在其中支持“无限”的Web应用程序,以达到内存限制。 这就是让我可以在一个计划中运行20个适度(但实际)的网站的原因,从定价的角度来看,这对我来说是一笔不错的交易。

I logged in to the Azure Portal recently and noticed the CPU percentage on my plan was higher than usual and higher than I'd like.

我最近登录了Azure门户,发现我计划中的CPU百分比高于通常的水平,也高于我想要的水平。

Why is that web app using so much CPU?

That's the CPU of the machine "under" my 20 sites. I can click here on my App Service Plan's "blade" to see the underlying sites, or just click "Apps" in the blade menu.

那是我20个站点“下方”的计算机的CPU。 我可以在“我的应用服务计划”的“刀片”上单击此处以查看基础站点,或者只需在刀片菜单中单击“应用”。

Running 20 apps in a Single Azure App Service

However, when I'm looking at an app that lives within my plan, there's two super powerful menu items to check out. One is  called "Metrics per instance (Apps)" and one is "Metrics per instance (App Service)." Click the latter option. For many of you it's going to become your favorite area in the Azure Portal. It was a game changer for me as it gave me the internal insight I needed to make sure I can get maximum density in my plan (thereby saving the most money).

但是,当我查看计划范围内的应用程序时,有两个超级强大的菜单项需要签出。 一种称为“每个实例的度量标准(应用程序)”,另一种称为“每个实例的度量标准(应用程序服务)”。 单击后一个选项。 对于许多人来说,它将成为Azure门户中您最喜欢的区域。 对我来说,这是一个改变游戏规则的方法,因为它为我提供了我所需的内部洞察力,以确保我可以在计划中获得最大的密度(从而节省最多的钱)。

Metrics per Instance - App Service Plan

I click here and see "Sites in App Service Plan."

我单击此处,然后看到“应用服务计划中的站点”。

20 sites in a single plan

I can see that over the last few days my CPU has been going up and up...

我可以看到最近几天我的CPU一直在上升...

The CPU is going up and up over a few days

I can see by site:

我可以按网站查看:

A graph showing ALL 20 sites and their CPU

So now I can filter by site and I see that it's ONE site that's going nuts.

因此,现在我可以按网站进行筛选,我发现这是一个疯狂的网站。

One site is using all the CPU

I can then dig in, go to the main CPU charge and see exactly when it started:

然后,我可以进行深入研究,转到主CPU收费处,并确切地了解它的启动时间:

The site is using 2.12 days of CPU

I can change the scale

我可以改变比例

It started on Feb 11th

I had a Web Job stuck in a loop. I restarted and will be monitoring but for now, I'm in a much better place for this one app.

我的Web作业陷入了循环。 我重新启动并将进行监视,但就目前而言,我在使用此应用程序的地方要好得多。

Now it's calming down

Now if I check the App Service Plan itself, I can see everything has calmed down.

现在,如果我检查了应用服务计划本身,则可以看到一切都平静了。

Things have calmed down after the one rogue site was restarted

The point here is that even though it's "Platform as a Service" and we want a layer of abstraction, at no point are things HIDDEN from us. If you want to see the hardware, you can. If you want to see the process tree, you can. A good reminder.

这里的要点是,即使它是“平台即服务”,并且我们想要一个抽象层,也绝不会隐藏任何东西。 如果要查看硬件,可以。 如果要查看流程树,可以。 一个很好的提醒。

Sponsor: Excited about the future in ASP.NET? The folks at Progress held an awesome webinar which gives a 360⁰ view of the new ASP.NET Core and how it compares to WebForms and MVC. Watch it now on demand!

赞助者:对ASP.NET的未来感到兴奋吗? Progress的人们举办了一个很棒的网络研讨会,可以360°观看新的ASP.NET Core及其与WebForms和MVC的比较。 现在点播观看!

翻译自: https://www.hanselman.com/blog/penny-pinching-in-the-cloud-running-and-managing-lots-of-web-apps-on-a-single-azure-app-service

梁斌penny

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值