<?xml version="1.0" encoding="UTF-8"?> <rss
version="2.0"
xmlns:content="http://purl.org/rss/1.0/modules/content/"
xmlns:wfw="http://wellformedweb.org/CommentAPI/"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:atom="http://www.w3.org/2005/Atom"
xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
><channel><title>New Relic blog</title> <atom:link href="http://blog.newrelic.com/feed/" rel="self" type="application/rss+xml" /><link>http://blog.newrelic.com</link> <description>Application Performance Management</description> <lastBuildDate>Wed, 16 May 2012 16:25:56 +0000</lastBuildDate> <language>en</language> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <generator>http://wordpress.org/?v=3.3.2</generator> <item><title>It’s All in the Timing: How to Use the Navigation Timing Specification to Improve Web Performance</title><link>http://blog.newrelic.com/2012/05/16/its-all-in-the-timing-how-to-use-the-navigation-timing-specification-to-improve-web-performance/</link> <comments>http://blog.newrelic.com/2012/05/16/its-all-in-the-timing-how-to-use-the-navigation-timing-specification-to-improve-web-performance/#comments</comments> <pubDate>Wed, 16 May 2012 14:00:27 +0000</pubDate> <dc:creator>Leigh Shevchik</dc:creator> <category><![CDATA[Performance Tech Tips]]></category> <category><![CDATA[Performance Tuning]]></category> <category><![CDATA[Top Post]]></category><guid
isPermaLink="false">http://blog.newrelic.com/?p=10255</guid> <description><![CDATA[This post is written by Darin Wright. Darin is a Principal Software Engineer at New Relic who works on all things related to RUM &#8212; collecting, aggregating, persisting, and presenting end user metrics. The Navigation Timing Specification is a JavaScript API detailing the timing information of a page load. Available in most newer browsers (including [...]]]></description> <content:encoded><![CDATA[<p><em>This post is written by Darin Wright. Darin is a Principal Software Engineer at New Relic who works on all things related to RUM &#8212; collecting, aggregating, persisting, and presenting end user metrics.</em></p><p>The <a
title="Navigation Timing Specification" href="http://www.w3.org/TR/navigation-timing/" target="_blank">Navigation Timing Specification</a> is a JavaScript API detailing the timing information of a page load. Available in most newer browsers (including IE 9, Chrome, and Firefox 10+), it helps developers test user experiences remotely and easily, and quickly optimize their websites and web apps for different types of users. We’ve recently started to leverage the API more heavily in our <a
title="Real User Monitoring" href="http://newrelic.com/features/real-user-monitoring" target="_blank">Real User Monitoring </a>(RUM) feature. RUM captures a few key points in time in order to aggregate page load times:</p><p
style="padding-left: 30px;">* Navigation Start: When the user begins a navigation to a new page<br
/> * First Byte: When the requested page returns to the browser<br
/> * DOM Ready: When the page has been parsed into a DOM<br
/> * Page Ready: When the page has completed loading</p><p>In browsers that don’t implement the Navigation Timing specification, navigation start time is captured as a user exits the previous page (via the beforeunload event,) and written to a cookie. The value is read from the cookie as the next page loads. When the requested page arrives back in the browser, RUM estimates the first byte time via the execution of the RUM header (JavaScript injected into the top of a page) and DOM ready via execution of the RUM footer (injected into the bottom of the page.) The page ready time is captured via the window onload event.</p><p>However when a browser implements the Navigation Timing specification, RUM can get the timing information directly from the browser – without having to rely on cookies or the header and footer execution for estimates. You should notice that the RUM footer is still required for context information (account and application identifiers, host to report to, web transaction name, etc.)</p><p>Perhaps the most notable difference in the end result of the two measurement techniques is the relative breakdown of DOM processing and network time. Essentially, the traditional estimation of first byte time is late since it relies on the execution of the JavaScript header. The deeper into a page the header is positioned, the later the estimation becomes. However, overall page load times remain similar. The following diagram shows what happened to our site’s response time breakdown as we flipped the switch to use navigation timing data. We saw that network time shrinks, DOM processing time increases, and the overall response time remains the same.</p><p
style="text-align: center;"><a
href="http://blog.newrelic.com/wp-content/uploads/browser_page_load_time1.png"><img
class="aligncenter  wp-image-10263" title="browser_page_load_time" src="http://blog.newrelic.com/wp-content/uploads/browser_page_load_time1.png" alt="Browser Page Load Time" width="631" height="347" /></a></p><p>Of course, the degree of change in a site’s aggregate page load breakdown will depend on how many browsers on the site support the Navigation Timing specification.</p><p>RUM builds more detailed browser traces from navigation timing data. The DOM processing segment found in standard traces is now broken into DOM loading and interactive segments. These reflect the document’s ready state. In addition to the traditional queue, web application, network and page rendering time segments, and traces built from navigation timing data may contain time spent in redirects, cache lookup, DNS, TCP, SSL, and reading the response off the network (when non-zero).</p><p
style="text-align: center;"><a
href="http://blog.newrelic.com/wp-content/uploads/performance_for_this_trace.png"><img
class="aligncenter  wp-image-10260" style="margin-top: 10px; margin-bottom: 10px;" title="performance_for_this_trace" src="http://blog.newrelic.com/wp-content/uploads/performance_for_this_trace.png" alt="Performance for this Trace" width="631" height="141" /></a></p><p
style="text-align: left;">Remember RUM will continue to work in all browsers with both measuring techniques. Over time, we expect that more and more browsers will implement the Navigation Timing specification. This will simplify your data collection and provide you with a more detailed view of end user response times.</p> ]]></content:encoded> <wfw:commentRss>http://blog.newrelic.com/2012/05/16/its-all-in-the-timing-how-to-use-the-navigation-timing-specification-to-improve-web-performance/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Case Study: Code School Rocks with New Relic</title><link>http://blog.newrelic.com/2012/05/15/case-study-code-school-rocks-with-new-relic/</link> <comments>http://blog.newrelic.com/2012/05/15/case-study-code-school-rocks-with-new-relic/#comments</comments> <pubDate>Tue, 15 May 2012 15:00:44 +0000</pubDate> <dc:creator>Leigh Shevchik</dc:creator> <category><![CDATA[Case Study]]></category> <category><![CDATA[Company News]]></category> <category><![CDATA[Performance Tech Tips]]></category><guid
isPermaLink="false">http://blog.newrelic.com/?p=10248</guid> <description><![CDATA[We’ve said it before and we’ll say it again: We &#60;3 it when customers write their own case studies. As a company, there’s nothing more enjoyable than finding out how our customers use New Relic and then watching them share their experiences with the world. Every time this happens, we learn something new and are [...]]]></description> <content:encoded><![CDATA[<p><a
href="http://blog.newrelic.com/wp-content/uploads/codeschool_logo.png"><img
class="alignleft  wp-image-10317" style="margin-top: 5px; margin-bottom: 5px; margin-left: 10px; margin-right: 10px;" title="codeschool_logo" src="http://blog.newrelic.com/wp-content/uploads/codeschool_logo.png" alt="Code School logo" width="301" height="80" /></a>We’ve said it before and we’ll say it again: We &lt;3 it when customers write their own case studies. As a company, there’s nothing more enjoyable than finding out how our customers use New Relic and then watching them share their experiences with the world. Every time this happens, we learn something new and are reminded of who we&#8217;re working for.</p><p>Last week, our friends at <a
title="Code School" href="http://www.codeschool.com/" target="_blank">Code School</a> shared a video describing how they use New Relic in their environment. The interactive learning company relies on many of New Relic’s features to deliver high quality user experiences to its customers. See how in this video case study:</p><p><iframe
name="wistia_embed" src="http://fast.wistia.com/embed/iframe/6b0bb16c5e?version=v1&amp;videoWidth=640&amp;videoHeight=360&amp;controlsVisibleOnLoad=true" frameborder="0" scrolling="no" width="528" height="298"></iframe></p> ]]></content:encoded> <wfw:commentRss>http://blog.newrelic.com/2012/05/15/case-study-code-school-rocks-with-new-relic/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Community New: Best Practices for Using New Relic with Engine Yard and More</title><link>http://blog.newrelic.com/2012/05/14/community-new-best-practices-for-using-new-relic-with-engine-yard-and-more/</link> <comments>http://blog.newrelic.com/2012/05/14/community-new-best-practices-for-using-new-relic-with-engine-yard-and-more/#comments</comments> <pubDate>Mon, 14 May 2012 17:32:28 +0000</pubDate> <dc:creator>Leigh Shevchik</dc:creator> <category><![CDATA[Partners]]></category> <category><![CDATA[Performance Tech Tips]]></category> <category><![CDATA[Top Post]]></category><guid
isPermaLink="false">http://blog.newrelic.com/?p=10271</guid> <description><![CDATA[In this week’s community news, we get best practices of using New Relic with Engine Yard, find out how O’Reilly gave the Velocity website a makeover and more. * Engine Yard shares best practices for using New Relic with your Engine Yard Cloud or Managed account. * Code School shows how they use New Relic to [...]]]></description> <content:encoded><![CDATA[<p>In this week’s community news, we get best practices of using New Relic with Engine Yard, find out how O’Reilly gave the Velocity website a makeover and more.</p><p
style="padding-left: 30px;">* Engine Yard <a
title="New Relic Best Practices (Engine Yard)" href="https://support.cloud.engineyard.com/entries/21382793-new-relic-best-practices" target="_blank">shares best practices</a> for using New Relic with your Engine Yard Cloud or Managed account.</p><p
style="padding-left: 30px;">* Code School shows how they <a
title="How We Use New Relic at Code School" href="http://vimeo.com/41869765" target="_blank">use New Relic</a> to deliver a high quality user experience to their customers.</p><p
style="padding-left: 30px;">* O’Reilly describes how they <a
title="Giving the Velocity Website a Performance Makeover" href="http://radar.oreilly.com/2012/05/velocity-performance-makeover.html" target="_blank">gave the Velocity website</a> a performance makeover.</p><p
style="padding-left: 30px;">* Joshua Bixby gives <a
title="When Good Frontend Optimization Goes Bad: How to Make Sure Your Site Tests Well and Looks Good" href="http://www.webperformancetoday.com/2012/05/08/bad-front-end-web-performance-optimizatio/" target="_blank">best practices for making sure your frontend optimizations perform</a> as well as they test.</p><p
style="padding-left: 30px;">* Sastry Malladi of eBay <a
title="Dealing with Performance Challenges – Optimized Data Formats" href="http://www.infoq.com/presentations/Dealing-with-Performance-Challenges-Optimized-Data-Formats" target="_blank">discusses the performance implications</a> of using various data formats and versioning.</p><p
style="padding-left: 30px;">* HP <a
title="HP Opens Up Public Cloud to Public Beta" href="http://www.theregister.co.uk/2012/05/10/hp_public_cloud_beta/" target="_blank">opens the public beta</a> of their HP Cloud Services public cloud.</p><p
style="padding-left: 30px;">* Find out how <a
title="Startups Are Creating a New System of the World for IT" href="http://highscalability.com/blog/2012/5/7/startups-are-creating-a-new-system-of-the-world-for-it.html" target="_blank">startups are creating a new system of the world for IT</a>.</p><p
style="padding-left: 30px;">* New Relic engineer Jose Fernandez shares his <a
title="http://www.productionhacks.com/2012/05/06/my-third-attempt-at-vim/" href="http://www.productionhacks.com/2012/05/06/my-third-attempt-at-vim/" target="_blank">experiences switching to Vim</a>.</p> ]]></content:encoded> <wfw:commentRss>http://blog.newrelic.com/2012/05/14/community-new-best-practices-for-using-new-relic-with-engine-yard-and-more/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>How We Tune Our Own App Using RUM Data</title><link>http://blog.newrelic.com/2012/05/10/how-we-tune-our-own-app-using-rum-data/</link> <comments>http://blog.newrelic.com/2012/05/10/how-we-tune-our-own-app-using-rum-data/#comments</comments> <pubDate>Thu, 10 May 2012 15:00:40 +0000</pubDate> <dc:creator>Brent Miller</dc:creator> <category><![CDATA[Performance Tech Tips]]></category> <category><![CDATA[Performance Tuning]]></category> <category><![CDATA[Real User Monitoring]]></category> <category><![CDATA[New Relic RUM]]></category><guid
isPermaLink="false">http://blog.newrelic.com/?p=9986</guid> <description><![CDATA[Around here we drink our own champagne and we use New Relic to tune New Relic. We recently set some fairly aggressive performance standards for ourselves by lowering our end user Apdex-T value to 2.4 seconds, which is rather fast. We&#8217;re saying that our users expect our pages to load in 2.4 seconds or less. Our [...]]]></description> <content:encoded><![CDATA[<p>Around here we drink our own champagne and we use <a
title="New Relic" href="http://www.newrelic.com" target="_blank">New Relic</a> to tune New Relic. We recently set some fairly aggressive performance standards for ourselves by lowering our end user Apdex-T value to 2.4 seconds, which is rather fast. We&#8217;re saying that our users expect our pages to load in 2.4 seconds or less. Our Apdex score immediately took a dive below 0.8. We&#8217;re currently working on bringing that back up to 0.95 or higher. Here&#8217;s how I used our Real User Monitoring (RUM) data to get closer to meeting that goal.</p><p>Where do you start?</p><p>As web developers, we tend to be really good at thinking about how to tune our server-side code. But our users don&#8217;t care about how fast our servers are. They care about how fast their pages load. That&#8217;s a challenge for us &#8212; we have to start thinking about end-to-end transaction times and work on optimizing in-browser. With RUM data, that&#8217;s easy to do, but many developers are unfamiliar with how to start approaching the problem.</p><p>When tackling an optimization problem like this, I start on the end user transactions overview. If I&#8217;m lucky, I&#8217;ll find some low-hanging fruit. Looking at the data for our app, here is what I found:</p><p
style="text-align: center;"><img
class="aligncenter  wp-image-10013" style="margin: 10px;" src="http://blog.newrelic.com/wp-content/uploads/transactions_before_tuning.jpg" alt="73% of total page load time spent on one page" width="638" height="305" /></p><p>It looks that, of all of the time spent loading pages, across all of our users, 73% was spent in one place! That&#8217;s some juicy low-hanging fruit.</p><p>PublicAccess::ChartsController#show is the page that renders when a user views an embedded chart. Many of our customers love the embedded charts and use them a lot. So I&#8217;m not surprised that it&#8217;s on this list. But the embedded chart is a very small page. It&#8217;s just a chart with a title. How could it be taking that much of the total end user time? And more importantly, how can I tune it?</p><p>The drilldown chart to the right shows me where this page is spending its time. The biggest chunk of time is spent <a
title="Net Lag: The Fallacy of Zero Latency and the Web" href="http://blog.newrelic.com/2012/01/18/net-lag-the-fallacy-of-zero-latency-and-the-web/" target="_blank">in transit over the network which is no surprise</a>. DOM processing time is the second offender. This is true for the aggregate data; let&#8217;s see if it applies to the worst offenders.</p><p><span
style="font-size: 1.25em;"><strong>How bad does it get?</strong></span><br
/> Scrolling down on the transaction drilldown, I get links to some browser traces. These are individual requests that had really bad performance. Let&#8217;s take a look at one of them.</p><p
style="text-align: center;"><a
href="http://blog.newrelic.com/wp-content/uploads/Browser-Trace-RPM-UI-New-Relic.jpg"><img
class="aligncenter  wp-image-10015" style="margin: 10px;" src="http://blog.newrelic.com/wp-content/uploads/Browser-Trace-RPM-UI-New-Relic-1024x425.jpg" alt="Browser trace screenshot" width="717" height="298" /></a></p><p>An 8 second page load for a page that consists of a single chart!?! This needs some help. But look at that DOM processing time! It&#8217;s over 5 seconds! That&#8217;s awful. Let&#8217;s see what we can do with it.</p><p><span
style="font-size: 1.25em;"><strong>What is DOM processing?</strong></span><br
/> In order to tune this transaction, it helps to understand what DOM processing really is. It&#8217;s the time spent by the browser parsing the HTML and JavaScript, and applying CSS rules. If you have any script tags in the body of your document, their execution is part of DOM processing. In order to figure out what&#8217;s going on with this page, we need to open it up with either <a
title="Get Firebug!" href="http://getfirebug.com/" target="_blank">Firebug</a> or the <a
title="Webkit Developer Tools" href="http://www.webkit.org/building/tools.html" target="_blank">Webkit Developer Tools</a> and look at the asset waterfall. Here&#8217;s what that looks like for a random embedded chart:</p><p>&nbsp;</p><p
style="text-align: center;"><a
href="http://blog.newrelic.com/wp-content/uploads/waterfall_before_tuning.jpg"><img
class="aligncenter  wp-image-10021" style="margin: 10px;" src="http://blog.newrelic.com/wp-content/uploads/waterfall_before_tuning.jpg" alt="Waterfall Before Tuning" width="593" height="557" /></a></p><p>There&#8217;s a lot going on in here. Let&#8217;s look at the most important points:</p><p
style="padding-left: 30px;">1. We&#8217;re serving 165KB of minified JavaScript and 29KB of minified CSS. That&#8217;s a lot of code!<br
/> 2. It&#8217;s taking 1.59 seconds for the RUM timing to end (the vertical red line, which is the body.onload event.)<br
/> 3. We&#8217;re loading the chart data as part of the RUM time (see the data.json line.)</p><p>Now we&#8217;ve got some actionable data to use. Let&#8217;s start tuning!</p><p><span
style="font-size: 1.25em;"><strong>Tuning the page</strong></span><br
/> It looks like there are two simple things we can do to tune this page: reducing the size of our JavaScript and CSS, which will reduce download and parsing times, and also deferring the chart data.json call until after the body.onload event.</p><p><span
style="font-size: 1em;"><strong>CSS tuning</strong></span><br
/> On the backend, we use <a
title="Sass: Making CSS Fun Again" href="http://sass-lang.com/" target="_blank">Sass</a> to write our CSS. We&#8217;ve got our SCSS source files fairly well split up. At deploy time we generate the full CSS, concatenate the files and minify them into the CSS files that we actually serve. Looking at the CSS bundle we were using for this page, we had already thrown out a bunch of the component files. Our sitewide layout, grid structure and form styles were already gone. But looking at what was left, I found that we had a full copy of the CSS required to style all of the site-wide UI widgets we use. That includes charts, but also things like the recent events list, data tables, and all kinds of other stuff.</p><p>Since this page is serving embedded charts, I know that I only need the styles for charts and nothing else. So I pulled out the chart-specific CSS and threw it into another file. Then, the CSS for this page could just use the chart-specific CSS and not anything else. That&#8217;s a win.</p><p><span
style="font-size: 1em;"><strong>JavaScript tuning</strong></span><br
/> Now it was time to tackle the JavaScript. Similarly to our CSS, we use <a
title="Jammit: Industrial strength asset packaging for Rails" href="https://github.com/documentcloud/jammit" target="_blank">Jammit</a> to package up and minify the JavaScript code. I took a look at what was included in the JS bundle for this page, and I found a few things. First, we have a <strong>lot</strong> of code required to handle the charting system. There&#8217;s a full copy of <a
title="jQuery, the standard library for cross-browser DOM manipulation" href="http://jquery.com" target="_blank">jQuery</a>, a copy of <a
title="Highcharts.js: a kick-ass charting system" href="http://www.highcharts.com/" target="_blank">Highcharts.js</a>, some utility functions for handling banner messages, code for embedding Flash (since some of our charts are Flash, like our maps), the JavaScript for the <a
title="Flash and HTML5 charts" href="http://www.fusioncharts.com/" target="_blank">Flash-based charting library</a> we use when our users&#8217; browsers don&#8217;t support Highcharts, and then the kicker: a full copy of <a
title="jQueryUI: a fantastic but large library for building UI widgets" href="http://jqueryui.com" target="_blank">jQuery UI</a>.</p><p>Wow. Our little embedded charts page had all the code necessary for rendering accordion and calendar UI widgets, performing drag and drop operations, and all of the other goodies that jQuery UI provides. That seems like a bit much, doesn&#8217;t it?</p><p>A little investigation revealed that our wrapper system for Highcharts was a jQuery widget that depended on jQuery UI&#8217;s widget generation code. And so we&#8217;d included the whole library. In a few minutes I&#8217;d built a custom version of jQuery UI that only contained the widget generation code, and swapped that out for the full jQuery UI code.</p><p><span
style="font-size: 1.25em;"><strong>Event tuning</strong></span><br
/> The last thing to work on is the ordering of events. We&#8217;re loading the chart before the body.onload, but it doesn&#8217;t really need to happen that early. We can defer it for a bit and users will still feel that the page is snappy. We do what most jQuery users do and wrap all of our JS in the following pattern:</p><p><pre>jQuery(function($) {
  // do stuff here, like load a chart
});</pre><p>This is shorthand for the following:</p><pre>jQuery(document).ready(function($) {
  // do stuff here, like load a chart
});</pre></p><p>The business code here is attached to the document.ready event. This is a jQuery-specific event that&#8217;s closely tied to the DOMReady event. It fires when the DOM has been loaded. Once all of the JS that&#8217;s attached to the document.ready event has run, the browser will fire off the body.onload event, and the RUM timing will stop.</p><p>Looking at our chart loading code, we were following this pattern. I changed it around a bit, to this:</p><p><pre>jQuery(body).load(function() {
  // do stuff here, like load a chart
});</pre></p><p>This simple change deferred all chart loads, site-wide, until after the body.onload event.</p><p><span
style="font-size: 1em;"><strong>Results</strong></span><br
/> Let&#8217;s see what our page load looks like now that the CSS and JavaScript have been tuned, and we&#8217;ve changed our event sequencing a bit.</p><p
style="text-align: center;"><a
href="http://blog.newrelic.com/wp-content/uploads/waterfall_after_tuning.jpg"><img
class="aligncenter  wp-image-10027" style="margin: 10px;" src="http://blog.newrelic.com/wp-content/uploads/waterfall_after_tuning.jpg" alt="Screenshot of the waterfall chart" width="593" height="557" /></a></p><p
style="text-align: left;">This looks a lot better! Once again, let me point out the important features:</p><p
style="padding-left: 30px;">1. Our JavaScript is down 67KB (41%) to 98KB, and our CSS is down an order of magnitude (91%) from 26KB to 2.5KB.<br
/> 2. The chart data load is happening after the body.onload event, so our timing stops earlier.<br
/> 3. It looks like we&#8217;ve shaved a half a second off of the page load time</p><p
style="text-align: left;">This is great! But we&#8217;re not really sure how this is going to affect us in production yet. Comparing individual page loads, like this waterfall to the previous one, isn&#8217;t a great comparison. If you hit refresh a few times you&#8217;ll see that page load times can vary quite a bit. So I&#8217;m not ready to trust my half-second speed boost yet.</p><p><span
style="font-size: 1.25em;"><strong>Production effects</strong></span><br
/> The proof, as they say, is in the pudding. Let&#8217;s deploy our changes and see what happens. Thankfully at New Relic that happens relatively frequently, so my code was released 24 hours after I made my changes.</p><p
style="text-align: left;">First stop: the RUM web page view for our transaction:</p><p
style="text-align: center;"><a
href="http://blog.newrelic.com/wp-content/uploads/embedded_chart_post_tuning.jpg"><img
class="aligncenter  wp-image-10141" style="margin: 10px;" src="http://blog.newrelic.com/wp-content/uploads/embedded_chart_post_tuning.jpg" alt="Embedded Chart Post Tuning" width="741" height="329" /></a></p><p>The two vertical lines are two successive deploys. The first deploy released the optimizations we made. You can ignore the second one &#8212; we had a minor regression in the first deploy, unrelated to the optimizations, that we patched.</p><p>It looks like we really did shave a half a second off of the page load times! And that half-second came out of the DOM processing time, which is exactly where we expected it to come from. Excellent! So far my expectations have been met.</p><p>By constraining the time window to a post-deploy only view, which I&#8217;m not showing, I saw that the transaction&#8217;s contribution to the total page load time is down from 73%, to 56%. That&#8217;s a great win. It&#8217;s still 56% though, which is largely due to the number of hits it gets. So there might be some more tuning to be done later. But that&#8217;s for later. For now, I want to quantify the effect of the tuning we did.</p><p
style="text-align: left;">I&#8217;ll bet that our tuning had site-wide effects for two reasons. First, this one transaction is still taking up a significant proportion of the total page load time. Second, when we deferred the chart loading until after the body.onload event, we affected every chart loaded on our site.</p><p
style="text-align: left;">Here&#8217;s a chart showing our sitewide RUM performance:</p><p
style="text-align: center;"><a
href="http://blog.newrelic.com/wp-content/uploads/sitewide_rum_post_deploy.jpg"><img
class="aligncenter  wp-image-10140" style="margin: 10px;" src="http://blog.newrelic.com/wp-content/uploads/sitewide_rum_post_deploy.jpg" alt="Sitewide RUM Post Deploy" width="740" height="277" /></a></p><p
style="text-align: left;">The good news: our optimizations had a site-wide effect! It looks like we shaved <em>almost</em> a half-second off of the site-wide page load time. The embedded charts page gets a lot of traffic, so tuning it gave us a lot of bang for the buck. If you look closely at the Apdex chart, you&#8217;ll see that we improved our Apdex score by almost 5 points!</p><p><span
style="font-size: 1.25em;"><strong>Conclusions</strong></span><br
/> All in all, the tuning work took only a couple of hours. I was lucky that we had some very low hanging fruit to work with, so I was able to get a lot of bang for only a little buck. It&#8217;s rare that a single web page has such a strong effect on site-wide performance. However even if you don&#8217;t have that advantage, you may still be able to make some big strides in tuning your end user performance.</p><p><span
style="font-size: 1em;"><strong>Look for site-wide problems</strong></span><br
/> The biggest wins we had came from removing excess JavaScript and deferring the chart loading. These tuning patterns weren&#8217;t all that specific to the one transaction we worked on. They&#8217;re patterns that you can apply everywhere. Let&#8217;s look at what you can do with your site.</p><p><span
style="font-size: 1em;"><strong>Reduce the amount of code</strong></span><br
/> It&#8217;s all too tempting with modern tools like <a
title="Industrial strength asset packaging for Rails" href="https://github.com/documentcloud/jammit" target="_blank">Jammit</a> or <a
title="Asset packaging for Rails" href="https://github.com/sstephenson/sprockets" target="_blank">Sprockets</a> to package up all of your JavaScript into a single file for download. This can be problematic for several reasons:</p><p
style="padding-left: 30px;">1. Too large JavaScript files aren&#8217;t cached on mobile devices, so they&#8217;ll be loaded on every page request by your slowest users.<br
/> 2. Even if it is cached, all of the JavaScript has to be processed on each request. Some browsers are more clever about this than others and cache the parsed JavaScript code. But as developers we can&#8217;t rely on the browsers to do the right thing. With the explosion of devices and alternatives we&#8217;ve seen in the past couple of years, assumptions about how browsers do things are dangerous.</p><p
style="text-align: left;">By serving JavaScript conditionally, you&#8217;re adding an asset request (or more) to every page load, and you&#8217;re decreasing in-browser cache hit rates for your JavaScript assets. But there&#8217;s a much bigger win to be had by reducing the amount of JavaScript that needs processing on each page load. <strong>The fastest code is code that doesn&#8217;t exist.</strong> Coincidentally, it also has no bugs.</p><p
style="text-align: left;">There are two extremes here &#8212; a single, monolithic JavaScript file versus a single file for each page you serve. You&#8217;ll have to find the balance between those two, and that will completely depend on your site&#8217;s architecture. A single page load <a
title="Backbone.js" href="http://backbonejs.org/" target="_blank">Backbone.js</a> app will want a monolithic file; a more traditional web application will want more than that.</p><p
style="text-align: left;">Similar arguments apply to your CSS rules. By splitting up your CSS and removing CSS code from each page load, you&#8217;re making the application of rules to each and every DOM element that much faster. <strong>Lean and mean is the way to go.</strong></p><p><span
style="font-size: 1em;"><strong>Don&#8217;t be afraid to re-define what &#8220;page loaded&#8221; means: it&#8217;s about users</strong></span><br
/> The deferral of chart loading to after the body.onload event can be seen as sleight of hand. We simply moved the chart loading time outside of the RUM timer&#8217;s domain. It seems like that might be dishonest, like we&#8217;re cheating on our numbers, but we&#8217;re really not.</p><p>The RUM timer stops when the browser has rendered and the user is able to interact with the page. For our site, as chart-heavy as it is, that can occur before the charts have loaded. Users can orient themselves to the page, and start looking at summary metrics that are displayed outside the charts. Think about the humans using our site. Do they need the charts to start interacting with a page? No. Will the half-second it takes for the charts to load be noticed? Yes, but just barely. For the humans concerned, they feel as if the page has loaded when they can see the charts&#8217; loading bars, so let&#8217;s use that perception to drive our tuning, and defer the chart loading. <strong>The body.onload should fire at the moment the user can start extracting meaning from the page.</strong> It&#8217;s up to you to decide what that means, and adjust your JavaScript code accordingly.</p><p><span
style="font-size: 1.25em;"><strong>Performance matters!</strong></span><br
/> Lastly, don&#8217;t forget that performance matters to your users. They don&#8217;t want to wait for your content: they want to engage with your content. Give &#8216;em what they want, when they want it and you&#8217;ll have happy users.</p><p><span
style="font-size: 1.25em;"><strong>Happy tuning!</strong></span></p> ]]></content:encoded> <wfw:commentRss>http://blog.newrelic.com/2012/05/10/how-we-tune-our-own-app-using-rum-data/feed/</wfw:commentRss> <slash:comments>3</slash:comments> </item> <item><title>New Relic Is Now Available As Part of HP Cloud Services</title><link>http://blog.newrelic.com/2012/05/10/new-relic-is-now-available-as-part-of-hp-cloud-services/</link> <comments>http://blog.newrelic.com/2012/05/10/new-relic-is-now-available-as-part-of-hp-cloud-services/#comments</comments> <pubDate>Thu, 10 May 2012 14:45:28 +0000</pubDate> <dc:creator>Leigh Shevchik</dc:creator> <category><![CDATA[Cloud Computing]]></category> <category><![CDATA[Company News]]></category> <category><![CDATA[Partners]]></category> <category><![CDATA[Top Post]]></category><guid
isPermaLink="false">http://blog.newrelic.com/?p=10083</guid> <description><![CDATA[This morning we announced that New Relic is now available as a part of HP Cloud Services, Hewlett-Packards’ public cloud services. Now HP Cloud Services customers can use New Relic Standard free of charge to monitor, troubleshoot and tune their next generation web applications. Available as a public beta, HP Cloud Services enables developers to [...]]]></description> <content:encoded><![CDATA[<p><a
href="http://blog.newrelic.com/wp-content/uploads/hpcloud_logo.jpeg"><img
class="alignleft  wp-image-10096" style="margin-top: 5px; margin-bottom: 5px;" title="hpcloud_logo" src="http://blog.newrelic.com/wp-content/uploads/hpcloud_logo.jpeg" alt="HP Cloud logo" width="256" height="64" /></a>This morning we announced that New Relic is now available as a part of <a
title="HP Cloud Services" href="http://hpcloud.com/" target="_blank">HP Cloud Services</a>, Hewlett-Packards’ public cloud services. Now HP Cloud Services customers can use New Relic Standard free of charge to monitor, troubleshoot and tune their next generation web applications.</p><p>Available as a public beta, HP Cloud Services enables developers to build the next generation of web applications and changes the economics of deploying modernized applications. It offers enterprises a single-sourced hybrid delivery solution that spans traditional as well as private, managed and public clouds.</p><p>“As more and more organizations migrate their business-critical applications to the cloud, it’s critical that we partner with trusted leaders to provide our joint customers with effective tools for identifying and resolving potential application performance issues through the stack, from the end user down to the application line of code,” said <a
title="Bill Lapcevic's Twitter account" href="https://twitter.com/#!/billlap" target="_blank">Bill Lapcevic</a>, VP of Business Development at New Relic. “Having this essential capability makes it easier for teams to ensure their apps are delivering the highest standard of application performance and availability.”</p><p>To start using New Relic with HP Cloud Services today, go to <a
title="http://newrelic.com/about/partners/hpcloud" href="http://newrelic.com/about/partners/hpcloud" target="_blank">http://newrelic.com/about/partners/hpcloud</a>.</p> ]]></content:encoded> <wfw:commentRss>http://blog.newrelic.com/2012/05/10/new-relic-is-now-available-as-part-of-hp-cloud-services/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Getting Started with Drupal: Building Blocks</title><link>http://blog.newrelic.com/2012/05/09/getting-started-with-drupal-building-blocks/</link> <comments>http://blog.newrelic.com/2012/05/09/getting-started-with-drupal-building-blocks/#comments</comments> <pubDate>Wed, 09 May 2012 15:00:23 +0000</pubDate> <dc:creator>Leigh Shevchik</dc:creator> <category><![CDATA[Performance Tech Tips]]></category> <category><![CDATA[Top Post]]></category><guid
isPermaLink="false">http://blog.newrelic.com/?p=9533</guid> <description><![CDATA[This is the first of two posts in the series Getting Started with Drupal, by guest writer Tobias Sjösten. Tobias is a web technician and open source aficionado who specializes in the LAMP stack, with Symfony and Drupal being especially close to his heart. He writes code in Vim, plays MUDs in gnome-terminal and naturally believes [...]]]></description> <content:encoded><![CDATA[<p><em>This is the first of two posts in the series Getting Started with Drupal, by guest writer </em><a
title="Tobias Sjösten" href="http://vvv.tobiassjosten.net/" target="_blank"><em>Tobias </em><em>Sjösten</em></a><em>. Tobias is a web technician and open source aficionado who specializes in the LAMP stack, with </em><a
title="Symfony" href="http://symfony.com/" target="_blank"><em>Symfony</em></a><em> and </em><a
title="Drupal" href="http://drupal.org/" target="_blank"><em>Drupal</em></a><em> being especially close to his heart. He writes code in Vim, plays MUDs in gnome-terminal and naturally believes a well-configured text interface trumps its graphical equivalent any day of the week.</em></p><p>If you’re working on anything web related, it’s virtually impossible to miss the Drupal invasion of the past few years. Drupal is a PHP-based, open source platform built by thousands of passionate developers from all over the world. Known as a Content Management System (CMS), Drupal excels at creating websites, blogs and intranets. But it can also be used for so much more. Today, Drupal powers a <a
title="Usage statistics and market share of Drupal for websites article" href="http://w3techs.com/technologies/details/cm-drupal/all/all" target="_blank">whopping 2% of all the sites in the world</a>, including some major installations like <a
title="The Economist" href="http://www.economist.com/" target="_blank">The Economist</a>, <a
title="MTV" href="http://www.mtv.com/" target="_blank">MTV</a> and <a
title="The White House" href="http://www.whitehouse.gov/" target="_blank">the White House</a>.</p><p>A popular slogan in Drupal-land is <em>“come for the software, stay for the community.” </em>This speaks volumes about just how inclusive the community is. <a
title="Drupal.org" href="http://drupal.org/" target="_blank">Drupal.org</a> has over 648,000 user accounts and 10,000 developer accounts. And as of March 2012, there are more that 15,648 community-contributed add-ons (contrib modules) that are available to customize Dupal’s behavior and appearance, add new features, or alter and extend its core capabilities. The last <a
title="DrupalCon" href="http://denver2012.drupal.org/" target="_blank">DrupalCon</a> in Denver gathered <a
title="DrupalCon attendees" href="http://www.flickr.com/photos/drupalassoc/6871520310/lightbox/" target="_blank">over 3,000 attendees</a>.</p><p>Learning to develop in Drupal has a steep learning curve. I believe this is because it does things very differently than other systems. While this can be challenging to an experienced developer, there are numerous resources to learn from. And I hope this post will give you a bird’s eye view of Drupal’s many parts and how they all come together to create one of the greatest web systems out there.</p><p
style="text-align: center;"><a
href="http://blog.newrelic.com/wp-content/uploads/icy_cliff.jpg"><img
class="size-full wp-image-9563 aligncenter" style="margin-top: 10px; margin-bottom: 10px;" title="icy_cliff" src="http://blog.newrelic.com/wp-content/uploads/icy_cliff.jpg" alt="Learning Curve" width="500" height="375" /></a></p><p><span
style="font-size: 1.25em;"><strong>Contrib: Building Blocks for Drupal Development</strong></span><br
/> Normally with extendable open source systems, you have a community contributing “third party” plugins or extensions. In Drupal, these are called modules and the ones not shipped with the core Drupal installation are called contribution modules (contrib modules).</p><p>But here’s a very important distinction to be made. Contrib modules are not separate from Drupal the same way they are used in other communities. Instead this is an area where new ideas are bred and special use cases are handled. This is a vital part of the ecosystem – for every new major version of Drupal, some contrib modules are refactored and made part of the core.</p><p>If you install Drupal core as it is, you’d be able to create content and manage it to some extent. But let’s be honest, you’d create a rather crappy website. Instead what you should do is use both core and contrib modules as the building blocks of your site. By cherry picking them, you can build the exact site and functionality you want.</p><p>Many in the community label Drupal a Content Management Framework instead of a CMS. This description better reflects how you actually need to build the CMS yourself and how Drupal is a box of Legos you can use to do so. But as any ten-year old kid can tell you, you need to know which parts you need before you can build an awesome spaceship.</p><p><span
style="font-size: 1.25em;"><strong>Entities and Fields</strong></span><br
/> By definition, a CMS is all about content. In Drupal your content is packed into <em><a
title="entities" href="http://drupal.org/node/1261744" target="_blank">entities</a></em> of different <em>types</em>, ranging from users and comments to nodes and taxonomies. These are abstract data types, representing a single piece of content.</p><p>From Drupal core you have a couple of modules like <span
style="font-family: Courier;">user.module</span> and <span
style="font-family: Courier;">node.module</span> which integrates with the Entity API to provide their own types. This API allows anyone to easily create custom entity types for special edge cases, using <span
style="font-family: Courier;"><a
title="hook entity info()" href="http://api.drupal.org/api/drupal/modules%21system%21system.api.php/function/hook_entity_info/7" target="_blank">hook entity info()</a></span>. More on this later.</p><p>By default your entities can automatically be retrieved from storage via <span
style="font-family: Courier;"><a
title="entity_load()" href="http://api.drupal.org/api/drupal/includes%21common.inc/function/entity_load/7" target="_blank">entity_load()</a></span>. However if you also install <a
title="Entity API" href="http://drupal.org/project/entity" target="_blank"><em>entity</em><em>.</em><em>module</em></a>, then all entities are also given a full programmatic CRUD interface, to Create, Retrieve, Update and Delete instances of the given type.</p><p>The node entity type is to most sites the central type &#8212; it’s what editors normally create on a daily basis. Nodes are further broken down in <em>bundles</em> &#8212; a type of data template for your content. These can be anything from articles, FAQ pages, interviews, podcast episodes, etc. This all depends on your unique site.</p><p>Entities in and of themselves are just bare, boring objects. In order to save any meaningful data to an entity bundle you may add <em>fields</em> to it. An article could for example need a header image and a body text, while a user might require a name and a website address.</p><p>Fields are an examples of how contrib modules work. They were introduced way back in Drupal 5 by the CCK module. It was such a success with the community that the module was quickly adopted and kept through Drupal 6. Then it integrated into the core for Drupal 7, with the <a
title="Field API" href="http://api.drupal.org/api/drupal/modules!field!field.module/group/field/7" target="_blank">Field API</a>.</p><p>The way it works is that modules define <em>field types</em>, like an image field, which can then be attached to a bundle and named “header image” for an article. When you then go and create an article, the field will be instantiated to hold that really cool cat picture.</p><p>Other field types include links, email address, geographic data, etc. Of course you can also add your own if you find that the plethora of contrib modules can’t cover your specific needs</p><p><span
style="font-size: 1.25em;"><strong>Views for Lists</strong></span><br
/> Now that you have your entities sorted, you will naturally want to list them and your other data too – whether it’s for a front page article listing, a “who’s online” list or a tag cloud. This is done using <a
title="Views" href="http://drupal.org/project/views" target="_blank">Views</a>, a pluggable list generator module.</p><p>Roughly speaking Views work in two steps. First it takes your configuration and builds a query from it, which is sent to the backend. Your backend is normally a MySQL database, but it could just as well be a web service, an XML file, FTP server, etc. Views doesn’t care &#8212; it’s pluggable, remember? Second it receives the query result and transforms this into a list in your preferred format, ranging from your vanilla HTML <span
style="font-family: Courier;">&lt;ul&gt;</span> lists to <a
title="Views Datasource" href="http://drupal.org/project/views_datasource" target="_blank">JSON</a> and <a
title="Views RSS" href="http://drupal.org/project/views_rss" target="_blank">RSS</a>.</p><p>As with most things in Drupal, you will create your views using a web based UI. But what’s most interest for us as developers is what’s happening behind the scenes. In the case of Views, you will basically configure a view object, consisting of handlers for filters, fields and sorting, styles for its output and various configurations.</p><p>A Views handler is basically a class that can query the user for configuration and then help build the query. There are field handlers that adds data to what the query returns, sort handlers to manage the ordering of results, relationship handlers which pull in extra data in related tables, filter handlers that sift the results to only pick specific ones, and so on.</p><p>Modules bringing a new type of entity field also often contain Views plugins for filtering on those fields, styles to format the fields and so on. This modularity means that when you have an edge case that isn’t covered by the default plugins, you can easily hook into Views and extend it any way you want.</p><p>Opposed to most everything else in Drupal, Views are very heavy on the object orientation. Your views are objects and their handlers, styles and plugins are objects. Everything is tied together by hooks (see below), which explains their individual module’s data structure, relation to other data and where to inject the various objects to do their job.</p><p>As always, database interactions will most likely be the biggest bottlenecks in your applications and because of this Views has built in support for caching. It works in two layers, where you can cache the raw results of the generated query and its themes output, individually. Of course the caching is pluggable as well, so you are able to extend and change the logic if you’re not happy with the default options.</p><p><span
style="font-size: 1.25em;"><strong><strong>Coming Up</strong></strong></span><br
/> Next week I will dig a little deeper into these subjects<br
/> <span
style="font-size: 1.25em;"><strong><strong></strong><br
/> Export with Features</strong></span><br
/> Everything in Drupal is built through the web interface. Or should be, rather, since one common pitfall for many newcomers is to start digging into code and program all your features yourself. This is a big no-no and goes against <em>The Drupal Way</em> paradigm. This is an approach of building with existing blocks wherever possible to leverage all the work others have already done and will keep doing in the future.</p><p>But how will you ship it if everything you build is configured in the database? In particular &#8212; how will you ship continuous updates to an already deployed site? And no, building in production is never an option.</p><p>The answer is Features, another contrib module that allows you to export database configuration, diff between your export and the database, and flush the database configurations in favor of your exports. Together this gives you all the tools you need to work <em>The Drupal Way</em> with an easy point-and-click interface, while keeping all the benefits of having your site in code.</p><p>You also no longer have to make heavy database queries to put together your configuration, because they can be read from a file instead. Sure, disk I/O is also slow but with an <a
title="PHP Accelerator" href="http://en.wikipedia.org/wiki/PHP_accelerator" target="_blank">opcodecache</a>, like APC, that’s no longer and argument. Because you’re not running PHP without an opcode cache, are you?</p><p>I’d like to think that Features turns Drupal into one giant <a
title="Scaffolding" href="http://en.wikipedia.org/wiki/Scaffold_(programming)" target="_blank">scaffolding</a> machine. Definitely in a good way!</p><p><strong
style="font-size: 1.25em;">Extending Drupal</strong></p><p>So it’s not a good idea to just dive head first into programming Drupal. Though for some cases you have no option but to do just that. Despite my definite bias towards Drupal, I honestly think for projects with a lot of these cases you should take a long, hard look at the requirements and perhaps consider other platforms to build upon.</p><p>If you still feel Drupal is a good choice then you are certainly covered as far as extensibility goes. Apart from being a box of blocks for builders to assemble, the platform also sports a nice base framework with several extension points for custom code.</p><p>In the majority of cases this means <em>hooks</em> &#8211; callback functions named in a specific format. It relies on string substitution magic and lots of <span
style="font-family: Courier;"><a
title="function_exists" href="http://us2.php.net/function_exists" target="_blank">function_exists()</a></span> calls. In my opinion this is one of darkest corners of Drupalverse, but on the plus side it makes it really easy for beginners to jump right into Drupal development.</p><p>To understand how these hooks work in practice let’s say for example that you’re creating a module named <span
style="font-family: Courier;"><em>newrelic</em></span>. In it you want to run a piece of code on every incoming request and for that you decide to implement <span
style="font-family: Courier;"><a
title="hook_boot()" href="http://api.drupal.org/api/drupal/modules!system!system.api.php/function/hook_boot/7" target="_blank">hook_boot()</a></span>. So you open up your <span
style="font-family: Courier;"><em>newrelic.module</em></span> file (the module’s base PHP script) and enter the following:</p><p
style="padding-left: 30px;"><span
style="font-family: Courier;">&lt;?php<br
/> function newrelic_boot() {<br
/> echo ‘Hello world!’;<br
/> }</span></p><p>And that’s it &#8212; you have now extended Drupal to print “Hello world!” on every page! Perhaps not the most useful extension, but still, you get the point.</p><p>A complete list of all hooks in Drupal core can be found at <a
title="api.drupal.org" href="http://api.drupal.org/api/drupal/includes%21module.inc/group/hooks/7" target="_blank">api.drupal.org</a>. Also see <span
style="font-family: Courier;"><a
title="Example Module" href="http://drupal.org/project/examples" target="_blank">example.module</a></span>, which is a collection of examples and best practices for how you can extend Drupal with your custom modules.</p><p>If you’re someone coming in from an object oriented world, you may become confused by the data model in Drupal where the primary structure is an arbitrary array. It makes it impossible to code by contract and your code will consist of a lot of empty() and isset() calls, just to verify data integrity. This spaghetti architecture was amusingly highlighted by a recent April Fools joke.</p><p>But it does have its advantages, especially when it comes how easy it is to override core and contrib modules. Let’s say for example that you want to take over the login page of Drupal and replace it with your own. Then you first have a look at how <span
style="font-family: Courier;">user.module</span> defines the page in its <span
style="font-family: Courier;"><a
title="hook_menu()" href="http://api.drupal.org/api/drupal/modules%21system%21system.api.php/function/hook_menu/7" target="_blank">hook_menu()</a></span> implementation.</p><p
style="padding-left: 30px;"><span
style="font-family: Courier;">function user_menu() {<br
/> return array(<br
/> &#8216;user/login&#8217; =&gt; array(<br
/> &#8216;title&#8217; =&gt; &#8216;Login&#8217;,<br
/> &#8216;page callback&#8217; =&gt; &#8216;user_page&#8217;,<br
/> ),<br
/> );<br
/> }</span></p><p>Here it says that when someone visits <em>example.com/user/login</em>, the <span
style="font-family: Courier;">callback user_page()</span> will be executed. If we want to replace that with our own callback we need to implement <span
style="font-family: Courier;"><a
title="hook_menu_alter()" href="http://api.drupal.org/api/drupal/modules%21system%21system.api.php/function/hook_menu_alter/7" target="_blank">hook_menu_alter()</a></span>.</p><p
style="padding-left: 30px;"><span
style="font-family: Courier;">function newrelic_menu_alter(&amp;$items) {<br
/> $items[‘user/login’][‘page callback’] = ‘newrelic_page’;<br
/> }</span></p><p>And all of a sudden, all visits to <em>example.com/user/login</em> will cause <span
style="font-family: Courier;">newrelic_page()</span> to be called instead. Dead simple! This <span
style="font-family: Courier;">hook_x() -&gt; hook_x_alter()</span> pattern is very common in Drupal.</p><p><span
style="font-size: 1.25em;"><strong>Premature Optimization is Evil</strong></span><br
/> Drupal is very general purpose platform. Because of this it has been necessary to introduce several layers of abstraction, to make it suit as many use cases as possible. Of course in many cases this also means a severe hit in performance.</p><p>I agree with the critique that Drupal can be very slow. But I also firmly believe there is nothing you cannot fix and Drupal even makes this a relatively easy task. How to boost your performance is a subject for another article however. The best you can do is to remember that premature optimization is evil and instead you should focus on bottlenecks later when and if there really is a problem.</p><p>Until then &#8212; get to know your building blocks and keep scaffolding your site!</p> ]]></content:encoded> <wfw:commentRss>http://blog.newrelic.com/2012/05/09/getting-started-with-drupal-building-blocks/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Creating a Fast RESTful API Using CakePHP and New Relic</title><link>http://blog.newrelic.com/2012/05/08/creating-a-fast-restful-api-using-cakephp-and-new-relic/</link> <comments>http://blog.newrelic.com/2012/05/08/creating-a-fast-restful-api-using-cakephp-and-new-relic/#comments</comments> <pubDate>Tue, 08 May 2012 21:49:43 +0000</pubDate> <dc:creator>Patrick Moran</dc:creator> <category><![CDATA[Performance Tech Tips]]></category> <category><![CDATA[Top Post]]></category><guid
isPermaLink="false">http://blog.newrelic.com/?p=10146</guid> <description><![CDATA[This post is written by Martin Samson of The Hotel Communication Network. We love when customers post about how they use New Relic in their environment. Martin posted it on his own blog, and we asked him if we could share it with our extended audience. He said yes. Thanks Martin! Creating a fast RESTful [...]]]></description> <content:encoded><![CDATA[<p><em><a
href="http://blog.newrelic.com/wp-content/uploads/HCN.png"><img
class="alignleft  wp-image-10157" style="margin-top: 5px; margin-bottom: 5px; margin-left: 10px; margin-right: 10px;" title="HCN" src="http://blog.newrelic.com/wp-content/uploads/HCN.png" alt="The Hotel Communication Network logo" width="72" height="40" /></a>This post is written by <a
title="Martin Samson's Twitter account" href="https://twitter.com/#!/pgdown" target="_blank">Martin Samson</a> of The Hotel Communication Network. We love when customers post about how they use New Relic in their environment. Martin posted it on <a
title="Martin Samson's blog" href="http://masom.posterous.com" target="_blank">his own blog</a>, and we asked him if we could share it with our extended audience. He said yes. Thanks Martin!</em></p><p><span
style="font-size: 1em;"><strong>Creating a fast RESTful API using CakePHP and New Relic</strong></span><br
/> In early 2012, the development team at <a
title="The Hotel Communication Network" href="http://www.hcn-inc.com/" target="_blank">The Hotel Communication Network</a> set out to build a RESTful API to simplify communication between the various components of our platform. Early in the process, we began to evaluate the different options available to us: Ruby on Rails, CakePHP, Django, Lithium and ExpressJS.</p><p>We had the following requirements:</p><p
style="padding-left: 30px;">* Rapid development<br
/> * Unit tested<br
/> * Wrap the database with a safe interface (CRUD)<br
/> * Be compatible with multiple languages</p><p>The application started as a simple CRUD interface to be completed with a two week deadline. All frameworks were up to the task, albeit CakePHP was well known by all of us.</p><p>Reasons we chose CakePHP:</p><p
style="padding-left: 30px;">* We already use 1.x extensively.<br
/> * Our database was already compatible.<br
/> * The IRC channel is vibrant.<br
/> * It’s easy to understand.</p><p><span
style="font-size: 1em;"><strong>Development</strong></span><br
/> We started development in late March 2012. None of us had any experience with the new version of the framework; as it was just released. Once all the entities were defined, we built the API from the outside in by defining how resources should be accessed, modified and created. A lot of time was saved because our database already followed CakePHP&#8217;s naming conventions; the bake tool was used to generate the models and their test skeletons; the validation rules, routes and controllers quickly followed.</p><p>CakePHP has matured quite nicely, associations are now lazy-loaded. Object loading greatly improved, you can easily apply &#8220;<a
title="Objects on Rails" href="http://objectsonrails.com/" target="_blank">Objects on Rails</a>&#8220; principles. Most of the logic was moved from models to distinct objects resulting in slim controllers and not-so-fat models, with clean business objects. It allowed our models to handle only data concerns (validation and persistence) thus giving us faster unit tests. CakePHP’s move to PHPUnit made for better tests and reports.</p><p>Our app, code named Butterfly, quickly grew from a simple CRUD application to the core of our platform. Most business logic was consolidated, eliminating code duplication.</p><p>Finally, all the REST routes were manually specified to give us more flexibility and control.</p><p><img
class="alignright" style="margin-top: 5px; margin-bottom: 5px; margin-left: 10px; margin-right: 10px;" title="CakePHP" src="http://cakephp.org/img/logo/cakephp_logo_250_trans.png" alt="CakePHP" width="175" height="175" /></p><p><span
style="font-size: 1em;"><strong>Tips when using CakePHP:</strong></span></p><p
style="padding-left: 30px;">* Use model validation for everything. Really. Use it to verify a related entity’s existence.<br
/> * Use components to wrap repetitive controller logic such as GET parameter parsing.<br
/> * Separate concerns between models and business objects. CakePHP 2.x allows loading any classes with App::uses(). See <a
title="Objects on Rails" href="http://objectsonrails.com/" target="_blank">Objects on Rails</a> by Avdi Grimm<br
/> * Use the whitelist when saving data. (See <a
title="RoR / GitHub mass assignment security problem" href="https://github.com/rails/rails/issues/5228" target="_blank">RoR / GitHub mass assignment security problem</a>.)<br
/> * Write unit tests! We have over 300 tests and thousands of assertions.<br
/> * Use simple views combined with the RequestHandler. Our API is only accepting and serving JSON, but we could easily add XML.</p><p>Running Butterfly on Apache 2.2 + mod_php seemed fast on our development machines although it quickly crumbled in our staging environment. At that point, we really didn&#8217;t know what was wrong and why responses were getting slower and slower. We were blind.</p><p><span
style="font-size: 1em;"><strong>Enter New Relic</strong></span><br
/> <a
title="New Relic" href="http://newrelic.com" target="_blank">New Relic</a> is a real-time monitoring service built to help you squeeze performance out of your applications. We heard lots of good things about them from a newly employed engineer and Shopify’s Tweets.</p><p>The whole process of signing up, installing the PHP module and getting a t-shirt took less than 10 minutes on FreeBSD! We were blown away once we viewed the dashboard: it automatically detected the framework and produced useful, near real-time graphs. From slowest controller to detailed database queries, we could drill down to a specific section of the system to determine what needed be optimized. A great feature is the ability to backtrace from any SQL query to its callers.</p><p>To our surprise, CakePHP&#8217;s built-in authentication with ACL was the slowest part of the application, due to joining in the aro/aco/users tables. We also discovered one of our applications was not caching properly, requesting object schemas on each call.</p><p>NGINX + PHP-FPM is being marketed as a really fast alternative forapache + mod_php. The metrics allowed us to compare NGINX to Apache, within our environment. Switching to it resulted in a 100% speed increase!</p><p>New Relic enabled us to optimize early in the development process, gave us visibility and the metrics to back changes. We are now entering the production phase and New Relic will help us keep track of improvements, enabling us to deliver a better end-user experience.</p> ]]></content:encoded> <wfw:commentRss>http://blog.newrelic.com/2012/05/08/creating-a-fast-restful-api-using-cakephp-and-new-relic/feed/</wfw:commentRss> <slash:comments>1</slash:comments> </item> <item><title>Case Study: Nike eCommerce Team Makes Fast Online Service Even Faster</title><link>http://blog.newrelic.com/2012/05/07/case-study-nike-ecommerce-team-makes-fast-online-service-even-faster/</link> <comments>http://blog.newrelic.com/2012/05/07/case-study-nike-ecommerce-team-makes-fast-online-service-even-faster/#comments</comments> <pubDate>Mon, 07 May 2012 17:40:02 +0000</pubDate> <dc:creator>Leigh Shevchik</dc:creator> <category><![CDATA[Case Study]]></category> <category><![CDATA[Top Post]]></category><guid
isPermaLink="false">http://blog.newrelic.com/?p=10085</guid> <description><![CDATA[“Using New Relic has helped change our internal business partners’ perception of IT.&#8221; Nike is one of the most recognized brands in the world. Founded in 1964 by University of Oregon track athlete and his coach Bill Bowerman, it has grown to be a leading global developer and retails sales company of athletic footwear, apparel [...]]]></description> <content:encoded><![CDATA[<h3><a
href="http://blog.newrelic.com/wp-content/uploads/Nike-Logo1.jpg"><img
class="alignleft  wp-image-10088" style="margin-top: 5px; margin-bottom: 5px; margin-left: 10px; margin-right: 10px;" title="Nike-Logo" src="http://blog.newrelic.com/wp-content/uploads/Nike-Logo1-150x150.jpg" alt="Nike logo" width="108" height="108" /></a></h3><h3>“Using New Relic has helped change our internal business partners’ perception of IT.&#8221;</h3><p><a
title="Nike" href="http://www.nike.com/nikeos/p/nike/en_US/?ref=" target="_blank"><br
/> Nike</a> is one of the most recognized brands in the world. Founded in 1964 by University of Oregon track athlete and his coach Bill Bowerman, it has grown to be a leading global developer and retails sales company of athletic footwear, apparel and sports equipment. The company now operates in more than 160 countries and has employees on six continents.</p><p>Nike’s online business is a significant and growing part of its revenue portfolio. In 2011, <a
title="Nike.com" href="http://www.nike.com/nikeos/p/nike/en_US/?ref=" target="_blank">Nike.com</a> and its associated eCommerce applications brought in over $650 Million in revenue worldwide. Since Nike knows web performance directly correlates to revenue generation, it has made fixing and correcting any performance issues a high priority.</p><p>Initially incident notification, performance triage and management were significant challenges for Nike.com’s eCommerce team. Although the team was using a variety of tools, it had little insight into production application server health. As its eCommerce platform grew rapidly, the team searched for a better way to ensure application performance and reliability.</p><p><a
href="newrelic.com"><img
class="alignleft  wp-image-10115" title="Nike_Shoe" src="http://blog.newrelic.com/wp-content/uploads/Nike_Shoe.jpg" alt="" width="322" height="152" /></a></p><p>“Our main challenge was insufficient insight into our eCommerce applications – no single pane of glass we could look at to see what was going on under the covers,” says <a
title="Kevin Bartholomew's Twitter account" href="https://twitter.com/#!/uofokjb" target="_blank">Kevin Bartholomew</a>, Nike Web Support Production Manager. “One tool told us the network was down. Another told us the site was slow. We didn’t have anything to see where the problems were, and definitely not what was causing potential issues.”</p><p>Nike’s eCommerce team found New Relic in 2011 and was quickly impressed by what it found. “We chose New Relic based on the features available, its ease of installation and its quick results,” adds Kevin. “Overall cost was important to us so the fact that New Relic was a SaaS offering was helpful. We really liked its simple intuitive interface and shallow learning curve, and best of all, we really appreciated its almost instant value.”</p><p><img
class="alignright size-full wp-image-10118" title="NewRelicNikeQuote" src="http://blog.newrelic.com/wp-content/uploads/NewRelicNikeQuote.jpg" alt="" width="260" height="170" /></p><p>Today, the Nike web support team can identify and fix performance issues quickly. New Relic enables them to be much more proactive than reactive and the team is delighted. “Using New Relic has helped change our internal business partners’ perception of IT,” summarizes Kevin.“We have the data and the reports to know when we have fixed a problem. Everyone is more confident and more cooperative. Even within our organization, communication and cooperation have improved.” The result is that the team knows there is an issue before Nike’s customers know it – and that’s exactly what it wants.</p><p>See the full <a
title="Nike case study" href="http://newrelic.com/about/customers/case-study-nike" target="_blank">Nike case study</a> to see how New Relic helps the Nike eCommerce team make fast online service even faster.</p><p><img
class="alignnone" title="Fast is Faster" src="http://www.loudreams.com/wp-content/uploads/2012/04/atlanta-falcons-new-nfl-uniforms-2012-nike.jpeg" alt="" width="600" height="400" /></p> ]]></content:encoded> <wfw:commentRss>http://blog.newrelic.com/2012/05/07/case-study-nike-ecommerce-team-makes-fast-online-service-even-faster/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Community News: How To Use the Cloud to Foster Innovation and More</title><link>http://blog.newrelic.com/2012/05/04/community-news-how-to-use-the-cloud-to-foster-innovation-and-more/</link> <comments>http://blog.newrelic.com/2012/05/04/community-news-how-to-use-the-cloud-to-foster-innovation-and-more/#comments</comments> <pubDate>Fri, 04 May 2012 19:37:00 +0000</pubDate> <dc:creator>Leigh Shevchik</dc:creator> <category><![CDATA[Cloud Computing]]></category> <category><![CDATA[Performance Tech Tips]]></category><guid
isPermaLink="false">http://blog.newrelic.com/?p=10077</guid> <description><![CDATA[In this week’s news, we look at how to use the cloud to foster innovation and more. * Jelastic shares a tutorial on how to use New Relic on their Java hosting platform. * Engine Yard CEO John Dillon explains how you can use the cloud for rapid-fire innovation. * Solutions Architect Peter Yorke leads a webinar [...]]]></description> <content:encoded><![CDATA[<p>In this week’s news, we look at how to use the cloud to foster innovation and more.</p><p
style="padding-left: 30px;">* Jelastic shares a tutorial on <a
title="How to use New Relic Agent in Jelastic" href="http://blog.jelastic.com/2012/05/01/how-to-use-new-relic-agent-in-jelastic/" target="_blank">how to use New Relic</a> on their Java hosting platform.</p><p
style="padding-left: 30px;">* Engine Yard CEO John Dillon explains how you can <a
title="How You Can Use the Cloud for Rapid Fire Innovation" href="http://www.forbes.com/sites/ciocentral/2012/04/30/how-you-can-use-the-cloud-for-rapid-fire-innovation/" target="_blank">use the cloud for rapid-fire innovation</a>.</p><p
style="padding-left: 30px;">* Solutions Architect Peter Yorke leads a webinar on how to use New Relic to <a
title="New Relic for App Performance on Joyent Cloud" href="http://joyentcloud.com/resources/videos/new-relic-for-application-performance-on-joyent-cloud" target="_blank">monitor performance</a> for applications running on the Joyent Cloud.</p><p
style="padding-left: 30px;">* Patrick Moran, our own VP of Marketing, asks <a
title="How Much Revenue Does it Take to be a $1B public company" href="http://techcrunch.com/2012/04/29/how-much-revenue-does-it-take-to-be-a-1b-public-company/#comment-box" target="_blank">how much revenue does it take to be a $1B public company</a>?</p><p
style="padding-left: 30px;">* CDN Planet describes the <a
title="How to Test Your CDN Before Go Live" href="http://www.cdnplanet.com/blog/how-test-your-cdn-before-go-live/" target="_blank">best way to test your CDN</a> before it goes live.</p><p
style="padding-left: 30px;">* Internet Retailers shows how Google is looking for ways to <a
title="Mobile Merchants: Google Wants to Make Your Site Faster" href="http://www.internetretailer.com/2012/04/25/mobile-merchants-google-wants-make-your-site-faster" target="_blank">make the mobile web faster</a>.</p><p
style="padding-left: 30px;">* Adam Sherk <a
title="The Fastest and Slowest News Sites in 2012" href="http://www.adamsherk.com/seo/page-speed-fastest-and-slowest-news-sites/" target="_blank">checks the PageSpeed scores for top 43 news sites</a> and shares which have the fastest page load times.</p><p
style="padding-left: 30px;">* Developer Mike Cousins <a
title="New Relic NuGet Package: Automatic Building and Publishing with TeamCity" href="http://www.mikecousins.com/new-relic-nuget-package/" target="_blank">creates a NuGet package</a> to make it easier to get New Relic running in an Azure environment.</p> ]]></content:encoded> <wfw:commentRss>http://blog.newrelic.com/2012/05/04/community-news-how-to-use-the-cloud-to-foster-innovation-and-more/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Case Study: Cinchcast Goes on the Air Every Day with New Relic</title><link>http://blog.newrelic.com/2012/05/04/case-study-cinchcast-goes-on-the-air-every-day-with-new-relic/</link> <comments>http://blog.newrelic.com/2012/05/04/case-study-cinchcast-goes-on-the-air-every-day-with-new-relic/#comments</comments> <pubDate>Fri, 04 May 2012 16:44:31 +0000</pubDate> <dc:creator>Leigh Shevchik</dc:creator> <category><![CDATA[Case Study]]></category> <category><![CDATA[Company News]]></category> <category><![CDATA[Top Post]]></category><guid
isPermaLink="false">http://blog.newrelic.com/?p=10046</guid> <description><![CDATA[As a fast growing company, Cinchcast takes web performance very seriously. Its cloud-based audio performance platform makes it easy for companies of all sizes to create, share, measure, and monetize audio content with audiences anywhere in the world. Cinchcast’s simple, yet powerful solution enables businesses and organizations to produce and share original audio content without [...]]]></description> <content:encoded><![CDATA[<p><a
href="http://blog.newrelic.com/wp-content/uploads/cinchcast_logo1.jpg"><img
class="wp-image-10050 alignleft" style="margin-top: 5px; margin-bottom: 5px;" title="cinchcast_logo" src="http://blog.newrelic.com/wp-content/uploads/cinchcast_logo1.jpg" alt="Cinchcast logo" width="173" height="49" /></a>As a fast growing company, <a
title="Cinchcast" href="http://cinchcast.com/" target="_blank">Cinchcast</a> takes web performance very seriously. Its cloud-based audio performance platform makes it easy for companies of all sizes to create, share, measure, and monetize audio content with audiences anywhere in the world. Cinchcast’s simple, yet powerful solution enables businesses and organizations to produce and share original audio content without the burden of additional hardware, software or logistics overhead.</p><p>On a monthly basis, Cinchcast’s media property, <a
title="BlogTalkRadio" href="http://www.blogtalkradio.com/defaultpii5" target="_blank">BlogTalkRadio</a>, hosts more than 35,000 hours of original content, attracts over 13 million unique visitors, and powers 15 million streams and 175 million ad impressions. The Cinchcast team is keenly aware that site performance is critical to participant engagement. Therefore, the company sees performance as a critical factor for their continued success.</p><p>To deliver superior performance, Cinchcast needed insight and deep visibility into its applications components. It wanted to understand which components in the application were taking significantly more time than others and how fast the website loaded from an end-user perspective. “Initially we knew that certain pages took longer to load than we would like so we started there,” said company CTO <a
title="Aleksandr Yampolskiy's Twitter account" href="https://twitter.com/#!/ayampolskiy" target="_blank">Aleksandr Yampolskiy</a>. “New Relic helped us quickly identify the problem spots so we could optimize them.”</p><p>Within five months of installing <a
title="New Relic" href="https://www.newrelic.com" target="_blank">New Relic</a>, Cinchcast improved its site performance by 40 percent. And today, its development team uses New Relic to track performance on all their sites. “We use New Relic like a x-ray to see into every aspect of our platform and determine what we can improve,” Alex adds. “It give us both the big picture and points us to specific areas where we can achieve the biggest performance improvements.”</p><p>As Cinchcast’s momentum and leadership in the audio publishing and broadcasting space continues to accelerate, it knows it has the tools in place to keep its audio platform running at peak performance. “We’re a growing company and our enterprise customers expect and need reliability and superior performance for every audio broadcast. We take performance seriously,” Alex concludes. “We monitor performance all the time, 24&#215;7. Adding our weekly performance analysis and review session helps us to continually evolve and optimize our audio platform to support our rapidly expanding business.” And that’s exactly what its customers expect.</p><p>See the full <a
title="Cinchcast case study" href="http://newrelic.com/about/customers/case-study-cinchcast" target="_blank">Cinchcast case study</a> for more information on how New Relic helps it deliver reliability and superior performance.</p> ]]></content:encoded> <wfw:commentRss>http://blog.newrelic.com/2012/05/04/case-study-cinchcast-goes-on-the-air-every-day-with-new-relic/feed/</wfw:commentRss> <slash:comments>1</slash:comments> </item> </channel> </rss>
<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using disk: basic
Page Caching using memcached

Served from: blog.newrelic.com @ 2012-05-16 21:28:50 -->
