Solved

DB server CPU 100%

Posted on 2011-02-10
4
646 Views
Last Modified: 2012-05-11
Experts -

The DB server CPU usage hitting 100% sometimes. I do see the some SQL running little longer at these times which runs quicker all the other time. But whenever we reset the WEB server the DB CPU also going down to 20% and stays at 20 for 4-5 hours.

Any idea where to look for the solution?

This is .net /SQL server app.

Thanks,

~sve
0
Comment
Question by:sventhan
4 Comments
 
LVL 28

Accepted Solution

by:
strickdd earned 200 total points
ID: 34864665
It sounds like there is a looping/unclosed connection in your code. I would verify that all loops have the connection objects specified and opened OUTSIDE the loop. Then make sure that all your connections have the .Close() method called. Sometimes you may be looping and calling a function that makes a connection so it might not be obvious so track down all the loops and scan all the functions the loops call.

If you don't find any of these then i would take a look at the queries being executed. It could be a deadlock being caused by an overly complex query. Lastly, I would check database triggers and make sure that they are set up properly and not causing issues.
0
 
LVL 40

Assisted Solution

by:lcohan
lcohan earned 200 total points
ID: 34864862
You should also chek your SQL log file for any entries that can lead to the CPU spike. BTW after a web server restart your object/data cache in SQL is also refreshed and maybe you need to look closer at your DB stats/missing indexes and bad query plans stuck in cache.
0
 
LVL 75

Assisted Solution

by:Anthony Perkins
Anthony Perkins earned 100 total points
ID: 34867979
Unfortunately, it sounds like you are sharing the same server for both web server and SQL Server.  This is no recommended, but if you have to do it, you will have to cripple SQL Server by setting the max memory it uses.
0
 
LVL 18

Author Closing Comment

by:sventhan
ID: 34887052
Thanks to you all. The problem is with some SQL (poorly written) update statements. This is getting executed more than wanted. I'm looking into this now.


@acperkins

We have 2 different servers.
0

Featured Post

Back Up Your Microsoft Windows Server®

Back up all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Question has a verified solution.

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

Suggested Solutions

Slowly Changing Dimension Transformation component in data task flow is very useful for us to manage and control how data changes in SSIS.
Load balancing is the method of dividing the total amount of work performed by one computer between two or more computers. Its aim is to get more work done in the same amount of time, ensuring that all the users get served faster.
Via a live example, show how to extract information from SQL Server on Database, Connection and Server properties
Via a live example, show how to setup several different housekeeping processes for a SQL Server.

733 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