블로그 이미지
010-9967-0955 보미아빠

카테고리

보미아빠, 석이 (500)
밥벌이 (16)
싸이클 (1)
일상 (1)
Total
Today
Yesterday

달력

« » 2024.3
1 2
3 4 5 6 7 8 9
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28 29 30
31

공지사항

최근에 올라온 글

worker thread

카테고리 없음 / 2016. 8. 7. 13:17

declare @session_limit int 

declare @current_worker_cnt int

declare @session_current int 

declare @max_worker_threads int 

select @session_limit = cast(value_in_use as int) from sys.configurations where name = 'user connections'

select @max_worker_threads = cast(value_in_use as int) from sys.configurations where name = 'max worker threads'

select @session_current = count(*) from sys.dm_exec_sessions 

select @current_worker_cnt = count(*) from sys.dm_os_workers 

select 

  @session_limit session_limit

, @session_current current_session_cnt 

, @max_worker_threads max_worker_thread

, @current_worker_cnt current_worker_cnt

, s.scheduler_id

, quantum_used

, is_preemptive

, context_switch_count

, state

, w.last_wait_type

, processor_group

, tasks_processed_count

, w.task_address

, t.session_id 

, se.original_login_name

, se.host_name

, se.program_name 

, r.command 

, r.cpu_time

, r.total_elapsed_time

, r.reads

, r.writes

, r.logical_reads 

, r.sql_handle

, r.query_hash 

, q.dbid

, q.text 

from sys.dm_os_workers w

join sys.dm_os_schedulers s

on w.scheduler_address = s.scheduler_address 

left join sys.dm_os_tasks t

on t.task_address = w.task_address

left join sys.dm_exec_sessions se

on t.session_id = se.session_id

left join sys.dm_exec_requests r 

on se.session_id = r.session_id 

outer apply 

    ( 

    select top 1 * from sys.dm_exec_sql_text (sql_handle) 

    ) q

where r.command is not null

order by quantum_used desc 

Posted by 보미아빠
, |

최근에 달린 댓글

최근에 받은 트랙백

글 보관함