Archive for September, 2008

New developer’s resource

Posted by toby mills on Sep 16 2008 | C#.Net, ASP.Net, Technical developement

A wonderful new resource has been created by the enterprising Joel Spolsky and Jeff Atwood. I have long been a fan of Jeff’s Coding Horror blog and when i heard that he intended to try to create a new on-line resource for developers i was intrigued if not a little sceptical but thought i would follow its progress via their pod cast. Well, yesterday (15 sept 08) the site was finally launched and i have to say its looking good. It’s still in the usual “beta” format but it’s working well and I’ve already taken the opportunity to add a few responses.

As always with projects like this only time will tell how successfully this venture will be but i certainly wish all the best and will be using it a lot myself to assist and be assisted by the vast community out there.

no comments for now

Testing load balanced servers

Posted by toby mills on Sep 16 2008 | ASP.Net, Technical developement, Personal

A developer has asked me about testing individual sites configured for load balancing to ensure each is working properly. I have found the best way to do this is to set-up a new DNS record (or external IP) for a site and point it to the server you want to test.

Generally when using load balanced sites across two servers I tend to create three records for the sites:

For example:

  • Test.site.com = loadbalancer.site.com
  • Ws1.Test.site.com = ws1.site.com
  • Ws2.Test.site.com = ws2.site.com

You will also need to add the individual urls to the appropriate website properties in IIS (or similar)

Also, i configure all servers to add the server name to the http response headers which you can view using firefox’s web developer tool bar. This lets you see which server is rendering the page without giving away any secure information and is hidden from the users view.

An example of such an HTTP header for a server named WS2 would be:

Date: Tue, 17 Jun 2008 14:18:23 GMT
Server: Microsoft-IIS/6.0
X-Powered-By: ASP.NET
Webserver: ws2
Content-Length: 5558
Content-Type: text/html
Cache-Control: private

200 OK

no comments for now

Load balanced servers & viewstate

Posted by toby mills on Sep 16 2008 | ASP.Net, Technical developement

Recently an issue arose with a clients web site which has been caused by the fact that the site is load balanced and uses view states. When deploying load balanced web sites which use view states you must ensure that they specify a machineKey in site’s web.config, this key is used to encrypt and de-crypt the values passed. However, these are normally set at a server level and different on each machine. This means that when a user navigates from one page to another, and in the process is transferred to a different server (because the load balancer sent them to a different server), then asp.net can not read the encrypted viewstate as uses a unique key and will fire off an error.

You can read more about this @ How To: Configure MachineKey in ASP.NET 2.0

T

no comments for now