|
|
|
Valued Member
      
Group: General Forum Members
Last Login: Monday, April 29, 2013 1:59 AM
Points: 53,
Visits: 101
|
|
HI,
SQL SERVER CPU Usage shoots up to 100 % even at a time when user is not accessing application or any other background application. CPU usage keep flaunting very quickly it vary from 3 % to 100 %. If user start accessing application it stick at 100%.
It is SQL Server 2012.
Server Configuration. Windows Server 2008 R2 RAM :- 32 GB Physical Memory:- 500 GB
All other services are disable like SQL Reporting Services, Full text Search, SQL Agent and SQL analysis Services.
I have run the profile when cpu usage was close to 100%. And i saw there were Audit Login, Audit Logout, RPC completed and in text data sp_reset_connections.
I found very less query being executed by application. And "Audit Logout" was most time consuming process, some time was taking more than 2 seconds. I am not sure why Audit Logout taking so much time.
|
|
|
|
|
SSC-Dedicated
           
Group: General Forum Members
Last Login: Today @ 9:01 PM
Points: 33,111,
Visits: 27,037
|
|
Sure... open task manager and see what's using all of that CPU. If it IS actually SQL Server, then you probably have a "busted spid" trying to do a "forever rollback". If not, then you'll have to figure out what the other programs are doing.
--Jeff Moden "RBAR is pronounced "ree-bar" and is a "Modenism" for "Row-By-Agonizing-Row".
First step towards the paradigm shift of writing Set Based code: Stop thinking about what you want to do to a row... think, instead, of what you want to do to a column."
For better, quicker answers on T-SQL questions, click on the following... http://www.sqlservercentral.com/articles/Best+Practices/61537/
For better answers on performance questions, click on the following... http://www.sqlservercentral.com/articles/SQLServerCentral/66909/
|
|
|
|
|
Valued Member
      
Group: General Forum Members
Last Login: Monday, April 29, 2013 1:59 AM
Points: 53,
Visits: 101
|
|
I have checked the CPU usage and found all the CPU are usage by SQLSERVER. I ran the query to see the CPU utilization summary and found in 100% 95-98 % CPU is consumed by SQL and rest by other process.
NOt able to understand what to do next?
|
|
|
|
|
Mr or Mrs. 500
      
Group: General Forum Members
Last Login: Today @ 3:57 AM
Points: 529,
Visits: 1,042
|
|
hi, can you please send the query to find the cpu utiliZation
Thanks & Regards NAGA.ROHITKUMAR
|
|
|
|
|
SSC-Dedicated
           
Group: General Forum Members
Last Login: Today @ 4:18 PM
Points: 38,062,
Visits: 30,359
|
|
|
|
|
|
Old Hand
      
Group: General Forum Members
Last Login: Today @ 12:57 PM
Points: 343,
Visits: 1,089
|
|
run sp_whoisactive or sp_who2 to find out what that sessions are doing. What procedure is on event "RPC Completed" and how much cpu it is using? Try to execute that procedure yourself.
_____________________________________________________ XDetails Addin - for SQL Developers and DBA blog.sqlxdetails.com - Transaction log myths - debunked!
|
|
|
|
|
SSCrazy
      
Group: General Forum Members
Last Login: Thursday, June 13, 2013 7:03 AM
Points: 2,562,
Visits: 3,453
|
|
try these queries
-- Find queries that take the most CPU overall SELECT TOP 50 ObjectName = OBJECT_SCHEMA_NAME(qt.objectid,dbid) + '.' + OBJECT_NAME(qt.objectid, qt.dbid) ,TextData = qt.text ,DiskReads = qs.total_physical_reads -- The worst reads, disk reads ,MemoryReads = qs.total_logical_reads --Logical Reads are memory reads ,Executions = qs.execution_count ,TotalCPUTime = qs.total_worker_time ,AverageCPUTime = qs.total_worker_time/qs.execution_count ,DiskWaitAndCPUTime = qs.total_elapsed_time ,MemoryWrites = qs.max_logical_writes ,DateCached = qs.creation_time ,DatabaseName = DB_Name(qt.dbid) ,LastExecutionTime = qs.last_execution_time FROM sys.dm_exec_query_stats AS qs CROSS APPLY sys.dm_exec_sql_text(qs.sql_handle) AS qt ORDER BY qs.total_worker_time DESC -- Find queries that have the highest average CPU usage SELECT TOP 50 ObjectName = OBJECT_SCHEMA_NAME(qt.objectid,dbid) + '.' + OBJECT_NAME(qt.objectid, qt.dbid) ,TextData = qt.text ,DiskReads = qs.total_physical_reads -- The worst reads, disk reads ,MemoryReads = qs.total_logical_reads --Logical Reads are memory reads ,Executions = qs.execution_count ,TotalCPUTime = qs.total_worker_time ,AverageCPUTime = qs.total_worker_time/qs.execution_count ,DiskWaitAndCPUTime = qs.total_elapsed_time ,MemoryWrites = qs.max_logical_writes ,DateCached = qs.creation_time ,DatabaseName = DB_Name(qt.dbid) ,LastExecutionTime = qs.last_execution_time FROM sys.dm_exec_query_stats AS qs CROSS APPLY sys.dm_exec_sql_text(qs.sql_handle) AS qt ORDER BY qs.total_worker_time/qs.execution_count DESC
-------Bhuvnesh---------- While 1 = 1 (Learning SQL....) Click to get fast response of your post
|
|
|
|
|
SSCrazy
      
Group: General Forum Members
Last Login: Thursday, June 13, 2013 7:03 AM
Points: 2,562,
Visits: 3,453
|
|
Also verify blocked processes if any
SELECT spid ,sp.STATUS ,loginame = SUBSTRING(loginame, 1, 12) ,hostname = SUBSTRING(hostname, 1, 12) ,blk = CONVERT(CHAR(3), blocked) ,open_tran ,dbname = SUBSTRING(DB_NAME(sp.dbid),1,10) ,cmd ,waittype ,waittime ,last_batch ,SQLStatement = SUBSTRING ( qt.text, er.statement_start_offset/2, (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 ) FROM master.dbo.sysprocesses sp LEFT JOIN sys.dm_exec_requests er ON er.session_id = sp.spid OUTER APPLY sys.dm_exec_sql_text(er.sql_handle) AS qt WHERE spid IN (SELECT blocked FROM master.dbo.sysprocesses) AND blocked = 0
-------Bhuvnesh---------- While 1 = 1 (Learning SQL....) Click to get fast response of your post
|
|
|
|
|
Valued Member
      
Group: General Forum Members
Last Login: Monday, April 29, 2013 1:59 AM
Points: 53,
Visits: 101
|
|
| CPU start consuming 100% in this case i run even a simple select command, it also take time..i have checked the query that are consuming most CPU time. I need to track the reason that shoots up CPU usage. If it is 100 % consuming, every query run very slow.
|
|
|
|
|
SSCrazy
      
Group: General Forum Members
Last Login: Thursday, June 13, 2013 7:03 AM
Points: 2,562,
Visits: 3,453
|
|
purushottam2 (1/28/2013) CPU start consuming 100% in this case i run even a simple select command, it also take time..i have checked the query that are consuming most CPU time. I need to track the reason that shoots up CPU usage. If it is 100 % consuming, every query run very slow. have you checked the Sp_who2
-------Bhuvnesh---------- While 1 = 1 (Learning SQL....) Click to get fast response of your post
|
|
|
|