Archives / 2010 / September
  • The Check In Dance

    When developing software and working with a build or integration server, there are certain conventions that one should follow when making updates to the shared codebase.  Somewhere I picked up the term “the check in dance” (not to be confused with “the chicken dance”) for this process, which is very straightforward and, if followed, can ensure that build failures on the continuous integration (CI) server are a rarity. Automating the Build Before we get into the process of properly checking in code for a build server to work with, let’s briefly talk about how one automates a build, and why this is a good thing.  If you’re using Visual Studio, automating a build with MSBuild (or if … more

  • Build Automation for your Application using MSBuild

    Over the past few years, I’ve established something of a standard for how I like to organize my projects, and this includes having a one-click build-and-test script for each project.  This is a quick description of my current thoughts on this, along with some details of how to get the MSBuild scripts working for your project as well.  The ultimate goal is that you, a new developer who just pulled down the source from the version control system, and the build server can all run a build in exactly the same way, and expect the same results. Solution Organization Of late I’m using a structure like this one for most non-trivial projects: This is designed to use the Onion … more

  • How Do I Save Performance Counters in Windows Server 2008 or Windows 7

    If you’re writing multi-user applications like just about any ASP.NET application, it’s probably worth your time to get familiar with performance counters.  Performance Monitor, or perfmon for short, is the tool you use to view these counters on your computer or server.  You can add it to an MMC instance (run MMC and add the performance snap-in) or you can just run perfmon.  (Sidenote – I once got dinged by a manager for mis-spelling perfmon in a proposal for a client.  I forget what he thought I was trying to spell but it made no sense.  In any event, trust me, perfmon is really how it’s spelt).  There are about 3 counters that you can work with in … more

  • Real World Monitoring and Tuning ASP.NET Caching Part 2

    In Real World Monitoring and Tuning ASP.NET Caching Part 1, I showed the behavior of a certain ASP.NET application under load.  We resolved the issue today, which turned out to be a result of two related issues that, thankfully in our case, were limited to a single class in our application that was responsible for interacting with our cache.  Here’s the old behavior: The new version of the same application, under pretty much the same load, looks like this: Note the lack of ever-growing memory followed by high-CPU utilization as the memory is reclaimed.  In my last post, I suggested that there were several approaches we could take to correct the issue, one of them being … more

  • ASP.NET Custom Errors Security Flaw

    Updated 5 October 2010: There is now a patch available via Windows Update.  Read more about it here, and ensure all ASP.NET web servers have been patched ASAP. Microsoft just released some details on a security flaw that was publicized a few hours ago.  On this post, you can learn more about the ASP.NET vulnerability and how to detect whether your web sites might be affected by them.  This is a serious flaw that you should take steps to address as soon as possible, since the attack can be performed by anybody with the available tools, in less than a minute, and can provide them with access to any file the site has access to (including web.config), as well as potentially root … more

  • An IIS Crash Analysis Story

    Last week I attempted to update a high-traffic production ASP.NET application to ASP.NET 4.  In the course of doing so, I was surprised, despite having tested everything thoroughly in a staging environment, to find that under production loads, the system was erratic and slow to respond to requests.  Further inspection revealed that IIS was actually crashing under load, leaving a cryptic message in the event log but no other clues.  This is basically an account of what I did, and how I ultimately resolved the issue, for my own future reference and to assist others who may face similar situations. In The Beginning The application in question is a fairly high traffic site, with … more

  • Using Dynamic Parameters in a WebTest or LoadTest

    Using Visual Studio 2010 (and some earlier versions), it’s very easy to create a WebTest by recording one or more web requets to the system under test (SUT).  To get started, open Visual Studio 2010 and create a New Project.  Then select Test Project like so: Next, add a Web Test to the project, and hit the URL you want to test (the one that accepts multiple different parameters that you want to make dynamic).  Run the test and verify it passes with a single set of hardcoded parameters.  You should see something like this: Now it’s time to change the hardcoded parameters you’re using into dynamic parameters.  The first thing you need to do is generate the code … more

  • Principles of Software Design

    Recently I did a webcast on Principles of Software Design in which I very quickly covered several important principles, as well as a few patterns and practices, that lead to better software quality.  If you’re interested, you can view a recording of the webcast (click the wmv link beside the 16 Sep 2010 webcast), or download the slides and demos. more

  • DevReach Online 2010 - Software Fundamentals

      I just finished my DevReach Online presentation, A Whirlwind Tour of Software Development Fundamentals.  In this 45-minute talk, I covered what I consider to be fundamental principles, patterns, and practices of software development, with a little bit of time for a demo at the end.  The session was recorded and will be available on the DevReach Online web site soon.  You can get my slides and demos from the talk here, though.  I’ve also included some of the links from the talk to save you the trouble of hunting through the PowerPoint file.

    18-19 October 2010, Sofia, Bulgaria


    A Whirlwind Tour of Software Development Fundamentals - Slides and … more

  • Real World Monitoring and Tuning ASP.NET Caching

    First off, let me direct you to a great article on monitoring your ASP.NET cache API behavior.  Go read that first, then come back here. Done?  Good, so let’s make the advice from Simon’s blog a bit more concrete with some real-world examples. Consider this fairly high-traffic web server’s behavior (avg. 55 ASP.NET requests/sec, 110 max, at the moment): Notice how the RAM sort of falls off a cliff, and at that same moment, CPU is much higher than usual?  That’s the behavior we want to diagnose (I’ll save the answer for a moment).  As it happens, this same pattern recurs constantly, and is exhibited on multiple machines within the web farm … more

  • Perform Rolling Upgrade of Web Farm using Windows Network Load Balancer

    Once you’ve set up a web farm / cluster using Windows Network Load Balancing, one of the benefits you have is the ability to perform a rolling upgrade.  A rolling upgrade is a process by which you perform updates to individual servers within the cluster while they are not actively serving requests.  This process is repeated so that eventually all servers have been updated, but users have not experienced any downtime. Assume for a moment that you already have 3 servers set up identically to serve web requests, and that you have configured them into a cluster using Windows Network Load Balancing.  You can open Network Load Balancing Manager from Administrative Tools on one of … more