0

We running a photo sharing website in Windows Server 2008 r2 ent edition & SQL Server 2008 r2 ent edition. Server configuration is xeon 5620 with 48GB RAM & 4 x 450GB 15k Scsi Hdd's.

we have about minimum 50 and max 500 active connections on DB as per last month average. Now also the average is same. 1 Month back our sql server cpu usage is less then 1% but now it's using minimum 25% and upto 100% always. This problem we are facing from last 8 days. From this last 8 days anwards our CPU usage is increasing always when we start SQL Service & when we stop it's normal only. I request you can any one tell me how to solve this problem.

Bangar
  • 45
  • 1
  • 1
  • 8
  • 2008 R2 - what is sql server busy with? Use the analysis dashboard to find out what the cpu is actually doing. Could be some stuck daabase check / repair that just takes long and restarting the server resets it to start? – TomTom Mar 08 '12 at 10:02
  • Even we restart DB server also prob is same. When we stop SQL server services then only cpu usage is normal. – Bangar Mar 08 '12 at 10:46
  • Did you read what I said? Surely when it is stuck reparnig the database tc. and you restart it it will always try again. Did you consider having a look at the sql server log to se what happens after the server starts? – TomTom Mar 08 '12 at 11:53

1 Answers1

1

agreed with TomTom, you have to get to the bottom of it. Good guess is lack/inaccurate indexing, it very often results with high CPU w/o high number of sessions. Check the information in your DMV's ( be careful though, they're just hints from SQL engine, should be analyzed by a trained professional ) :

SELECT
  migs.avg_total_user_cost * (migs.avg_user_impact / 100.0) * (migs.user_seeks + migs.user_scans) AS improvement_measure,
  'CREATE INDEX [missing_index_' + CONVERT (varchar, mig.index_group_handle) + '_' + CONVERT (varchar, mid.index_handle)
  + '_' + LEFT (PARSENAME(mid.statement, 1), 32) + ']'
  + ' ON ' + mid.statement
  + ' (' + ISNULL (mid.equality_columns,'')
    + CASE WHEN mid.equality_columns IS NOT NULL AND mid.inequality_columns IS NOT NULL THEN ',' ELSE '' END
    + ISNULL (mid.inequality_columns, '')
  + ')'
  + ISNULL (' INCLUDE (' + mid.included_columns + ')', '') AS create_index_statement,
  migs.*, mid.database_id, mid.[object_id]
FROM sys.dm_db_missing_index_groups mig
INNER JOIN sys.dm_db_missing_index_group_stats migs ON migs.group_handle = mig.index_group_handle
INNER JOIN sys.dm_db_missing_index_details mid ON mig.index_handle = mid.index_handle
WHERE migs.avg_total_user_cost * (migs.avg_user_impact / 100.0) * (migs.user_seeks + migs.user_scans) > 10
ORDER BY migs.avg_total_user_cost * migs.avg_user_impact * (migs.user_seeks + migs.user_scans) DESC
webdad3
  • 8,893
  • 30
  • 121
  • 223
  • Thank you Rafael & Tom based on your suggestion we did some research and found some temp solution and working on permanent solution. thank you very much to both of you. – Bangar Mar 09 '12 at 17:58