Solved

DB server CPU 100%

Posted on 2011-02-10
4
609 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 39

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

Control application downtime with dependency maps

Visualize the interdependencies between application components better with Applications Manager's automated application discovery and dependency mapping feature. Resolve performance issues faster by quickly isolating problematic components.

Join & Write a Comment

In this article we will get to know that how can we recover deleted data if it happens accidently. We really can recover deleted rows if we know the time when data is deleted by using the transaction log.
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 backup a database, simulate a failure backup the tail of the database transaction log and perform the restore.

759 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

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now