1

I am load-testing a WCF service with NetTcpBinding. To do so, I have a unit test which makes call to the service and asks for X number of data results and I use this unit test in a loadtest(Visual Studio 2010).

The problem is I do not know a way to find out what is the maximum throughput of the service. I keep changing the number of users/clients in the loadtest and try to see if I am getting results any faster. Is there any better way to do it?

sjj
  • 25
  • 7

1 Answers1

1

If you want to measure performance of your WCF service, you may want to use a built-in mechanism called performance counters. It allows you to add some diagnostic intructions in you code like increasing the counter and later view the results in a perfmon.exe tool. More information on http://msdn.microsoft.com/en-us/library/ms735098.aspx.

I suppose you can use it to test how fast the service is responding to a specific number of clients to find the maximum throughput.

Lukasz M
  • 5,635
  • 2
  • 22
  • 29
  • I tried to follow the document you suggested but could not start the service after adding system.serviceModel to app.config file. Error 1053 : 'Windows could not start the service on local computer'. I have admin rights on the machine. – sjj Jul 20 '12 at 20:31
  • Try to add it to the web.config of the application instead. Some more details on your current configuration could be helpful. – Lukasz M Jul 20 '12 at 21:01
  • We have custom configuration in which we use TCP duplex binding. With elevated privileges we managed to enable the perf counters and able to see them in PerfMon. However, now I am struggling to find out exactly which counter to use to find out throughput from a very big list of counters! – sjj Jul 23 '12 at 16:22
  • I'm not if it's what you want, but maybe take a look at *Service* and *Operation* performance counters types. However, you may also want to look at this similar thread about WCF load testing: http://stackoverflow.com/questions/221973/load-testing-wcf-service-hosted-on-iis?rq=1. – Lukasz M Jul 23 '12 at 20:40
  • I have checked out the link you suggested. And I have been observing the Service and Operation Performance counters in PerfMon. I guess, what I don't understand here is exactly which factors contribute for a throughput of WCF service. Pardon my ignorance, but could you please explain a little on things i should be looking for calculating the throughput? I think there is a little more to it than just counting how many clients/sec my service can handle before it crashes. – sjj Jul 24 '12 at 21:39
  • Increasing number of users/sec and seeing when service have it's peak in performance is one of the ways to do it. I suggested using counters, because it allows you to use perfmon, which provides a nice preview of data gathered. However, I suppose the service shouldn't crash when a max number of users is reached (rather slow down). If it crashes (i.e. refuses connections), a limit in configuration may be exceeded. Make sure they are set properly. If you need more info about those limits, take a look at this link: http://chrisoldwood.blogspot.com/2010/03/wcf-service-refusing-connections.html. – Lukasz M Jul 25 '12 at 06:12
  • 1
    Thanks Lukasz for the suggestion. What I have decided now is to have a trend analysis for test execution time and user/sec load. And after monitoring the trend for a month or so I can come up with a number of user/sec that gives the best performance of our service. Probably that can be regarded as the max throughput supported by the system. – sjj Aug 06 '12 at 15:41