梁斌penny_Penny Pinching在云中:在Windows Azure网站上启用新的文物性能监控

本文主要是介绍梁斌penny_Penny Pinching在云中:在Windows Azure网站上启用新的文物性能监控,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!

梁斌penny

梁斌penny

New Relic view of my Website

I've been looking for ways to save money running my (now 12) websites in the cloud lately. Getting insights from logs has been helpful, but I really want more details as to what my app is doing so that I might do less of it. Remember the secret of scaling an application.

最近,我一直在寻找省钱的方法来在云中运行我的网站(现在有12个)。 从日志中获取见解是有帮助的,但是我确实想要更多有关我的应用程序执行情况的详细信息,以便我可以做更少的事情。 记住扩展应用程序的秘密。

Have your app do as little as possible. If you do nothing, you can scale infinitely.

让您的应用做得尽可能少。 如果您什么都不做,则可以无限扩展。

I like to use tools like Glimpse to profile my apps, check database calls, and explore what's really going on. If you like application insights you may be familiar with New Relic. They are a clever system that profiles apps of all kinds, including sites ASP.NET and Azure.

我喜欢使用Glimpse之类的工具来分析我的应用程序,检查数据库调用并探究实际情况。 如果您喜欢应用程序见解,则可能熟悉New Relic 。 它们是一个聪明的系统,可以分析各种应用程序,包括网站ASP.NET和Azure。

I tweeted this afternoon for folks to hit my site and help me test New Relic. My lovely friends on Twitter promptly DDOS'ed my site and I respect them all the more for it.

我今天下午发了一条推文,让人们访问我的网站并帮助我测试New Relic。 我在Twitter上可爱的朋友们很快就用DDOS来访问我的网站,为此我更加尊敬他们。

@shanselman Hey, you said "beat the crap out of", not "give it a little load". Two TOTALLY different things!

— Shane Milton (@Jaxidian)

@ shanselman嘿,您说的是“废话少了”,而不是“给它一点负担”。 两件事完全不同!

— Shane Milton(@Jaxidian) May 1, 2013 2013年5月1日
My site getting beaten on

You can actually see my site getting loaded up in this chart, and see when I scaled up within Azure and switched from Shared to Reserved. The orange instance is shared, and the blue is a NEW instances when I switched to a Reserved VM. At this point, I had enough power to weather the storm. Thanks Twitter!

您实际上可以在此图表中看到我的网站正在加载,并看到我何时在Azure中进行扩展并从“共享”切换为“保留”。 当我切换到保留虚拟机时,橙色实例是共享的,蓝色实例是NEW的。 此时,我有足够的能力度过风暴。 感谢Twitter!

How did I setup New Relic on my Web Site? New Relic happens to have an office in Portland (where I live) so I went to visit today. Coincidentally (true story) their support for Azure Web Sites has sneaked out from a closed beta to an open one recently, so I decided to hide out and see if I could add New Relic performance and application monitoring to the Hanselminutes.com podcast site.

如何在我的网站上设置New Relic? New Relic恰好在波特兰(我住的地方)有一个办公室,所以我今天去了。 巧合的是(真实的故事),他们对Azure网站的支持已经从一个封闭的Beta滑到了一个开放的Beta,所以我决定躲起来,看看是否可以在Hanselminutes.com播客站点上添加New Relic性能和应用程序监视。

将新文物添加到您的Azure帐户 (Adding New Relic to your Azure account)

Login to the Azure Portal, click on New, then Store, then New Relic from within the Store.

登录到Azure门户,单击“新建”,然后单击“存储”,然后单击“存储”中的“新建文物”。

Adding New Relic to my Azure Portal

Pick the free plan. You can have a free plan forever, they say. It doesn't include some "bells and whistles" and a storage of large amounts of historical data, but is otherwise quite functional. Plus you get a free 14-day trial (no credit card needed) of their Pro stuff.

选择免费计划。 他们说,您可以永远拥有免费计划。 它不包括一些“风吹草动”和大量历史数据的存储,但是在其他方面却很有用。 另外,您还可以免费获得其Pro产品的14天试用版(无需信用卡)。

Create the Add-On. They tell me the Data Center Location for New Relic doesn't matter, as you are just going to get a license key.

创建加载项。 他们告诉我,New Relic的数据中心位置无关紧要,因为您将只获得许可证密钥。

NOTE: If you already have a New Relic license key and existing billing relationship the you don't have to use the store or add an add-on. You can use your existing license key. However, I want my billing centralized, so any bill from New Relic will go through my Azure account. It's up to you.

注意:如果您已经拥有新的Relic许可证密钥和现有的帐单关系,则不必使用商店或添加附件。 您可以使用现有的许可证密钥。 但是,我希望将帐单集中化,因此来自New Relic的所有帐单都将通过我的Azure帐户。 由你决定。

Adding New Relic

Now, from within the Azure dashboard, click the new New Relic node. You can click Manage to automatically move over (and automatically single sign on) to the New Relic system dashboard. Note also the Connection Info button there. We'll need that in a minute.

现在,从Azure仪表板中,单击新的New Relic节点。 您可以单击管理以自动移至(并自动单点登录)到New Relic系统仪表板。 还要注意那里的“连接信息”按钮。 我们一分钟就需要。

New Relic within the Azure Dashboard

If you click Manage and head over to the New Relic side you'll get a Welcome Message but you won't actually SEE anything interesting until your app has successfully made its first call to their system. You can check out their .NET docs if you like. They are in flux and not entirely accurate, but they'll get there.

如果单击“管理”并转到“新消息”侧,您将收到“欢迎消息”,但实际上您不会看到任何有趣的消息,直到您的应用程序成功对其系统进行首次调用。 如果愿意,可以查看他们的.NET文档。 它们变化很大,而且不完全准确,但是可以达到目的。

We need to setup our Azure Website with some environment info, then add the New Relic NuGet package.

我们需要使用一些环境信息来设置我们的Azure网站,然后添加New Relic NuGet程序包。

Staying with the Azure Portal, go to the Web Site you're going to instrument, and click Configuration and setup these Configuration Values. This hooks up the New Relic production profiler to the CLR. You can keep this running all the time, and it's easy to turn off.

使用Azure门户,转到要检测的网站,然后单击“配置”并设置这些配置值。 这会将New Relic生产分析器连接到CLR。 您可以一直保持运行状态,并且很容易关闭它。

Add these name/value pairs:

添加以下名称/值对:

  • COR_ENABLE_PROFILING - 1

    COR_ENABLE_PROFILING-1
  • COR_PROFILER -{71DA0A04-7777-4EC6-9643-7D28B46A8A41}

    COR_PROFILER-{71DA0A04-7777-4EC6-9643-7D28B46A8A41}
  • COR_PROFILER_PATH - C:\Home\site\wwwroot\newrelic\NewRelic.Profiler.dll

    COR_PROFILER_PATH-C:\ Home \ site \ wwwroot \ newrelic \ NewRelic.Profiler.dll
  • NEWRELIC_HOME - C:\Home\site\wwwroot\newrelic

    NEWRELIC_HOME-C:\ Home \ site \ wwwroot \ newrelic

Your app settings will look like this in your website config within the Azure Portal:

您的应用程序设置将在Azure门户的网站配置中如下所示:

Azure Website Config with New Relic

Make sure you not only Save your config, but also (at least once) do a complete RESTART for New Relic to get a chance to hook in.

确保不仅保存您的配置,而且(至少一次)对New Relic进行完整的RESTART,以有机会上钩。

将新的遗物添加到您的网站 (Add New Relic to your Web Site)

Install the NewRelicWindowsAzure Nuget package using the NuGet Package Manager Console using this command:

使用以下命令,使用NuGet软件包管理器控制台安装NewRelicWindowsAzure Nuget软件包:

Install-Package NewRelic.Azure.WebSites

The website for Hanselminutes.com is running on ASP.NET Web Pages and was written with WebMatrix so I used the NuGet GUI. You can tell that this package JUST got uploaded at the time of this writing as there's only 11 downloads!

Hanselminutes.com的网站在ASP.NET网页上运行,并使用WebMatrix编写,因此我使用了NuGet GUI。 您可以说,在撰写本文时,此软件包仅已上传,因为只有11个下载!

New Relic NuGet Package

Install this package and it'll lay down a few DLLS and your newrelic.config file. Go into the newrelic.config and copy in the license key from Connection Info (remember that? It's in the Azure Portal and pictured above) into the  config file. Also update your Application Name to some useful value as that's going to identify your site in the New Relic dashboard.

安装此软件包,它将放下一些DLLS和您的newrelic.config文件。 进入newrelic.config,然后将连接信息中的许可证密钥复制到配置文件中(请记住,它在Azure门户中,如上图所示)。 还要将您的应用程序名称更新为一些有用的值,以在New Relic仪表板中标识您的站点。

Here I am publishing my site up to Azure. Only the NewRelic agent dlls that I just NuGet'ed in to my app are being published (and a random jpg I forgot).

在这里,我将网站发布到Azure。 仅发布了我刚刚NuGet进入我的应用程序的NewRelic代理dll(以及我忘记的随机jpg)。

Publishing the New Relic Agent to Azure

Once I deployed the site and hit it, I could see Hanselminutes appear within the New Relic system.

部署站点并单击它后,我可以看到Hanselminutes出现在New Relic系统中。

Hanselminutes within NewRelic

Here's some of the data I could access now! I can see an updated graph of where my time is being spent, both server side AND browser side.

这是我现在可以访问的一些数据! 我可以看到在服务器端和浏览器端花费时间的更新图表。

I can see which pages load fast and which don't, and exactly why.

我可以看到哪些页面可以快速加载,哪些页面不能快速加载,以及为什么。

I can see SQL Queries and how long they took, what connections were opened...

我可以看到SQL查询以及它们花费了多长时间,打开了哪些连接...

And deep timelines showing not just where my time was spend in my application, but also where it was spent in the .NET Framework AND CLR itself!

深入的时间表不仅显示我的时间花在我的应用程序上的时间,而且还显示了它在.NET Framework和CLR本身上的时间!

Screenshot (50)

And of course, I can see Stack Traces of problems with my code.

当然,我可以看到代码问题的堆栈跟踪。

This just scratches the surface, really, but I'm stoked I was able to get the free New Relic tier setup on Azure Websites in just about 10 minutes. I found two spots where four SQL calls could possibly be collapsed into one. I also found a common (and dumb, on my part) ArgumentNullException that I'd been missing for weeks.

确实,这只是表面上的问题,但令我很激动的是,我能够在短短约10分钟的时间内在Azure网站上获得免费的New Relic层设置。 我发现有两个地方,四个SQL调用可能会合为一个。 我还发现了一个常见的(也是愚蠢的)ArgumentNullException,它已经消失了好几个星期了。

I'm pretty impressed with their offering. I think the Pro Tier is a little spendy for the small indie developer, but cheap for the pro dev. I'd like to see a $5 or $10 tier for small hobbyist sites but for now, Free is going to serve me very nicely.

他们的产品给我留下了深刻的印象。 我认为Pro Tier对于小型独立开发者来说有点花钱,但对专业开发者来说便宜。 我希望小型业余爱好者网站能获得$ 5或$ 10的费用,但是现在,Free可以很好地为我服务。

Now I'm going to go and instrument my other sites!

现在,我将去检测其他站点!

相关链接 (Related Links)

  • Penny Pinching in the Cloud: How to run a two day Virtual Conference for $10

    Penny Pinching in the Cloud:如何以10美元的价格运行为期两天的虚拟会议

  • Penny Pinching Video: Moving my Website's Images to the Azure CDN

    Penny Pinching视频:将我的网站的图像移动到Azure CDN

  • Penny Pinching Video: Moving an Azure Website between data centers

    Penny Pinching视频:在数据中心之间移动Azure网站

  • Streaming Diagnostics Trace Logging from the Azure Command Line (plus Glimpse!)

    从Azure命令行流式传输诊断跟踪日志(以及Glimpse!)

  • Pinching pennies when scaling in The Cloud

    在The Cloud中缩放时捏几分钱

翻译自: https://www.hanselman.com/blog/penny-pinching-in-the-cloud-enabling-new-relic-performance-monitoring-on-windows-azure-websites

梁斌penny

这篇关于梁斌penny_Penny Pinching在云中:在Windows Azure网站上启用新的文物性能监控的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!



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

相关文章

Vue3 的 shallowRef 和 shallowReactive:优化性能

大家对 Vue3 的 ref 和 reactive 都很熟悉,那么对 shallowRef 和 shallowReactive 是否了解呢? 在编程和数据结构中,“shallow”(浅层)通常指对数据结构的最外层进行操作,而不递归地处理其内部或嵌套的数据。这种处理方式关注的是数据结构的第一层属性或元素,而忽略更深层次的嵌套内容。 1. 浅层与深层的对比 1.1 浅层(Shallow) 定义

流媒体平台/视频监控/安防视频汇聚EasyCVR播放暂停后视频画面黑屏是什么原因?

视频智能分析/视频监控/安防监控综合管理系统EasyCVR视频汇聚融合平台,是TSINGSEE青犀视频垂直深耕音视频流媒体技术、AI智能技术领域的杰出成果。该平台以其强大的视频处理、汇聚与融合能力,在构建全栈视频监控系统中展现出了独特的优势。视频监控管理系统EasyCVR平台内置了强大的视频解码、转码、压缩等技术,能够处理多种视频流格式,并以多种格式(RTMP、RTSP、HTTP-FLV、WebS

性能测试介绍

性能测试是一种测试方法,旨在评估系统、应用程序或组件在现实场景中的性能表现和可靠性。它通常用于衡量系统在不同负载条件下的响应时间、吞吐量、资源利用率、稳定性和可扩展性等关键指标。 为什么要进行性能测试 通过性能测试,可以确定系统是否能够满足预期的性能要求,找出性能瓶颈和潜在的问题,并进行优化和调整。 发现性能瓶颈:性能测试可以帮助发现系统的性能瓶颈,即系统在高负载或高并发情况下可能出现的问题

性能分析之MySQL索引实战案例

文章目录 一、前言二、准备三、MySQL索引优化四、MySQL 索引知识回顾五、总结 一、前言 在上一讲性能工具之 JProfiler 简单登录案例分析实战中已经发现SQL没有建立索引问题,本文将一起从代码层去分析为什么没有建立索引? 开源ERP项目地址:https://gitee.com/jishenghua/JSH_ERP 二、准备 打开IDEA找到登录请求资源路径位置

综合安防管理平台LntonAIServer视频监控汇聚抖动检测算法优势

LntonAIServer视频质量诊断功能中的抖动检测是一个专门针对视频稳定性进行分析的功能。抖动通常是指视频帧之间的不必要运动,这种运动可能是由于摄像机的移动、传输中的错误或编解码问题导致的。抖动检测对于确保视频内容的平滑性和观看体验至关重要。 优势 1. 提高图像质量 - 清晰度提升:减少抖动,提高图像的清晰度和细节表现力,使得监控画面更加真实可信。 - 细节增强:在低光条件下,抖

黑神话,XSKY 星飞全闪单卷性能突破310万

当下,云计算仍然是企业主要的基础架构,随着关键业务的逐步虚拟化和云化,对于块存储的性能要求也日益提高。企业对于低延迟、高稳定性的存储解决方案的需求日益迫切。为了满足这些日益增长的 IO 密集型应用场景,众多云服务提供商正在不断推陈出新,推出具有更低时延和更高 IOPS 性能的云硬盘产品。 8 月 22 日 2024 DTCC 大会上(第十五届中国数据库技术大会),XSKY星辰天合正式公布了基于星

从状态管理到性能优化:全面解析 Android Compose

文章目录 引言一、Android Compose基本概念1.1 什么是Android Compose?1.2 Compose的优势1.3 如何在项目中使用Compose 二、Compose中的状态管理2.1 状态管理的重要性2.2 Compose中的状态和数据流2.3 使用State和MutableState处理状态2.4 通过ViewModel进行状态管理 三、Compose中的列表和滚动

在 Windows 上部署 gitblit

在 Windows 上部署 gitblit 在 Windows 上部署 gitblit 缘起gitblit 是什么安装JDK部署 gitblit 下载 gitblit 并解压配置登录注册为 windows 服务 修改 installService.cmd 文件运行 installService.cmd运行 gitblitw.exe查看 services.msc 缘起

速盾高防cdn是怎么解决网站攻击的?

速盾高防CDN是一种基于云计算技术的网络安全解决方案,可以有效地保护网站免受各种网络攻击的威胁。它通过在全球多个节点部署服务器,将网站内容缓存到这些服务器上,并通过智能路由技术将用户的请求引导到最近的服务器上,以提供更快的访问速度和更好的网络性能。 速盾高防CDN主要采用以下几种方式来解决网站攻击: 分布式拒绝服务攻击(DDoS)防护:DDoS攻击是一种常见的网络攻击手段,攻击者通过向目标网

Windows如何添加右键新建菜单

Windows如何添加右键新建菜单 文章目录 Windows如何添加右键新建菜单实验环境缘起以新建`.md`文件为例第一步第二步第三步 总结 实验环境 Windows7 缘起 因为我习惯用 Markdown 格式写文本,每次新建一个.txt后都要手动修改为.md,真的麻烦。如何在右键新建菜单中添加.md选项呢? 网上有很多方法,这些方法我都尝试了,要么太麻烦,要么不凑效