Click here to monitor SSC
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


SQL Low performance only in afternoons


SQL Low performance only in afternoons

Author
Message
huum
huum
SSC Rookie
SSC Rookie (39 reputation)SSC Rookie (39 reputation)SSC Rookie (39 reputation)SSC Rookie (39 reputation)SSC Rookie (39 reputation)SSC Rookie (39 reputation)SSC Rookie (39 reputation)SSC Rookie (39 reputation)

Group: General Forum Members
Points: 39 Visits: 153
In one of our database, there is a stat about the whole day

: SQL CPU Usage spikes b/w 8AM & 6PM is 5 spikes - highest is 30% @ 3:52PM; longest b/w 29 to 30% b/w 3:52PM to 3:56PM – spike occurs same time every day


so i want to find out how to check on whats going wroing during after noon when its slowest?
laurie-789651
laurie-789651
SSC-Addicted
SSC-Addicted (424 reputation)SSC-Addicted (424 reputation)SSC-Addicted (424 reputation)SSC-Addicted (424 reputation)SSC-Addicted (424 reputation)SSC-Addicted (424 reputation)SSC-Addicted (424 reputation)SSC-Addicted (424 reputation)

Group: General Forum Members
Points: 424 Visits: 1271
Have you got SQL Agent jobs running on the server at those times?
huum
huum
SSC Rookie
SSC Rookie (39 reputation)SSC Rookie (39 reputation)SSC Rookie (39 reputation)SSC Rookie (39 reputation)SSC Rookie (39 reputation)SSC Rookie (39 reputation)SSC Rookie (39 reputation)SSC Rookie (39 reputation)

Group: General Forum Members
Points: 39 Visits: 153
Yes i do have many of them running,

what would be the fastest way to get the stats which jobs are most expensive?

Regards
laurie-789651
laurie-789651
SSC-Addicted
SSC-Addicted (424 reputation)SSC-Addicted (424 reputation)SSC-Addicted (424 reputation)SSC-Addicted (424 reputation)SSC-Addicted (424 reputation)SSC-Addicted (424 reputation)SSC-Addicted (424 reputation)SSC-Addicted (424 reputation)

Group: General Forum Members
Points: 424 Visits: 1271
If you've got SQL Agent jobs running at a certain time, it is to be expected that there will be a spike in memory usage then, so nothing's necessarily wrong.

If there is a problem, you may be able to spread the jobs out to even the load, or possibly run them overnight.

Looking for a simple solution - If you identify a problem time & there's only 1 job running, then that is the problem.

SQL Server doesn't keep stats about run durations etc by default - you need to generate them yourself. A good way is using Profiler. If you create a trace & run it for the period of interest, this can tell you which queries are slow. There's a lot of info about this on the web. Bear in mind that running a trace will add to the load on the server, so only run it when needed. A good source of information is "Mastering SQL Server Profiler" by Brad McGehee - see chapter 4 "How to identify slow-running queries".

You can download this book for free.

Try this:

download.red-gate.com/ebooks/SQL/Mastering_Profiler_eBook.pdf
george sibbald
george sibbald
SSCertifiable
SSCertifiable (6.3K reputation)SSCertifiable (6.3K reputation)SSCertifiable (6.3K reputation)SSCertifiable (6.3K reputation)SSCertifiable (6.3K reputation)SSCertifiable (6.3K reputation)SSCertifiable (6.3K reputation)SSCertifiable (6.3K reputation)

Group: General Forum Members
Points: 6324 Visits: 13687
is a spike of 30% actually causing you a problem?

If you really want to know the SQL causing the issue run a server side profiler trace (google that) and a perfmon trace over the same time frame.

when done you can run the profiler gui to display the trace and call the perfmon trace into the profiler gui, they will be displayed in tandem and you will be able to see exactly what was running when the CPU spiked.

---------------------------------------------------------------------
GilaMonster
GilaMonster
SSC-Forever
SSC-Forever (47K reputation)SSC-Forever (47K reputation)SSC-Forever (47K reputation)SSC-Forever (47K reputation)SSC-Forever (47K reputation)SSC-Forever (47K reputation)SSC-Forever (47K reputation)SSC-Forever (47K reputation)

Group: General Forum Members
Points: 47204 Visits: 44367
http://www.simple-talk.com/sql/performance/finding-the-causes-of-poor-performance-in-sql-server,-part-1/
http://www.simple-talk.com/sql/performance/finding-the-causes-of-poor-performance-in-sql-server,-part-2/


Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

We walk in the dark places no others will enter
We stand on the bridge and no one may pass


Jeff Moden
Jeff Moden
SSC-Forever
SSC-Forever (45K reputation)SSC-Forever (45K reputation)SSC-Forever (45K reputation)SSC-Forever (45K reputation)SSC-Forever (45K reputation)SSC-Forever (45K reputation)SSC-Forever (45K reputation)SSC-Forever (45K reputation)

Group: General Forum Members
Points: 45018 Visits: 39887
Just to add to what Laurie posted...

The dbo.sysjobhistory system table in MSDB does keep track of duration and both the job and the level. It certainly won't give you the other goodies that an SQL Provile run will give you but it give you a good place to start on long running jobs.

You can also get some pretty good information, a lot of which is also contained in SQL Profiler, from the sys.dm_exec_requests without actually running SQL Profiler. Of course, you do have to pay attention to recompiles and the times they occur but you can also isolate both the (for example) stored procedure and the part of the stored procedure using the most resources from that view.

--Jeff Moden

RBAR is pronounced ree-bar and is a Modenism for Row-By-Agonizing-Row.
First step towards the paradigm shift of writing Set Based code:
Stop thinking about what you want to do to a row... think, instead, of what you want to do to a column.
Although they tell us that they want it real bad, our primary goal is to ensure that we dont actually give it to them that way.
Although change is inevitable, change for the better is not.
Just because you can do something in PowerShell, doesnt mean you should. Wink

Helpful Links:
How to post code problems
How to post performance problems
Forum FAQs
huum
huum
SSC Rookie
SSC Rookie (39 reputation)SSC Rookie (39 reputation)SSC Rookie (39 reputation)SSC Rookie (39 reputation)SSC Rookie (39 reputation)SSC Rookie (39 reputation)SSC Rookie (39 reputation)SSC Rookie (39 reputation)

Group: General Forum Members
Points: 39 Visits: 153
Thanks That helped
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search