Wednesday, September 10, 2008

Peformance Testing with BizUnit and Load Gen

I was creating Automated performance testing to implement for my client, with tools like loadgen and BizUnit.

Tools used for Testing

LoadGen (BizTalk Server 2004 Load Generation Tool) - I am using the earlier version of LoadGen 2007 as the assemblies supplied for 2007 are not strong named.

BizUnit - To automate the test.

Nunit - Framework to run the test that created in BizUnit.

Performance Monitor (perfmon) - to analyse the log created in the testing.


LoadGen is a load generating tool. which can used for test the performance of integration Application

There were three components in loadgen
Load generators are responsible for transmitting messages via a particular transportCurrently it supports the following transport (In-Box)
File,HTTP,MQSeries
MSMQLarge,MSMQ,SOAP,
Web Services Enhancements (WSE),
Windows SharePoint Services (WSS),
Windows Communication Foundation (WCF) (LoadGen 2007 Version has)

Now a Question comes up can we extend to other transports ? the answer is YES you can

Message creators are an optional component that can be used when you need to
generate messages that contain unique data.

Throttle controllers ensure that messages are transmitted at a steady rate by
governing the load generators

you can find more details here

Performance Monitor(PerfMon) will be used as an anlysis tool . which can read the performance log file and give us a nice view on performance.

BizUnit is an framework to automate the test used to automate the test.
- Initialise the test like restarting the service, clearing the
message box in BizTalk.
- call the loadgen to create the load for the system.
- Invoke the performance monitor and log the details.
- Wait for all the message got processed and stop the test.
- Cleanup the system like stoping the monitor, remove any messages from the transport etc.


for more details on BizUnit check out in
http://www.codeplex.com/bizunit

NUnit is a tool to invoke the BizUnit tests.
For more on NUnit
http://www.nunit.org/index.php

I hope I have given a berief introduction, Let try out small scenario

Its a Simple File To File Scenario, where BizTalk receive file from a File location and Send it to another File location



Size of the file is 10 KB
Number of Message to send is 1000. I dont have any expected performance, Just want to know how my bizTalk Server Perform


Step 1 Construction of LoadGen Config File
We need to define
LoadGenerator - Here it is File transport, need to tell what is the lot size and total message
Message Creator - I dont need to invoke the component,as I am gonna replicate the same message
Throttle controller - I have used file monitor such that the thresholdrange is 40-50 Files.
Sample Configuration

<LoadGenFramework>
<CommonSection>
<LoadGenVersion>2</LoadGenVersion>
<OptimizeLimitFileSize>204800</OptimizeLimitFileSize>
<NumThreadsPerSection>5</NumThreadsPerSection>
<SleepInterval>200</SleepInterval>
<LotSizePerInterval>5</LotSizePerInterval>
<RetryInterval>10000</RetryInterval>
<StopMode Mode="Files">
<NumFiles>1000</NumFiles>
<TotalTime>3600</TotalTime>
</StopMode>
<Transport Name="FILE">
<Assembly>C:\Program Files\LoadGen\Bins\FileTransport.dll/FileTransport.FileTransport</Assembly>
</Transport>
<ThrottleController Mode="Custom">
<Monitor Name="File">
<Assembly>C:\Program Files\LoadGen\Bins\FileMonitor.dll/DropLocationFileMonitor.DropLocationFileMonitor</Assembly>
<ThresholdRange>40-50</ThresholdRange>
<SleepInterval>1000</SleepInterval>
<Parameters>C:\Picloc</Parameters>
</Monitor>
<ThrottleCondition>File</ThrottleCondition>
</ThrottleController>
</CommonSection>
<Section Name="FileSection">
<SrcFilePath>C:\TestData\test001.txt</SrcFilePath>
<DstLocation>
<Parameters>
<DstFilePath>C:\Picloc</DstFilePath>
</Parameters>
</DstLocation>
</Section>
</LoadGenFramework>
Step 2: Incorporating in BizUnit
Requirement is you need to run the test automatically, generate a log and analyse the result Whenever required.
As you now Performance Monitor(Perfmon) will help you to achieve this.
01. Restart the required host instance and messagebox
02. create the Location where you want to log the file
03. use PerfmonCountersStep to start the performance monitor and log the result the location mentioned
04. use LoadGenExecuteStep to run LoadGen tests
05 Stop the test when all the message has been sent. use PerfMonCounterMonitorStep to monitor the handler which send the message till it hit the target number of message
Step 04. Run the Test using Nunit
Step 05. Analyse the Result


My BizTalk Server performance on this scenario 
In an average it receive  4.993 Message/Sec and Send 4.993 Message/Sec

You have lot of other counters are there for you to select and analyse... for more on this toplic click here


2 comments:

  1. Is there a way to generate WCF load using BizUnit and LoadGen? I know that LoadGen 2004 doesn't have WCF support, but that is what is needed to work with BizUnit.

    ReplyDelete
  2. I also had the same question in my mind.

    Well I think we need to wait for the next version of LoadGen. Hopefully strong named version.

    I am trying to find a way, if I found I will let you know

    ReplyDelete