Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SQL Server 2008 - Transaction per second for specific database

Does any one know how to measure the SQL transactions per second for a specifc database in SQL Server 2008?

like image 256
izip Avatar asked Feb 16 '11 17:02

izip


People also ask

How do I get TPS in SQL?

Is there any way to calculate TPS (transaction per second) of SQL Server database? You can use the "Batch Requests/sec." PMON counter (under the SQL Statistics category) for an overall measure of database requests processed per second.

How many inserts per second can SQL Server handle?

On decent "commodity hardware" (unless you invest into high performance SSDs) this is about what you can expect: SQLite: 30 inserts/s. MySQL: 80 inserts/s.

What is batch request per second SQL Server?

The Batch Requests/sec (in some literature referred as Batch Requests per Second) metric is SQL Server performance that provides information about the number of SQL batches SQL Server received in one second.

What is performance counter in SQL Server?

It's gathering the list of performance objects available on that server. Each server will have different lists of performance objects depending on what software is installed on that server: for example, SQL Server 2016 offers a different set of counters than SQL Server 2008.


1 Answers

DECLARE @cntr_value bigint

SELECT @cntr_value = cntr_value
    FROM sys.dm_os_performance_counters
    WHERE counter_name = 'transactions/sec'
        AND object_name = 'SQLServer:Databases'
        AND instance_name = 'YourDatabase'

WAITFOR DELAY '00:00:01'

SELECT cntr_value - @cntr_value
    FROM sys.dm_os_performance_counters
    WHERE counter_name = 'transactions/sec'
        AND object_name = 'SQLServer:Databases'
        AND instance_name = 'YourDatabase'
like image 96
Joe Stefanelli Avatar answered Sep 21 '22 13:09

Joe Stefanelli