x
login about faq Site discussion (meta-askssc)

cpu utilization

Good Morning , From task manager noticed CPU utilization for sqlserver.exe is 90%.We are using sql server 2008. How to understand which sql process is occupying that 90% of CPU volume? is there any query ? command? dmv? on which database it can be run to understand 90% of CPU utilized by which processess?

Can you please advise

Thank you

more ▼

asked Sep 18 '12 at 07:57 AM in Default

pits gravatar image

pits
830 43 74 83

You can use this DMV :)

SELECT TOP 10 (total_worker_time * 1.0) / 1000000 AS CPU_Utilized_in_Seconds, text,* FROM sys.dm_exec_query_stats CROSS APPLY sys.dm_exec_sql_text(sql_handle)

Sep 18 '12 at 11:59 AM SumitRana
(comments are locked)
10|1200 characters needed characters left

2 answers: sort voted first

I use the query below in relation to using Process explorer.

SELECT 
 r.session_id, st.text, qp.query_plan, r.status, os_thread_id
FROM 
 sys.dm_os_threads AS ot
 JOIN sys.dm_os_tasks AS t ON t.worker_address = ot.worker_address
 JOIN sys.dm_exec_requests AS r ON t.session_id = r.session_id
 CROSS APPLY sys.dm_exec_sql_text(r.sql_handle) AS st
 CROSS APPLY sys.dm_exec_query_plan(r.plan_handle) AS qp

A video from Jonathan that will walk you through it is here (saved me a few times - thanks!)

I work with 2 monitors, so that you can have PE in one windows showing the tread that is consuming high CPU and the query in the other windows with the related SQL.

more ▼

answered Sep 18 '12 at 08:37 AM

sp_lock gravatar image

sp_lock
8.1k 20 26 29

(comments are locked)
10|1200 characters needed characters left

You can use this DMV :)

SELECT TOP 10 (total_worker_time * 1.0) / 1000000 AS CPU_Utilized_in_Seconds, text,* FROM sys.dm_exec_query_stats CROSS APPLY sys.dm_exec_sql_text(sql_handle)

more ▼

answered Sep 18 '12 at 12:00 PM

SumitRana gravatar image

SumitRana
180 4 5 8

(comments are locked)
10|1200 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments



Facebook logo Follow Ask SSC on Facebook
Find Ask SSC on Google+
linkedin logo Find us on LinkedIn

Topics:

x4

asked: Sep 18 '12 at 07:57 AM

Seen: 320 times

Last Updated: Sep 18 '12 at 12:00 PM

Copyright © 2002-2012 Simple Talk Publishing. All Rights Reserved. If you have any queries, please contact the site administrators.
Ask SQL Server Central is a community service provided by Red Gate.