March 2008 Blog Posts
Response.TransmitFile + Close will kill your application
Just before last weekend I noticed that a website I'm responsible for started spitting out "Server is busy" messages, not something you want to see on a website with millions of visitors per day. The quickfix was to recycle the application pool, and thus I solved the symptoms by setting a 15 mins recycle cycle on all the application pools. Not exactly optimal, but sometimes pissing your pants is the way to go. The first step I made to analyze what was causing this is the Performance Monitor tool. We weren't experiencing above average traffic, so that couldn't explain...
XmlOutput vs XmlSerializer performance
I got quite a lot of comments for my XmlDocument fluent interface, and I'm very glad I did. I'm always open towards new ways to solve problems, and I got a couple of suggestions to my post that I afterwards experimented with. One of those is using the XmlSerializer to serialize strongly typed classes (or structs - performance is the same) into XML. Jon von Gillern originally suggested it, but Kris Vandermotten made me want to test it out. There are two aspects of these solutions, one is readability & maintanability, the other is pure performance. I said that...
SQL Server Mirroring, a practical approach
Join me for a practical demonstration of how to setup SQL Server mirroring. I'll discuss operating modes, mirrors & licensing. Contains demo videos of setup!
C# String enumerations
Switches are rarely nice in an architectural aspect, but they are often required none the less. One of the ways we can reduce the risk of errors as well as increase readability is to use enumeration values instead of constants. Unfortunately this only works for numeric types, we cannot create a string enumeration. Here's a workaround. This is a typical console application, taking in an input value (stored in the input variable) and switching on the content: using System;
namespace StringEnumeration
{
class Program
{
static void Main(string[] args)
{
string input = "Hello";
switch (input)
{
case "Hello":
Console.WriteLine("Hello world!");
break;
case "Goodbye":
Console.WriteLine("Goodbye world!");
break;
default:
Console.WriteLine("Does not compute!");
break;
}
}
}
}
The first step is to...
Controlling SqlConnection timeouts
Controlling the SqlConnection timeout can be tricky as there are multiple timeouts in effect. In this post I'll describe how to automatically timeout an open connection.
Using Network Load Balancing for Availability & Scalability
There are two primary reasons for venturing into the realms of clustering/load balancing - availability & scalability. In this post I'll give a quick demo of how to setup Windows Network Load Balancing (NLB) on Server 2003 and how it affects the availability of a web application. When we have several nodes doing the same thing, if one of them fails, the cluster as a whole continues - provided that the nodes are not so overburdened that a single node failing will kill the others due to the extra load. Most applications will have an upper limit on how...
MTH going open
Some of you may know that I used to play a lot of poker. Unfortunately that's not the case any more. I really enjoy live poker when I'm in Vegas, I enjoy the major tournaments and I've definitely not participated in my last WSOP. But as for online poker and the daily grind, I've quit it. I just don't find it exciting any more. While the mathematical aspect acquired my interest early on, I never enjoyed grinding as such, it was purely for monetary reasons. Anyways, one of the ways I kept enjoying was by utilizing one of my...
Setting up and testing Active Directory failover
I spend a lot of time architecting for scalability, availability and security during my daily work. Currently I've got a distributed system consisting of several windows services communicating across machines using WCF and authenticating through Active Directory. In such a situation, if the Active Directory Domain Controller (let's just call it DC from now on) dies, everything more or less dies as no clients/servers are able to authenticate incoming requests anymore. Security is paramount, so the services are not allowed to simply cache the domain logon, thus the logon has the occur at each service call - requiring a...
|