Solved

DB server CPU 100%

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

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

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

International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
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 different Recovery Models available in SQL Server and explain, as well as show how full, differential and transaction log backups are performed
Viewers will learn how to use the SELECT statement in SQL and will be exposed to the many uses the SELECT statement has.

617 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