Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

SQL 2012 using excessive CPU usage

Posted on 2014-07-30
3
Medium Priority
?
254 Views
Last Modified: 2014-09-02
Hi Experts,

I have noticed my SQL 2012 server is running between 87-95% CPU usage. The environment is a Windows Server 2012 with SQL 2012 standard installed, the server is not used for anything else other than VPN occasionally. We only have one instance running and the CPU is a 3.4GHz Quad Core Xeon and task manager is reporting SQLSERVER using all the CPU.

I would like to identify where this is being used, weather there is a leak or it is legitimate and i need a secondary CPU.

Look forward to reading your solutions.
0
Comment
Question by:isdd2000
3 Comments
 
LVL 13

Expert Comment

by:duncanb7
ID: 40228606
You check the CPU usage  from  command of "taskmgr.exe" and click "resource monitor"
at the performance tab.

You could download the MS ProcessExplorer to look into more in detail at this
site to find which process is getting high cpu usage, http://technet.microsoft.com/en-us/sysinternals/bb896653.aspx

Duncan
0
 
LVL 17

Accepted Solution

by:
Barry Cunney earned 1500 total points
ID: 40228611
Hi
You can use the following SQL to identify what exactly is running in SQL Server - this will give a picture of the workload being carried out in SQL server and may give some ideas on the CPU usage
SELECT 
Hostname
,nt_username
,program_name
,sp.login_time 
,qt.text AS [Parent Query]
,sp.cpu
,sp.memusage 
,sp.physical_io 
,er.total_elapsed_time
,session_Id AS [Spid]
,er.blocking_session_id 
,er.granted_query_memory 
,er.start_time 
,ecid
,DB_NAME(sp.dbid) AS [Database]
,er.status
,er.wait_resource 
,wait_type
,SUBSTRING (qt.text, (er.statement_start_offset/2) + 1, --#1
((CASE WHEN er.statement_end_offset = -1
THEN LEN(CONVERT(NVARCHAR(MAX), qt.text)) * 2
ELSE er.statement_end_offset
END - er.statement_start_offset)/2) + 1) AS [Individual Query]
,nt_domain
FROM sys.dm_exec_requests er --#2
INNER JOIN sys.sysprocesses sp ON er.session_id = sp.spid
CROSS APPLY sys.dm_exec_sql_text(er.sql_handle)as qt
WHERE session_Id > 50
AND session_Id NOT IN (@@SPID)
ORDER BY sp.cpu DESC

Open in new window

0
 

Author Closing Comment

by:isdd2000
ID: 40300240
Issue ended up related to debug logging
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Windows Server 2003 introduced persistent Volume Shadow Copies and made 2003 a must-do upgrade.  Since then, it's been a must-implement feature for all servers doing any kind of file sharing.
A new hacking trick has emerged leveraging your own helpdesk or support ticketing tools as an easy way to distribute malware.
Using examples as well as descriptions, and references to Books Online, show the documentation available for datatypes, explain the available data types and show how data can be passed into and out of variables.
This tutorial will walk an individual through the steps necessary to join and promote the first Windows Server 2012 domain controller into an Active Directory environment running on Windows Server 2008. Determine the location of the FSMO roles by lo…

783 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question