SQL Server 2012引入了一個新的performance counter, Batch Resp Statistics。這個counter的目的是to track SQL Batch Response times。這個counter下面有好幾檔如下: 具體就是: Batches =000000ms 000001ms Batches =000001ms 000002ms Batches =000002m
sql server 2012引入了一個新的performance counter, batch resp statistics。這個counter的目的是“to track sql batch response times”。這個counter下面有好幾檔如下:
具體就是:
Batches >=000000ms &
Batches >=000001ms &
Batches >=000002ms &
Batches >=000005ms &
Batches >=000010ms &
Batches >=000020ms &
Batches >=000050ms &
Batches >=000100ms &
Batches >=000200ms &
Batches >=000500ms &
Batches >=001000ms &
Batches >=002000ms &
Batches >=005000ms &
Batches >=010000ms &
Batches >=020000ms &
Batches >=050000ms &
Batches >=100000ms?????????????????????????????????????????????????????????????????????????????????????????????????????????????
這些檔的含義是怎樣的呢?假定對于Batches >=010000ms &
1)??? 如果batch (也就是一個request)的執行時間是10000ms 到20000ms之間的則計數
2)??? CPU time 和Elapsed time 的含義和sys.dm_exec_requests 里面的含義一致。 CPU time 就是 “請求所使用的 CPU 時間”, Elapsed time 就是“請求到達后經過的總時間”。 簡單說,CPU time就是batch request的CPU指令真正執行的時間,而Elapsed time 是指CPU時間加上等待的時間。比如當batch等待磁盤I/O,等待鎖(就是被阻塞了)的時候,Elapsed time就一般比CPU time 長。這里注意的是因為并發執行的關系,Elapsed time 有時候并不會就恒等于CPU time 加上等待時間,而是應該有些出入。
3)??? CPU time:Requests 指CPU time 在這個范圍內的batch request的總數。CPU time:total(ms)指CPU time 在這個范圍內的時間總和。Elapsed time:request 和 Elapsed time:requests 的含義類似。
4)??? ?這些counter的值是累計的。也就是說,會一直增加,直到SQL server 重啟。