Useful command line tools while performance testing


Finding the optimal performance for a BizTalk configuration can be hard and time consuming. There are a lot of possible configurations and adaptable settings. Performance testing is a matter of starting tests over and over again using different sets of parameters. Before a new test is started the servers should be reinitialized to make sure every test will have the same starting point. I found the below command line tools and commands very useful when doing this. I created a script to automate this initialization process so that boring manual work before each test is minimal.

First some obvious commands:

net stop “BizTalk Service BizTalk Group : BizTalkServerApplication”

net start “BizTalk Service BizTalk Group : BizTalkServerApplication”

iisreset /stop

iisreset /start

Use these commands to respectively:

  • stop host instance
  • start host instance
  • stop IIS
  • start IIS

PSService

PSService.exe makes it easy to start and stop services on remote systems. If you for example want to stop or start the SQL Server agent on a remote SQL server hosting the BizTalk databases you can use:

psservice.exe \\MySqlServer stop SQLServerAgent

psservice.exe \\MySqlServer start SQLServerAgent

PSService is part of the SysInternals toolkit and can be downloaded from here

Clear event logs

I also wanted to start my tests with clear and clean eventlogs. I found the WMI ‘Clear event log’ script by Mark Fairpo for this purpose. To clear event logs I used this command:

ClearEvt.wsf Application Security System

Performance monitoring

To be able to monitor and see test results after the has finished we need to define some counter logs in performance monitor. Those logs store performance counter information during the test. Examples are memory usage, network usage, BizTalk spool table, etc, etc. You can start and stop those logs from the command line using the logman.exe tool.

The commands are:

Logman.exe Stop “BizTalk Performance Counters”

Logman.exe Start “BizTalk Performance Counters”

This will stop and start the counter log named “BizTalk Performance Counters”

Clear Messagebox and Tracking databases

Finally it is very important to start each test with a clean messagebox and tracking database. You easily achieve this by executing the following query:

USE BizTalkMsgBoxDb
GO

EXEC dbo.bts_CleanupMsgbox
GO

USE BizTalkDTADb
GO

exec dbo.dtasp_CleanHMData
GO

Be aware that the first mentioned stored procedure doesn’t do anything by default (it is an empty stored procedure). You need to load it the first time from the file ‘msgbox_cleanup_logic.sql’ located in the ‘Schema’ sub folder of the BizTalk program folder. Also be careful with the parameters you provide to this stored procedure. If you use the wrong parameters all subscriptions will be wiped and you’ll have redeploy all BizTalk applications.

If you put the above SQL statements in a script you use it from the command line, like:

sqlcmd.exe -S MySqlServer -i d:\testscripts\init_bts_db.sql

I hope these commands are useful to other people too.

About these ads

One Response to Useful command line tools while performance testing

  1. […] Useful command line tools while performance testing « BizTalk Messages This entry was posted in BizTalk, Development, Tipps. Bookmark the permalink. ← SQL Azure – MSDN Documentation twendz – a cool twitter mining application → […]

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

%d bloggers like this: