SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Hardware or Bad Queries = Performance issues?


Hardware or Bad Queries = Performance issues?

Author
Message
kkanaya
kkanaya
SSC Veteran
SSC Veteran (222 reputation)SSC Veteran (222 reputation)SSC Veteran (222 reputation)SSC Veteran (222 reputation)SSC Veteran (222 reputation)SSC Veteran (222 reputation)SSC Veteran (222 reputation)SSC Veteran (222 reputation)

Group: General Forum Members
Points: 222 Visits: 599
Help Please!!

How can one identify whether performance issues on a SQL 2008 R2 server are being caused by Hardware or the queries being written inefficently?

I have looked at a lot of DMV data for a server and don't think particular issues are because of hardware. However what should I look at that would point me in the correct direction and can tackle the supplier to resolve the issues with their application?

Any advice on the above will be highly appreciated.

Thanking you for your help
Kailash.
MyDoggieJessie
MyDoggieJessie
SSCertifiable
SSCertifiable (6.7K reputation)SSCertifiable (6.7K reputation)SSCertifiable (6.7K reputation)SSCertifiable (6.7K reputation)SSCertifiable (6.7K reputation)SSCertifiable (6.7K reputation)SSCertifiable (6.7K reputation)SSCertifiable (6.7K reputation)

Group: General Forum Members
Points: 6670 Visits: 7394
What kind of hardware do you have running?

If you suspect bad queries, look for ones that have especially high reads/long durations, as these may be potentially missing indexes (insufficient indexes), check the server/query waits to see which are the highest. For instance, high PAGEIOLATCH_EX "may" indicate issues with the disk subsystem (hardware) because it's waiting to look up the page from the disk, CXPACKETS may indicate poorly written queries (or ones that have large table scans in them), and so forth.

This is such a loaded question, what specifically have you looked at?

FYI - if you're confident that your indexes are solid and your statistics are up-to-date, then most often you can dig deeper into the hardware configuration (RAM, spindles, etc)

______________________________________________________________________________
"Never argue with an idiot; They'll drag you down to their level and beat you with experience" ;-)
GilaMonster
GilaMonster
SSC Guru
SSC Guru (87K reputation)SSC Guru (87K reputation)SSC Guru (87K reputation)SSC Guru (87K reputation)SSC Guru (87K reputation)SSC Guru (87K reputation)SSC Guru (87K reputation)SSC Guru (87K reputation)

Group: General Forum Members
Points: 87205 Visits: 45271
When in doubt, assume bad queries and poor indexing.

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


MyDoggieJessie
MyDoggieJessie
SSCertifiable
SSCertifiable (6.7K reputation)SSCertifiable (6.7K reputation)SSCertifiable (6.7K reputation)SSCertifiable (6.7K reputation)SSCertifiable (6.7K reputation)SSCertifiable (6.7K reputation)SSCertifiable (6.7K reputation)SSCertifiable (6.7K reputation)

Group: General Forum Members
Points: 6670 Visits: 7394
@Gail +1,000,000 - that's 99% the case here at our shop :-)

______________________________________________________________________________
"Never argue with an idiot; They'll drag you down to their level and beat you with experience" ;-)
GilaMonster
GilaMonster
SSC Guru
SSC Guru (87K reputation)SSC Guru (87K reputation)SSC Guru (87K reputation)SSC Guru (87K reputation)SSC Guru (87K reputation)SSC Guru (87K reputation)SSC Guru (87K reputation)SSC Guru (87K reputation)

Group: General Forum Members
Points: 87205 Visits: 45271
MyDoggieJessie (12/21/2012)
For instance, high PAGEIOLATCH_EX "may" indicate issues with the disk subsystem (hardware) because it's waiting to look up the page from the disk, CXPACKETS may indicate poorly written queries (or ones that have large table scans in them), and so forth.


On the other hand, PageIOLatch waits may indicate queries that are requesting far too much data (table or index scans) and CXPacket may indicate that you have lots of queries benefiting from parallelism

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


scogeb
scogeb
SSC-Enthusiastic
SSC-Enthusiastic (186 reputation)SSC-Enthusiastic (186 reputation)SSC-Enthusiastic (186 reputation)SSC-Enthusiastic (186 reputation)SSC-Enthusiastic (186 reputation)SSC-Enthusiastic (186 reputation)SSC-Enthusiastic (186 reputation)SSC-Enthusiastic (186 reputation)

Group: General Forum Members
Points: 186 Visits: 420
GilaMonster (12/21/2012)
MyDoggieJessie (12/21/2012)
For instance, high PAGEIOLATCH_EX "may" indicate issues with the disk subsystem (hardware) because it's waiting to look up the page from the disk, CXPACKETS may indicate poorly written queries (or ones that have large table scans in them), and so forth.


On the other hand, PageIOLatch waits may indicate queries that are requesting far too much data (table or index scans) and CXPacket may indicate that you have lots of queries benefiting from parallelism


LOL, so those waits really don't tell a person much!

I've found some queries that tell me what's running when an issue arises. I also check the standard reports for top queries in regards to CPU and IO. Then you can try to work on those queries.

Does anyone else do anything other than that to find issues on servers if you're not even sure issues exist?
GilaMonster
GilaMonster
SSC Guru
SSC Guru (87K reputation)SSC Guru (87K reputation)SSC Guru (87K reputation)SSC Guru (87K reputation)SSC Guru (87K reputation)SSC Guru (87K reputation)SSC Guru (87K reputation)SSC Guru (87K reputation)

Group: General Forum Members
Points: 87205 Visits: 45271
scogeb (12/21/2012)
LOL, so those waits really don't tell a person much!


Well excessive PageIOLatch indicates that the IO subsystem is been driven harder than it can handle. Whether that's because too much is being asked or because the hardware is inadequate requires further investigation.

CXPacket just indicates that queries are running in parallel. It's a wait a lot of people misinterpret.

Try http://www.simple-talk.com/books/sql-books/troubleshooting-sql-server-a-guide-for-the-accidental-dba/, start with chapter 1.

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


MyDoggieJessie
MyDoggieJessie
SSCertifiable
SSCertifiable (6.7K reputation)SSCertifiable (6.7K reputation)SSCertifiable (6.7K reputation)SSCertifiable (6.7K reputation)SSCertifiable (6.7K reputation)SSCertifiable (6.7K reputation)SSCertifiable (6.7K reputation)SSCertifiable (6.7K reputation)

Group: General Forum Members
Points: 6670 Visits: 7394
Taking this with a grain of salt and the "it depends" answer, another way to see if you have disk contention is to track the average disk queue length for the disks - this can often tell you if the bottleneck is occurring within your disk subsystem (of course as Gail has already mentioned, always assume bad indexes/stats).

I've seen disk queuing become excessive when a query was performing hundreds (sometimes millions) of reads on a table due to an clustered index scan on a table with 30+ million rows. A little magical index tweaking later and the result was a 100% non-clustered index seek, and the reads went down to < 100K, and the disk queuing went significantly down.

Again, without knowing what your hardware architecture is, it's difficult to really help you out. Our suggestions could be night/day difference on a server with 4 spindles in a RAID 5 versus a server with a SAN containing 64 spindles. Performance in these cases (i.e. like where you should be concentrating your efforts), is relative.

______________________________________________________________________________
"Never argue with an idiot; They'll drag you down to their level and beat you with experience" ;-)
GilaMonster
GilaMonster
SSC Guru
SSC Guru (87K reputation)SSC Guru (87K reputation)SSC Guru (87K reputation)SSC Guru (87K reputation)SSC Guru (87K reputation)SSC Guru (87K reputation)SSC Guru (87K reputation)SSC Guru (87K reputation)

Group: General Forum Members
Points: 87205 Visits: 45271
MyDoggieJessie (12/21/2012)
Taking this with a grain of salt and the "it depends" answer, another way to see if you have disk contention is to track the average disk queue length for the disks


Sorry to pick on you today, but disk queue length is a near-meaningless counter these days. There's too much between the server and the disks to get a sensible interpretation of that counter (unless you're dealing with direct attached drives), plus SQL is designed to intentionally queue up multiple IOs, thus sending the queue length very high (read ahead reads).

The avg sec/read and avg sec/write are a lot easier to interpret and track

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


MyDoggieJessie
MyDoggieJessie
SSCertifiable
SSCertifiable (6.7K reputation)SSCertifiable (6.7K reputation)SSCertifiable (6.7K reputation)SSCertifiable (6.7K reputation)SSCertifiable (6.7K reputation)SSCertifiable (6.7K reputation)SSCertifiable (6.7K reputation)SSCertifiable (6.7K reputation)

Group: General Forum Members
Points: 6670 Visits: 7394
It's all good:-D I appreciate constructive criticism(s)

______________________________________________________________________________
"Never argue with an idiot; They'll drag you down to their level and beat you with experience" ;-)
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