We are currently running MS SQL 8.0 on Windows 2003. I've been tasked setting up a monitor that can identify queries that are causing CPU spikes. Does anyone have any suggestions about going about this? I'm at a complete loss.
We are currently running MS SQL 8.0 on Windows 2003. I've been tasked setting up a monitor that can identify queries that are causing CPU spikes. Does anyone have any suggestions about going about this? I'm at a complete loss.
The Profiler can do this. Create a new trace using the SQLProfilerStandard trace template and add the CPU column. This will show both the query and the CPU time, plus some other stuff. If this is a super busy production server this can degrade performance so you might want to play with it on a test db instance first. I typically run it from my desktop or from a remote desktop and save the results to a local file cause if you write the result to the db you are monitoring it too can impact your findings. Netmon
Thanks for the tip! Do you know of any way to use this or some other utility to create an alert for administrators to receive when a query has risen above a certain threshold? I can see how I can filter the trace for CPU usage of a certain level, but I don't see how I could use that to create an alert. Any thoughts?
You can also use this query to see what's using the CPU - highest to lowest usage: SELECT * FROM master..sysprocesses ORDER BY cpu DESC Then, run this to see the actual query: DBCC INPUTBUFFER (spid) -- spid being the # in the spid column from the above query hth
You can also use the windows tool PerfMon on the server and set up your own custom traces which can viewed realtime or logged to files and replayed.
No the trace is not going to do that. I'v heard that NetIQ has a product that monitors for query execution but I'm not sure of the details on how it works. Like the other person (tootsuite) posted you could use perfmon however it does not take sustained thresholds, that is if CPU > 90% over 60 seconds then alert. So anytime the CPU is above your threshold it will alert even if it is a short lived spike you get alerted. I'm not sure the context within which you want to filter the trace to generate an alert. If you have any enterprise server monitoring tools like ProIT, MOM or Nimbus available you could just monitor the CPU via those and have it email your admin. Are you hoping to find the rogue/cpu intense queries in action? Or are you desiring to know when the CPU gets hammered so an admin can log in and kill the offending query or find out the user running it?
The first; trying to find rogue/cpu intense queries in action so we can identify not only the query causing the problem, but perhaps what else is occuring simultaneously that could be contributing to the high CPU situation. We have MOM, and it can alert us to CPU incidents, but I was hoping to find something that could single out the individual queries that are running to create the incident.
1.cpu & memory usage on large, long-running query
Hi there I'm not a SQL Server developer or power-user, mostly I do statistical and similar analysis on large datasets and use SQL Server to manage the underlying data. I notice that, on my IBM workstation, my CPU utilization doesn't rise much above 50% and my PF usage doesn't rise above 40% on large, long-running queries. I have a 3.4GHz Intel P4 processor with 1.25GB of RAM. Can I whip up the speed a bit, or if not what's the limiting factor? Best regards Loane
2.High CPU usage on FullText query
Hello FullText experts. I'm having some performance issues with my forum database and searching with fulltext. I'm generally getting CPU spikes to 100% for a few seconds at a time when a user performs a search. I suppose the problem is in my SQL or technique. SELECT Topics.TopicID, Topics.ForumID, Topics.Name, Topics.Title, Topics.LastPostTime, Topics.Replies, Topics.LastPostName, Forums.Title AS Forum, Topics.Views, Max([FreeText].Rank) AS RankMax FROM Topics INNER JOIN Forums ON Topics.ForumID = Forums.ForumID LEFT OUTER JOIN Posts ON Topics.TopicID = Posts.TopicID INNER JOIN FREETEXTTABLE(Posts,*,@TextISearchFor) AS [FreeText] ON [FreeText].[Key]=Posts.PostID GROUP BY Topics.ForumID, Topics.TopicID, Topics.Name, Topics.Title, Topics.LastPostTime, Topics.Replies, Forums.Title, Topics.LastPostName, Topics.Views ORDER BY Max([FreeText].Rank) DESC The intent here is to search a combination of Topics.Title and Posts.FullText (the two fields indexed) but only return one Topics.TopicID (records in Posts are constrained to Topic.TopicID, as you might suspect). I'm also looking to get the parent forum's title with each record. I'm obviously doing something here that is too much, and I've not been successful at making it faster. Any suggestions? -Jeff
3.VS.Net 2003 CPU Usage 100% if the Dynamic Query Contains More para
Hi Group, VS.Net 2003 CPU Usage 100% if the Dynamic Query Contains More parameters.In my case i got 14 Reportparameters it is taking long time to refresh the fields and run the query. Why is this happening.
4.High CPU -- identify which query ties up cpu
Hello, I'm running SQL2K enterprise, recently faced constant high cpu usage by sqlsrvr process. How can I identify which query or queries tie up cpu? I mean something more precise and comprehensible than cpu column in sp_who2. thanks for any help, Gary.
Access 2002 adp connected to SQL server, running through terminal services. When I execute any command through ADO (sample below), the cpu usage immediately jumps to 100% and stays there. Needless to say all other users (3-4) are dead in the water until the command is done. It occurs whether I am executing a stored procedure or passing a sql string. Any ideas? Dim cmd6 As ADODB.Command 6380 Set cmd6 = New ADODB.Command 6390 cmd6.ActiveConnection = cnnConnection 6400 cmd6.CommandText = "sp_WABillPrintUpdate" 6410 cmd6.CommandType = adCmdStoredProc 6420 cmd6.Parameters.Refresh 6430 cmd6.Parameters(1).value = Me!cboBillingGroup 6440 cmd6.Execute , , adAsyncExecute 6450 Do Until cmd6.state <> adStateExecuting 6460 Loop 6470 Set cmd6 = Nothing
Users browsing this forum: No registered users and 71 guest