improve.dk
Just another mindless drone looking for the perfect stack
posts - 220, comments - 475

March 2008 Blog Posts


Response.TransmitFile + Close will kill your application

Written on Saturday, March 29, 2008 by Mark S. Rasmussen in Development: .NET

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...

18 comments | Read comments
 

XmlOutput vs XmlSerializer performance

Written on Saturday, March 29, 2008 by Mark S. Rasmussen in Development: .NET

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...

2 comments | Read comments
 

SQL Server Mirroring, a practical approach

Written on Sunday, March 23, 2008 by Mark S. Rasmussen in Development: .NET, Sysadmin: Availability, SQL Server: Mirroring

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!

11 comments | Read comments
 

C# String enumerations

Written on Thursday, March 13, 2008 by Mark S. Rasmussen in Development: .NET

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...

1 comments | Read comments
 

Controlling SqlConnection timeouts

Written on Monday, March 10, 2008 by Mark S. Rasmussen in Development: .NET, SQL Server: Tricks

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.

7 comments | Read comments
 

Using Network Load Balancing for Availability & Scalability

Written on Saturday, March 08, 2008 by Mark S. Rasmussen in Development: .NET, Sysadmin: Windows, Sysadmin: Availability, Sysadmin: 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...

2 comments | Read comments
 

MTH going open

Written on Friday, March 07, 2008 by Mark S. Rasmussen in Poker, Development: .NET, Development: Win32

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...

No comments | Write first comment
 

Setting up and testing Active Directory failover

Written on Sunday, March 02, 2008 by Mark S. Rasmussen in Development: .NET, Sysadmin: Windows, Sysadmin: Availability, Sysadmin: Active Directory

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...

10 comments | Read comments