梁斌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

相关文章

Knife4j+Axios+Redis前后端分离架构下的 API 管理与会话方案(最新推荐)

《Knife4j+Axios+Redis前后端分离架构下的API管理与会话方案(最新推荐)》本文主要介绍了Swagger与Knife4j的配置要点、前后端对接方法以及分布式Session实现原理,... 目录一、Swagger 与 Knife4j 的深度理解及配置要点Knife4j 配置关键要点1.Spri

如何使用Maven创建web目录结构

《如何使用Maven创建web目录结构》:本文主要介绍如何使用Maven创建web目录结构的问题,具有很好的参考价值,希望对大家有所帮助,如有错误或未考虑完全的地方,望不吝赐教... 目录创建web工程第一步第二步第三步第四步第五步第六步第七步总结创建web工程第一步js通过Maven骨架创pytho

Java Web实现类似Excel表格锁定功能实战教程

《JavaWeb实现类似Excel表格锁定功能实战教程》本文将详细介绍通过创建特定div元素并利用CSS布局和JavaScript事件监听来实现类似Excel的锁定行和列效果的方法,感兴趣的朋友跟随... 目录1. 模拟Excel表格锁定功能2. 创建3个div元素实现表格锁定2.1 div元素布局设计2.

如何使用Haporxy搭建Web群集

《如何使用Haporxy搭建Web群集》Haproxy是目前比较流行的一种群集调度工具,同类群集调度工具有很多如LVS和Nginx,本案例介绍使用Haproxy及Nginx搭建一套Web群集,感兴趣的... 目录一、案例分析1.案例概述2.案例前置知识点2.1 HTTP请求2.2 负载均衡常用调度算法 2.

k8s上运行的mysql、mariadb数据库的备份记录(支持x86和arm两种架构)

《k8s上运行的mysql、mariadb数据库的备份记录(支持x86和arm两种架构)》本文记录在K8s上运行的MySQL/MariaDB备份方案,通过工具容器执行mysqldump,结合定时任务实... 目录前言一、获取需要备份的数据库的信息二、备份步骤1.准备工作(X86)1.准备工作(arm)2.手

使用jenv工具管理多个JDK版本的方法步骤

《使用jenv工具管理多个JDK版本的方法步骤》jenv是一个开源的Java环境管理工具,旨在帮助开发者在同一台机器上轻松管理和切换多个Java版本,:本文主要介绍使用jenv工具管理多个JD... 目录一、jenv到底是干啥的?二、jenv的核心功能(一)管理多个Java版本(二)支持插件扩展(三)环境隔

MybatisPlus service接口功能介绍

《MybatisPlusservice接口功能介绍》:本文主要介绍MybatisPlusservice接口功能介绍,本文给大家介绍的非常详细,对大家的学习或工作具有一定的参考借鉴价值,需要的朋友... 目录Service接口基本用法进阶用法总结:Lambda方法Service接口基本用法MyBATisP

Java -jar命令如何运行外部依赖JAR包

《Java-jar命令如何运行外部依赖JAR包》在Java应用部署中,java-jar命令是启动可执行JAR包的标准方式,但当应用需要依赖外部JAR文件时,直接使用java-jar会面临类加载困... 目录引言:外部依赖JAR的必要性一、问题本质:类加载机制的限制1. Java -jar的默认行为2. 类加

Python中bisect_left 函数实现高效插入与有序列表管理

《Python中bisect_left函数实现高效插入与有序列表管理》Python的bisect_left函数通过二分查找高效定位有序列表插入位置,与bisect_right的区别在于处理重复元素时... 目录一、bisect_left 基本介绍1.1 函数定义1.2 核心功能二、bisect_left 与

java -jar命令运行 jar包时运行外部依赖jar包的场景分析

《java-jar命令运行jar包时运行外部依赖jar包的场景分析》:本文主要介绍java-jar命令运行jar包时运行外部依赖jar包的场景分析,本文给大家介绍的非常详细,对大家的学习或工作... 目录Java -jar命令运行 jar包时如何运行外部依赖jar包场景:解决:方法一、启动参数添加: -Xb