?
Solved

DB server CPU 100%

Posted on 2011-02-10
4
Medium Priority
?
662 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
4 Comments
 
LVL 28

Accepted Solution

by:
strickdd earned 800 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 800 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 400 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

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

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

Ever wondered why sometimes your SQL Server is slow or unresponsive with connections spiking up but by the time you go in, all is well? The following article will show you how to install and configure a SQL job that will send you email alerts includ…
In part one, we reviewed the prerequisites required for installing SQL Server vNext. In this part we will explore how to install Microsoft's SQL Server on Ubuntu 16.04.
Using examples as well as descriptions, and references to Books Online, show the documentation available for date manipulation functions and by using a select few of these functions, show how date based data can be manipulated with these functions.
Via a live example combined with referencing Books Online, show some of the information that can be extracted from the Catalog Views in SQL Server.

718 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