views:

96

answers:

2

We want to time how long certain actions run for in an ASP.NET MVC application. We're using ActionFilters to start and stop a timer each time a contoller action is invoked. The result is a small dataset a bit like this:

{
   ContollerName: 'Account',
   ActionName: 'Index',
   ExecutionDuration: 287,
   TimeRecorded: '2009-07-02 17:34:54'
}

We want to beam this data off to a Web service so that we can collect and later analyse it. For example, we could find out that Account/Index is the slowest action in the application.

The thing is, if we're getting 1,000 requests per second, making 1,000 service calls per second isn't very clever; it will harm application performance.

Is there any way of doing buffered service calls? Or are there any libraries out there for doing this? Or is our architecture all wrong!?

Thoughts appreciated.

A: 

You could create a controller with an action that can take those four values and simply hit your own site and in that controller queue up the information to a database. Then have a different process batch submit the information to you web service.

jvanderh
+2  A: 

I don't usually just link answers to questions here, but the guy at whiletrue.com did a really good job of profiling MVC here. His slide show covers just about everything he did to set it up.

http://blog.whiletrue.com/2009/04/aspnet-mvc-performance/

Dusda
Very interesting link, thanks!
Colin Desmond
That is an awesome resource, nice one! It doesn't quite answer my question, because we still want to collect this kind of operational data rather than running ab.exe for benchmarking.
Tobin Harris