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

本文主要是介绍梁斌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

这篇关于梁斌penny_Penny Pinching在云中:在单个Azure App Service上运行和管理Web Apps的LOTS的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!



http://www.chinasem.cn/article/327477

相关文章

SpringBoot中使用 ThreadLocal 进行多线程上下文管理及注意事项小结

《SpringBoot中使用ThreadLocal进行多线程上下文管理及注意事项小结》本文详细介绍了ThreadLocal的原理、使用场景和示例代码,并在SpringBoot中使用ThreadLo... 目录前言技术积累1.什么是 ThreadLocal2. ThreadLocal 的原理2.1 线程隔离2

Android里面的Service种类以及启动方式

《Android里面的Service种类以及启动方式》Android中的Service分为前台服务和后台服务,前台服务需要亮身份牌并显示通知,后台服务则有启动方式选择,包括startService和b... 目录一句话总结:一、Service 的两种类型:1. 前台服务(必须亮身份牌)2. 后台服务(偷偷干

解决JavaWeb-file.isDirectory()遇到的坑问题

《解决JavaWeb-file.isDirectory()遇到的坑问题》JavaWeb开发中,使用`file.isDirectory()`判断路径是否为文件夹时,需要特别注意:该方法只能判断已存在的文... 目录Jahttp://www.chinasem.cnvaWeb-file.isDirectory()遇

JavaWeb-WebSocket浏览器服务器双向通信方式

《JavaWeb-WebSocket浏览器服务器双向通信方式》文章介绍了WebSocket协议的工作原理和应用场景,包括与HTTP的对比,接着,详细介绍了如何在Java中使用WebSocket,包括配... 目录一、概述二、入门2.1 POM依赖2.2 编写配置类2.3 编写WebSocket服务2.4 浏

通过prometheus监控Tomcat运行状态的操作流程

《通过prometheus监控Tomcat运行状态的操作流程》文章介绍了如何安装和配置Tomcat,并使用Prometheus和TomcatExporter来监控Tomcat的运行状态,文章详细讲解了... 目录Tomcat安装配置以及prometheus监控Tomcat一. 安装并配置tomcat1、安装

mysqld_multi在Linux服务器上运行多个MySQL实例

《mysqld_multi在Linux服务器上运行多个MySQL实例》在Linux系统上使用mysqld_multi来启动和管理多个MySQL实例是一种常见的做法,这种方式允许你在同一台机器上运行多个... 目录1. 安装mysql2. 配置文件示例配置文件3. 创建数据目录4. 启动和管理实例启动所有实例

Linux内存泄露的原因排查和解决方案(内存管理方法)

《Linux内存泄露的原因排查和解决方案(内存管理方法)》文章主要介绍了运维团队在Linux处理LB服务内存暴涨、内存报警问题的过程,从发现问题、排查原因到制定解决方案,并从中学习了Linux内存管理... 目录一、问题二、排查过程三、解决方案四、内存管理方法1)linux内存寻址2)Linux分页机制3)

使用TomCat,service输出台出现乱码的解决

《使用TomCat,service输出台出现乱码的解决》本文介绍了解决Tomcat服务输出台中文乱码问题的两种方法,第一种方法是修改`logging.properties`文件中的`prefix`和`... 目录使用TomCat,service输出台出现乱码问题1解决方案问题2解决方案总结使用TomCat,

IDEA运行spring项目时,控制台未出现的解决方案

《IDEA运行spring项目时,控制台未出现的解决方案》文章总结了在使用IDEA运行代码时,控制台未出现的问题和解决方案,问题可能是由于点击图标或重启IDEA后控制台仍未显示,解决方案提供了解决方法... 目录问题分析解决方案总结问题js使用IDEA,点击运行按钮,运行结束,但控制台未出现http://

解决Spring运行时报错:Consider defining a bean of type ‘xxx.xxx.xxx.Xxx‘ in your configuration

《解决Spring运行时报错:Considerdefiningabeanoftype‘xxx.xxx.xxx.Xxx‘inyourconfiguration》该文章主要讲述了在使用S... 目录问题分析解决方案总结问题Description:Parameter 0 of constructor in x