Measure Transactions Per Second in SQL Server

Performance Monitor tool in SQL Server represents aspects of system performance, such as CPU Usage % , Memory Paging etc. The sys.dm_os_performance_counters Dynamic Management View exposes data of all performance counters for the particular instance of SQL Server. This view is extremely useful when you have to present the performance data of your database in your dashboard.

We have touched upon the usefulness of the sys.dm_os_performance_counters in my previous post Removing Deprecated Code and Future Proofing your Queries. In this post, we will see another use of the sys.dm_os_performance_counters view to measure SQL transactions per second for a database. Here’s a very handy query written by Joe Stefanelli

Suprotim has received the prestigous Microsoft MVP award for nine times in a row now. In a professional capacity, he is the CEO of A2Z Knowledge Visuals Pvt Ltd, a digital group that represents premium web sites and digital publications comprising of Professional web, windows, mobile and cloud developers, technical managers, and architects.

6 comments:

Anonymous
said...

I'm a bit puzzled by this. As I understand it, you are getting the transactions per second from one database, waiting a second, and then and subtracting this from the transactions per second from another database. The MSDN description for the counter is 'Number of transactions started for the database per second.' so why would you need to calculate the difference in TPS between two different databases (or even the same one) after a second?

HI, Need some info on transaction per second. What it actually means, Transaction occuring in sql in the given interval. What is the meaning of transaction here? Is it the number of threads on which CPU is working OR number of fragments created by Cores and doing parallel processing OR Count of rows which it is processing or Data blocks or sizes which is being processed or page reads per sec or JObs/triggers working at the back picture.

What all it considers in the TERM TRANSACTION. Can you please help me in this?