Monday, October 18, 2010

Performance and loading testing WCF services with JMeter

JMeter is great for performance and load testing WCF services. It's a free Java app available for download here - http://jakarta.apache.org/site/downloads/downloads_jmeter.cgi.

JMeter has numours components available to create a test plan such as
  • logic controllers, which allows you define conditions when requests are sent (e.g. every 2nd thread make a request using this web request).
  • timers, define the stand down period before a thread will make another request
  • assertions, parse the response to assert that the request was successful
  • listeners, various ways to display the response data received by JMeter.
An example on how to create a web service test plan using JMeter is available here - http://jakarta.apache.org/jmeter/usermanual/build-ws-test-plan.html

EDIT: I've created a new post on how to set up with a CSV data set.

Wednesday, October 13, 2010

Troubleshooting AppFabric

Just a quick tip on where to start to help out trouble shooting AppFabric. The error messages displayed with AppFabric aren't very explicit - however a lot of info is logged in the Application Server-System Services Admin event log. This is available in the Event Viewer under Application and Services Logs --> Microsoft --> Windows -->Application Server-Applications.

Make sure the log is enabled by right clicking on the Admin node and selecting Enable Log.

No monitoring data displayed in the AppFabric dashboard

One thing to keep in mind when viewing the monitoring events in AppFabric is that AppFabric uses the user account (that is the user that is viewing the logs), rather than the account that the website's AppPool is running under (the service account) to authenticate to the underlying monitoring SQL Server database.
So each user that needs to use AppFabric will have to have the appropriate rights to the Monitoring database in order to view the events logged. (i.e. be a member of a group which is a member of the Monitoring database's ASMonitoringDbReader database role).

This had me stumped for a while as I confirmed that the events where being processed by the AppFabric ETW service as they were appearing in the staging table - ASStagingTable, and the SQL job was moving them into the events table - ASWcfEventsTable.

However, they weren't being displayed when I viewed them in AppFabric. Unfortunately AppFabric doesn't give much info as to why the events are not being displayed apart from "The specified database is not a valid Monitoring database or is not available.", "Object reference not set to an instance of an object." & "No connection string". Nothing about any login failing, and the connection string hasn’t changed, and other user accounts could view the events.

Fortunately I checked out the Services pane in AppFabric where you can select the Monitoring Statistics tab, and when I selected it I received the following error:
The specified database is not a valid Monitoring database or is not available.
Cannot open database "ApplicationServerMonitoring" requested by the login. The login failed.
Login failed for user ‘[domain\user]'