SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


High CPU with many DB connections Prod almost down


High CPU with many DB connections Prod almost down

Author
Message
Minaz Amin
Minaz Amin
SSCrazy
SSCrazy (2.8K reputation)SSCrazy (2.8K reputation)SSCrazy (2.8K reputation)SSCrazy (2.8K reputation)SSCrazy (2.8K reputation)SSCrazy (2.8K reputation)SSCrazy (2.8K reputation)SSCrazy (2.8K reputation)

Group: General Forum Members
Points: 2784 Visits: 1750
Hi All,

We are facing 95- 96 % CPU hike on our pord server. SQL Server 2008 R2 SP1 with 8 CPU and 36 GB mem.

We have hybris applications and sometime we notice there will be heavy DB connetions and CPU spike to above 90% . during that time we observe deadloack and SOS_SCHEDULAR wait.

We took out expensive queries and that was tunes and used a new sql plan. But after 3 hours same query became once again the expensive one.

I was refering and assuming if this is bug with CPU spin lock.

Any input this is critical and makes the serevr down. Please advice.

"More Green More Oxygen !! Plant a tree today"
Keith Tate
Keith Tate
SSCrazy
SSCrazy (2.4K reputation)SSCrazy (2.4K reputation)SSCrazy (2.4K reputation)SSCrazy (2.4K reputation)SSCrazy (2.4K reputation)SSCrazy (2.4K reputation)SSCrazy (2.4K reputation)SSCrazy (2.4K reputation)

Group: General Forum Members
Points: 2360 Visits: 979
Minaz (2/6/2014)
We took out expensive queries and that was tunes and used a new sql plan. But after 3 hours same query became once again the expensive one.

How was performance after you tuned the query? Did the CPU drop? Also, what do you mean "used a new sql plan"? Did you provide it a Plan Guide?
It sounds like the expensive queries need to have another round of performance enhancements. If you are having issues with improving performance on the expensive queries post them here and someone should be able to help you with them.

I was refering and assuming if this is bug with CPU spin lock.
I wouldn't think there was an issue with the spin locks. I would first try to improve the queries you mentioned first and rule that out.



Microsoft Certified Master - SQL Server 2008
Follow me on twitter: @keith_tate

Forum Etiquette: How to post data/code on a forum to get the best help
Lowell
Lowell
SSC Guru
SSC Guru (73K reputation)SSC Guru (73K reputation)SSC Guru (73K reputation)SSC Guru (73K reputation)SSC Guru (73K reputation)SSC Guru (73K reputation)SSC Guru (73K reputation)SSC Guru (73K reputation)

Group: General Forum Members
Points: 73699 Visits: 40974
if it went a way after altering the proc, and then came back after a few hours, i'd start suspecting that stale statistics were affecting performance of the existing plans;

if you look at the tables used by the proc, are any of them MillionBillionRow tables and have a large amount of insert/updates/deletes to them?
can you update statstics for the tables used by teh proc and see if there is an immediate improvement?

Lowell
--help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!
Minaz Amin
Minaz Amin
SSCrazy
SSCrazy (2.8K reputation)SSCrazy (2.8K reputation)SSCrazy (2.8K reputation)SSCrazy (2.8K reputation)SSCrazy (2.8K reputation)SSCrazy (2.8K reputation)SSCrazy (2.8K reputation)SSCrazy (2.8K reputation)

Group: General Forum Members
Points: 2784 Visits: 1750
Yes I will be updating table stat today , this is a million rows heap table. we had done a rubild indexing but did noit helped last week

As per the application vendor , its their design not to have cluster PK on the table instead all the tables are non cluster PK.

This query will run from the app spawing more than 300 connections to the DB and makes lots of SOS_schedular_yeild and making CPU almost 95%. We have to restart the app to get it normal.

Please let me have the plan of action?

"More Green More Oxygen !! Plant a tree today"
SQLRNNR
SQLRNNR
SSC Guru
SSC Guru (67K reputation)SSC Guru (67K reputation)SSC Guru (67K reputation)SSC Guru (67K reputation)SSC Guru (67K reputation)SSC Guru (67K reputation)SSC Guru (67K reputation)SSC Guru (67K reputation)

Group: General Forum Members
Points: 67835 Visits: 18570
Ok, it's not a terrible thing that they don't have clustered PKs.

Do they have any clustered indexes in the database at all?

You mentioned that the app has to be restarted to get things to return to normal. Have you investigated the app server for memory leaks as well as performance issues?



Jason AKA CirqueDeSQLeil
I have given a name to my pain...
MCM SQL Server, MVP


SQL RNNR

Posting Performance Based Questions - Gail Shaw

Minaz Amin
Minaz Amin
SSCrazy
SSCrazy (2.8K reputation)SSCrazy (2.8K reputation)SSCrazy (2.8K reputation)SSCrazy (2.8K reputation)SSCrazy (2.8K reputation)SSCrazy (2.8K reputation)SSCrazy (2.8K reputation)SSCrazy (2.8K reputation)

Group: General Forum Members
Points: 2784 Visits: 1750
No do not have cluster indexes the tables are over 90% fragmented. I am also continuously seeing deadloack
before the outage with High CPU and many user connections.

What is your input why there are so many connections raising high cpu and deadloack

"More Green More Oxygen !! Plant a tree today"
SQLRNNR
SQLRNNR
SSC Guru
SSC Guru (67K reputation)SSC Guru (67K reputation)SSC Guru (67K reputation)SSC Guru (67K reputation)SSC Guru (67K reputation)SSC Guru (67K reputation)SSC Guru (67K reputation)SSC Guru (67K reputation)

Group: General Forum Members
Points: 67835 Visits: 18570
On the affected server, what is the power setting within windows?

What is the power saving mode set to in the BIOS?


If power saving is enabled in the BIOS you could see these symptoms you are describing.

If Windows is not set to "High Performance" (within the power configuration in control panel) you could see these symptoms.

Then the next item would be to identify the queries running at the time cpu starts to spike and tune those.



Jason AKA CirqueDeSQLeil
I have given a name to my pain...
MCM SQL Server, MVP


SQL RNNR

Posting Performance Based Questions - Gail Shaw

Minaz Amin
Minaz Amin
SSCrazy
SSCrazy (2.8K reputation)SSCrazy (2.8K reputation)SSCrazy (2.8K reputation)SSCrazy (2.8K reputation)SSCrazy (2.8K reputation)SSCrazy (2.8K reputation)SSCrazy (2.8K reputation)SSCrazy (2.8K reputation)

Group: General Forum Members
Points: 2784 Visits: 1750
this is something new to learn. I am curious to know what all these settings. I will check and update you.


Meantime , I have asked them to add cluster index on the topmost affected queries.

"More Green More Oxygen !! Plant a tree today"
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search