Solved

SQL 2012 using excessive CPU usage

Posted on 2014-07-30
3
245 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 500 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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Suggested Solutions

The recent Microsoft changes on update philosophy for Windows pre-10 and their impact on existing WSUS implementations.
Why pager replacement is still an issue OnPage has what some might call a “hate/hate” relationship with pagers. Not much room for love. As we see it, pagers are an antiquated bit of technology. Pagers are dinosaurs which, like most dinosaurs, sho…
Via a live example, show how to set up a backup for SQL Server using a Maintenance Plan and how to schedule the job into SQL Server Agent.
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…

777 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