Sydney Architecture User Group – Next Meeting: Why Windows Azure is not just Generic Brand Web Hosting
Tuesday, November 10, 2009 2:46 PM

The Sydney Architecture User Group is having its second meeting this month on Thursday, 26th November. Full details can be found on our new (but very simple) website located here ( http://thesaug.org ). You can subscribe to the monthly email and also indicate your intention to come by selecting the RSVP option (which would be really nice if you did :-) )

Here is what the next Sydney Architecture meeting has in store. Hope to see you there.

Why Windows Azure is not just Generic Brand Web Hosting

Presenter Nick Randolph
Date/Time: Thursday 26/11/2009 06:00 PM
Where: Grace Hotel , Function Room 77 York st Sydney,NSW. 2000

Abstract

If you take only a glimpse at the offerings on the Windows Azure platform it may just appear to be a form of generic/home brand web hosting from Microsoft. However you’d be sorely mistaken as the platform is significantly different from not only traditional web hosting offerings but also from its competitors in the cloud computing space. In this session we will cover the unique offerings of cloud computing before looking at each of the components of the Windows Azure platform. Cloud computing is new, hot and sexy, but does that mean it’s right for you? Make sure you’re ready to interact and discuss the relative merits of building on the cloud.

Presenter Bio

Nick currently runs Built To Roam (http://www.builttoroam.com) which focuses on building rich mobile applications. Previously Nick was co-founder and Development Manager for nsquared solutions where he lead a team of developers to build inspirational software using next wave technology. Prior to nsquared, Nick was the lead developer at Intilecta Corporation where he was integrally involved in designing and building their application framework.

Sample chapter from upcoming book
Sunday, November 08, 2009 6:59 PM

There is a sample chapter from my upcoming book on all things performance related within the Microsoft platform. Specifically, the book will be about performance testing, profiling and optimisation for web and desktop applications developed using Microsoft.NET.

This sample chapter is just a teaser and the book itself goes into great detail about how to setup a performance test rig using Visual Studio, how to record, manage and analyse performance metrics, and what you can change to make your apps fly.

Anyways, the sample chapter is located here.

( http://www.simple-talk.com/dotnet/performance/understanding-performance-profiling-targets/ )

Hope you like it.

SAUG – Sydney Architecture User Group
Thursday, October 15, 2009 9:28 AM

The first meeting of the Sydney Architecture User Group is going to be held on Thursday, October 22nd, 2009, form 6.00pm to 8.00pm, at the Grace Hotel, 77 York st, Sydney. (Link to map) It will be housed in one of the very nice function rooms they have. Food and drink will be provided. Omar Besiso and myself will be hosting the event, with all funding and sponsorship graciously provided by our company Datacom.

We intend on having a proper site to provide RSS feeds, email subscription and the like, but until we get better organised, we have a facebook page at : http://www.facebook.com/event.php?eid=173036810551 or you can contact myself directly on paul.glavich AT datacom.com.au or you can contact Omar on omar.besiso AT datacom.com.au

Note: If you do intend on coming along, it would be appreciated if you could RSVP via our facebook page, or contact me directly at paul.glavich AT datacom.com.au so we can order to right amounts of food

The goal of the group will obviously be to discuss architecture related matters, but we are going to try and obtain a diverse range of speakers to cover all aspects of architecture. From application architecture, infrastructure, process, and although I am a Microsoft advocate, there is no intent to solely focus on Microsoft related technologies. We will try and cover the whole landscape of enterprise and solution architecture from a variety of angles.

Our first meeting will be a little introduction to the group itself, and then straight onto a presentation by Richard Banks. Details below:

Title:  Architecture in the Small

No matter how good your design or how well the big pieces of your architecture fit together it's the little things that really count.  The little things are the things that can take your vision of beauty and either make it a reality or turn it into a thing of nightmares. Richard will talk about what these little things are, the impact they have and, most importantly, what to do about them.

Bio: Richard Banks is a Principal Consultant with Readify, with a history that includes building ERP, HR, point of sale and student administration systems as well as being the CIO/CTO for a listed company.  He is a Certified Scrum Practitioner, runs the Sydney and Virtual Alt.Net user groups and has spoken at both Tech.Ed and a number of other user groups around the state.  His blog can be found at http://richardsbraindump.blogspot.com

Further meetings will see a format of a short half hour presentation, followed by a longer presentation typically of an hour. We have some interesting speakers lined up for future meetings and if you are interested in presenting at the group, I would love to hear from you.

We look forward to seeing you there!

ASP.NET v4 Presentation Deck and Demo’s
Friday, October 02, 2009 1:13 PM

My ASP.NET v4 New Features overview presentation that I delivered at Sydney Deep .Net User Group (http://sdnug.org ) is available for download here (http://sdnug.org/presentations/200910.zip).

Note: If the above link returns a 404 error, please try here instead.

It covers almost every single new feature that will be covered in ASP.NET v4 in the next release With some demo’s showing off the permanent redirect feature, a bunch of templating demo’s, new client ID functionality and the new chart control.

Hope you enjoy it.

2 TechEd Interviews are live
Friday, September 11, 2009 3:45 PM

Its been a long time since I wrote a blog post but I have been a very busy boy.

This week I have been at TechEd Australia on the sunny Gold Coast in Queensland. I have been keeping a pretty low profile this year but I did participate in 2 interviews that are now available for viewing or download from the Microsoft online site.

The first one is an interview with Omar Besiso, friend, colleague and Enterprise Architect at Datacom on the topic of Building Enterprise Software. You can grab it from here.

The second is an interview with Damian Edwards and Tatham Oddie on the topic of ASP.NET WebForms vs ASP.NET MVC framework. You can access it here.

Hopefully you find them valuable, or at the very least, somewhat entertaining.

Silverlight 3 and WCF Faults
Tuesday, July 14, 2009 3:57 PM

On  a previous project that utilised WCF and Silverlight 2, I began implementing an error handling strategy that was going to rely on certain FaultExceptions being propagated to the Silverlight client. Well it turned out that Silverlight 2 does not support FaultExceptions so that was not going to fly and a custom solution was built.

Well Silverlight 3 does change this to some degree. Silverlight 3 now supports to the notion of Fault Contracts and FaultExceptions. In your Silverlight client code, if I have a WCF service called ThrowExceptionMethod (which as you may have guessed throws a FaultException) you can do something like this:

First wire up the service call:

private void Button_Click_1(object sender, RoutedEventArgs e)
{
    TestRef.TestServiceClient client = new TestSilverlightApplication3.TestRef.TestServiceClient();
    client.ThrowExceptionMethodCompleted += new EventHandler<System.ComponentModel.AsyncCompletedEventArgs>(client_ThrowExceptionMethodCompleted);
    client.ThrowExceptionMethodAsync();
}

Then handle any error situation in the completed event:

void client_ThrowExceptionMethodCompleted(object sender, System.ComponentModel.AsyncCompletedEventArgs e)
{
    if (e.Error == null)
        MessageBox.Show("Call sucessfull");
    else
    {
        string msg;
        FaultException<ExceptionDetail> fex = e.Error as FaultException<ExceptionDetail>;
        if (fex != null)
            msg = string.Format("Fault Exception recevied. Reason: {0}, Message: {1}", fex.Reason, e.Error.Message);
        else
            msg = string.Format("Error recevied of type: {0}, Message: {1}",e.Error.GetType(),e.Error.Message);
        MessageBox.Show(msg);
    }
}

Here you can see that we test the ‘e.Error’ property to see if its an exception of type FaultException, otherwise the error will flow through generally as a CommunicationException as per normal WCF behaviour.

That all sounds easy, however you still need to tell the WCF service (or more specifically WCF itself) to return the fault using a HTTP status code of 200 (OK) instead of a HTTP status code of 500 (server error) which is the default. If you don’t do this, then the error will always come through as a CommunicationException .

You need a little bit of code and configuration for this. First you need to define a custom behaviour like so:

public class SilverlightFaultBehavior : BehaviorExtensionElement, IEndpointBehavior
    {        
        public void ApplyDispatchBehavior(ServiceEndpoint endpoint, EndpointDispatcher endpointDispatcher)
        {
            SilverlightFaultMessageInspector inspector = new SilverlightFaultMessageInspector();
            endpointDispatcher.DispatchRuntime.MessageInspectors.Add(inspector);
        }

        public class SilverlightFaultMessageInspector : IDispatchMessageInspector
        {
            public void BeforeSendReply(ref Message reply, object correlationState)
            {
                if (reply.IsFault)
                {
                    HttpResponseMessageProperty property = new HttpResponseMessageProperty();

                    // Here the response code is changed to 200.
                    property.StatusCode = System.Net.HttpStatusCode.OK;
                    reply.Properties[HttpResponseMessageProperty.Name] = property;
                }
            }
            
            public object AfterReceiveRequest(ref Message request, IClientChannel channel, InstanceContext instanceContext)
            {
                // Do nothing to the incoming message.
                return null;
            }
        }

        // The following methods are stubs and not relevant. 
        public void AddBindingParameters(ServiceEndpoint endpoint, BindingParameterCollection bindingParameters)
        {
        }
        public void ApplyClientBehavior(ServiceEndpoint endpoint, ClientRuntime clientRuntime)
        {
        }
        public void Validate(ServiceEndpoint endpoint)
        {
        }
        public override System.Type BehaviorType
        {
            get { return typeof(SilverlightFaultBehavior); }
        }
        protected override object CreateBehavior()
        {
            return new SilverlightFaultBehavior();
        }
    }

Then some config:

<system.serviceModel>
    <extensions>
      <behaviorExtensions>
        <add name=”silverlightFaults” 
             type=”Microsoft.Silverlight.Samples.SilverlightFaultBehavior, 
             SilverlightFaultBehavior, 
             Version=1.0.0.0, 
             Culture=neutral, 
             PublicKeyToken=null/>
      </behaviorExtensions>
    </extensions>
    <behaviors>
        <endpointBehaviors>
          <behavior name=”SilverlightFaultBehavior”>
            <silverlightFaults/>
          </behavior>
        </endpointBehaviors>
    </behaviors>
    <services>
        <service name=”Calculator.Web.Service”>
            <endpoint address=”” 
                      binding=”basicHttpBinding” 
                      contract=”Calculator.Web.Service” 
                      behaviorConfiguration=”SilverlightFaultBehavior” />
</service>
  </services>
</system.serviceModel> 

So, its still not quite there yet, but its better. It would be nice if this status code behaviour were part of the default Silverlight service template and that it was a provided behaviour, rather than a roll your own custom one.

Note: The custom behaviour, as well as more information on this subject, can and was taken from this article here.

Getting better performance in web apps with a few lines of script
Saturday, June 27, 2009 8:53 PM

We had a situation where a web application was utilising near 100% of CPU all the time under light load and it was proving very hard to reduce this significantly through code optimisation. We were performance testing and profiling, but only seeing marginal gains.

The infrastructure that was hosting the web application was as follows:

  • Virtual Server (Hosted via VMWare Server) running Windows Server 2003 64 bit
  • .Net 3.5
  • Dual Virtual CPUs
  • 2 Gb of memory.

Now I am not a big fan of virtualisation for hosting high performance web sites but we were stuck with this. At any rate, we had consistently high CPU utilisation for seemingly no real reason. Some of the most simple requests were generating high CPU usage.

After some investigation, and also the help of a friend and very smart dude, Scott Forsyth (who works for Orcsweb a high profile web hosting company) we decided to try setting Internet Information Services to 32 bit mode to see if any difference was seen.

To cut a long story short, we changed Internet Information Services to run in 32 bit mode. This simple switch, yielded significant lower CPU utilisation and in some case, almost cut the CPU utilisation in half!

Why would this be so? Well, it turns out there are a few reasons for this. Probably the primary reason is the fact the we get less information within the level 1 cache of the processor because of the increased structure size (pointers are bigger) within 64 bit systems. The same information in a 64 bit system occupies more memory than its 32 bit counterpart, therefore we can fit less into the processor cache. More information on this can be found here.

Its really easy to change IIS to 32 bit mode. The steps are:

  1. To enable 32 bit mode on IIS in 64 bit windows, at a command prompt type:
    cscript %SYSTEMDRIVE%\inetpub\adminscripts\adsutil.vbs SET W3SVC/AppPools/Enable32bitAppOnWin64 1
  2. Once this is done, 32 bit mode is enabled but we need to ensure that the 32 bit DLL’s are used as IIS will still have the 64 bit DLL’s defined for the ISAPI handler. To do this, all we have to do is re-register ASP.NET. At a command prompt, simply type:
    %SYSTEMROOT%\Microsoft.NET\Framework\v2.0.50727\aspnet_regiis.exe –i
  3. Finally, just make sure the status ASP.NET version 2.0.50727 (32-bit)  in the web services extension, within IIS, is set to allowed.
    (More information on this process can be found here http://support.microsoft.com/kb/894435)

And that’s it. A few lines of script, and we had effectively reduced CPU utilisation by somewhere in between 30% and 50%!

Conclusion

So my rule is this, If you are:

  • Running Windows server in 64 bit mode.
  • Running a standard .Net web application
  • Do not need a large memory address space (ie. over 4 gigabytes)
  • Have no special 64 bit optimisations

Then this change will yield immediate performance improvements in your application, and in some cases (dependent on what your application does), yield significant performance improvements.

by Glav | 9 comment(s)
Filed under: , , ,
FromTheGrey – Arts Site
Sunday, May 10, 2009 1:08 PM

Recently, I have been working on creating an arts based website called “FromTheGrey” at http://FromTheGrey.com

Its a site devoted to showcasing the pictures and artwork created by my wife Michele. Previously, Michele has been very reluctant to showcase these pieces, but I really like them, as do many others I know, so it took some time and coaxing to convince Michele to show them to the world.

However, I finally managed to do. As a result, “FromTheGrey” was born. Its a relatively simple site but I hope you like the art on the site and if so, would really appreciate you recommending it to others.

Its currently simple but functional, and will have many more pieces of work from Michele on there, as well as enhanced styling and functionality.

For now though, we would love your feedback which can be submitted via the Contact Form on the site.

For the technically inclined, it utilises ASP.NET 3.5 Webforms, jQuery 1.3.2, and jQuery plugins for the dialog box and gallery effects, Thickbox and Galleria respectively.

by Glav | with no comments
AjaxView – Javascript profiling
Sunday, May 10, 2009 11:25 AM

A little while ago, I posted about a tool called AjaxView to allow you to profile javascript code within your web applications.

Well, I was contacted by Adam who is working on this tool about its latest incarnation. It appears had a lot of work done to it, and now looks quite slick and is really nice to use. Previously, it was quite raw in use and also with the metrics its provides. Now, it acts very similar to one of my favourite profilers, Ants Profiler.

What does it do?

This tool injects profiling code into your javascript that enables it to analyse your javascript code and provide accurate metrics around all the operations being performed, including anonymous functions. It then provides these metrics to the Visual Studio performance tools for you to view in a very simple and familiar manner.

How do you use it?

You need to be using IIS7 in Integrated mode for this tool to work. A full set of install instructions is listed here along with the installation files. It installs pretty easily.

What do you get?

In short, you get detailed metrics on each page and javascript file in your site. When access a site with the AjaxView profile tools installed, all metric information is automatically being recorded. You can then access a web site on your local machine that is installed when AjaxView is installed. (Something like http://localhost/AjaxView).

When you do that, you can view the session profiles you have created (or the default one that is created for you on install). Something like this:

image

Select any of the files on the right which constitute all the files access by your web app (either a page or javascript file). Select the ‘Get profile data’ button and it launches Visual Studio and provides the profile metric data so that you can view it within Visual Studio. You end up getting access to detailed multiple views like the ones shown below:

image

image

image

All in all, a pretty useful tool to look at your Javascript performance. I recommend you take a look. Get it from here.

Regaining results from a performance test run
Wednesday, April 29, 2009 11:48 PM

I have been doing a lot of performance testing lately, and one of the worst things that can happen during a performance run, is when you don’t get any results. Performance testing is expensive, from a time and resources perspective, so getting results from a run is paramount.

In my scenario, I have everything automated to kick off a performance run, at 7.00pm every night, run for 12 hours, then terminate. I collect metrics via Visual Studio Team Suite which is used to drive my performance tests, but I also have automated the collection of performance metrics on all related servers (web, sql etc…)

On one of my recent runs, I came into the office in the morning, and checked on the test rig. The test appeared to be still running, even well beyond the termination time. VSTS reported that it was trying to abort the test, but things were still running. Some of the test agents refused to respond.

I pressed the stop button to stop the test in VSTS and while I was waiting for that, loaded up the test results so far. The business were eagerly awaiting the results of the tests and it looked promising so far.

Visual Studio began to refuse to respond after a while and was continuing to try and stop the test. After a long wait, I simply killed off the devenv.exe process, and restarted the Visual Studio Test controller service.

I then went to load my test data from the run. Oh dear, the test run that I was looking at not more than half an hour ago, did not appear. Nothing listed on the ‘Completed Tests’ tab, and nothing within the ‘Manage Test Results’ option either.

Crap. A business person walks by and asks how the test run went. “Still analysing the data” was my response. Double crap. What to do.

After looking at the SQL database where the load results are stored, it was apparent there was a bunch of data in there, that simply was not showing. Looking through the raw data did not appeal to me very much.

I had a look in the ‘LoadTest’ table in the LoadTest database I was using to see if there was any data.

image

I noticed there was no ‘End Time’ defined for my run. It was simply set to NULL

image

. The Start Date was correct, so I simply copied the StartTime to the EndTime column, changed the date to the next day, and set the time to AM instead of PM (thus setting my 12 hour run).

image

And now I have normal access to all my test results. Whew…. crisis averted.

Hope this helps someone.

by Glav | with no comments
More Posts Next page »

This Blog

Syndication