<img height="1" width="1" style="display:none;" alt="" src="https://dc.ads.linkedin.com/collect/?pid=1005900&amp;fmt=gif">

Insights

JMeter Instance on Cloud to Inject Load Against SQL Azure

So, you want to set-up load injection capabilities on the Amazon EC2 cloud to throw load against a Microsoft SQL Azure database?

This quick tutorial will show you how to do the following:

  • Setting up Apache JMeter (version 2.4 as of this post) on the Amazon EC2 Cloud
  • Setting up appropriate JDBC drivers
  • Setting the correct connection attributes to be able to successfully connect to the Microsoft SQL Azure database

Setting up Apache JMeter on an Amazon EC2 instance

The following instructions should work on any EC2 instance. I used a standard Server 2008 R2 x64 AMI.

Firstly, download the JMeter file and extract it somewhere local like your C drive.
Next, run the jmeter.bat file located in the /bin directory.

if you get a 'java is not a recognised' error or something similar, make sure you have the latest JDK installed. You may also need to add the JDK bin directory to the Windows environmental paths (this was not automatically done on the instance I was setting up)

Setting up the appropriate JDBC drivers

For JMeter to be able to connect to a Microsoft SQL Azure database, you need to provide JMeter the correct JDBC drivers (which are quite specific) to work with.

The JDBC driver you need is provided directly by Microsoft.

After you have downloaded the JDBC driver package, extract it and place the files named below in the JMeter/lib directory (make sure you retrieve the files relevant to the instance architecture... i.e., 32bit vs. 64bit):

  • sqljdbc4.jar (found in the 'Microsoft SQL Server JDBC Driver 3.0sqljdbc_3.0enu' directory)
  • sqljdbc_auth.dll (found in the 'Microsoft SQL Server JDBC Driver 3.0sqljdbc_3.0enuauth' directory)
  • sqljdbc_xa.dll (found in the 'Microsoft SQL Server JDBC Driver 3.0sqljdbc_3.0enuxa' directory)

Rename sqljdbc4.jar to sqljdbc.jar so that JMeter will recognise it as a JDBC driver.

That should be all!

Setting up the connection attributes

Once you have set-up JMeter and successfully installed the JDBC drivers for SQL Azure connectivity, you are ready to set-up the connection strings in JMeter for connectivity.

The below configuration is used in the JMeter 'JDBC Connection Configuration' configuration element; these are the settings JMeter will use to connect to your SQL Azure database.

Database URL: jdbc:sqlserver://<serverName>.database.windows.net;databaseName=<databaseName>

JDBC Driver class: com.microsoft.sqlserver.jdbc.SQLServerDriver

Username: username@serverName

Password: yourPassword

That should be it... you should now be able to successfully connect and inject load to your SQL Azure database :)

  • There are no suggestions because the search field is empty.