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

相关文章

从原理到实战解析Java Stream 的并行流性能优化

《从原理到实战解析JavaStream的并行流性能优化》本文给大家介绍JavaStream的并行流性能优化:从原理到实战的全攻略,本文通过实例代码给大家介绍的非常详细,对大家的学习或工作具有一定的... 目录一、并行流的核心原理与适用场景二、性能优化的核心策略1. 合理设置并行度:打破默认阈值2. 避免装箱

深度剖析SpringBoot日志性能提升的原因与解决

《深度剖析SpringBoot日志性能提升的原因与解决》日志记录本该是辅助工具,却为何成了性能瓶颈,SpringBoot如何用代码彻底破解日志导致的高延迟问题,感兴趣的小伙伴可以跟随小编一起学习一下... 目录前言第一章:日志性能陷阱的底层原理1.1 日志级别的“双刃剑”效应1.2 同步日志的“吞吐量杀手”

springboot2.1.3 hystrix集成及hystrix-dashboard监控详解

《springboot2.1.3hystrix集成及hystrix-dashboard监控详解》Hystrix是Netflix开源的微服务容错工具,通过线程池隔离和熔断机制防止服务崩溃,支持降级、监... 目录Hystrix是Netflix开源技术www.chinasem.cn栈中的又一员猛将Hystrix熔

Java慢查询排查与性能调优完整实战指南

《Java慢查询排查与性能调优完整实战指南》Java调优是一个广泛的话题,它涵盖了代码优化、内存管理、并发处理等多个方面,:本文主要介绍Java慢查询排查与性能调优的相关资料,文中通过代码介绍的非... 目录1. 事故全景:从告警到定位1.1 事故时间线1.2 关键指标异常1.3 排查工具链2. 深度剖析:

深入解析Java NIO在高并发场景下的性能优化实践指南

《深入解析JavaNIO在高并发场景下的性能优化实践指南》随着互联网业务不断演进,对高并发、低延时网络服务的需求日益增长,本文将深入解析JavaNIO在高并发场景下的性能优化方法,希望对大家有所帮助... 目录简介一、技术背景与应用场景二、核心原理深入分析2.1 Selector多路复用2.2 Buffer

基于Python Playwright进行前端性能测试的脚本实现

《基于PythonPlaywright进行前端性能测试的脚本实现》在当今Web应用开发中,性能优化是提升用户体验的关键因素之一,本文将介绍如何使用Playwright构建一个自动化性能测试工具,希望... 目录引言工具概述整体架构核心实现解析1. 浏览器初始化2. 性能数据收集3. 资源分析4. 关键性能指

SpringBoot监控API请求耗时的6中解决解决方案

《SpringBoot监控API请求耗时的6中解决解决方案》本文介绍SpringBoot中记录API请求耗时的6种方案,包括手动埋点、AOP切面、拦截器、Filter、事件监听、Micrometer+... 目录1. 简介2.实战案例2.1 手动记录2.2 自定义AOP记录2.3 拦截器技术2.4 使用Fi

Spring Boot Actuator应用监控与管理的详细步骤

《SpringBootActuator应用监控与管理的详细步骤》SpringBootActuator是SpringBoot的监控工具,提供健康检查、性能指标、日志管理等核心功能,支持自定义和扩展端... 目录一、 Spring Boot Actuator 概述二、 集成 Spring Boot Actuat

一文解密Python进行监控进程的黑科技

《一文解密Python进行监控进程的黑科技》在计算机系统管理和应用性能优化中,监控进程的CPU、内存和IO使用率是非常重要的任务,下面我们就来讲讲如何Python写一个简单使用的监控进程的工具吧... 目录准备工作监控CPU使用率监控内存使用率监控IO使用率小工具代码整合在计算机系统管理和应用性能优化中,监

Zabbix在MySQL性能监控方面的运用及最佳实践记录

《Zabbix在MySQL性能监控方面的运用及最佳实践记录》Zabbix通过自定义脚本和内置模板监控MySQL核心指标(连接、查询、资源、复制),支持自动发现多实例及告警通知,结合可视化仪表盘,可有效... 目录一、核心监控指标及配置1. 关键监控指标示例2. 配置方法二、自动发现与多实例管理1. 实践步骤