SQL Server Performance Tuning

23
SQL Server Performance Tuning

description

SQL Server Performance Tuning. ABOUT ME. Aditya Badramraju Twitter: http://twitter.com/@aditya_feb22 Blog: http://adityabadramraju.wordpress.com. Agenda. SQL Server Performance Tuning Overview CPU Input/output Memory Conclusion. Slow Performance !!!. U DBA!! - PowerPoint PPT Presentation

Transcript of SQL Server Performance Tuning

Page 1: SQL Server Performance Tuning

SQL Server Performance Tuning

Page 2: SQL Server Performance Tuning

ABOUT ME

Aditya BadramrajuTwitter:http://twitter.com/@aditya_feb22Blog:http://adityabadramraju.wordpress.com

Page 3: SQL Server Performance Tuning

Agenda SQL Server Performance Tuning Overview CPU Input/output Memory Conclusion

Page 4: SQL Server Performance Tuning

Slow Performance !!!U DBA!!I want

application run in rocket speed

Page 5: SQL Server Performance Tuning

So How Do I Do

Monitor

Troubleshoot/

Get the Victim

Tune Test

Implement

Page 6: SQL Server Performance Tuning

Monitoring

Analyze

Collect

Compare

Page 7: SQL Server Performance Tuning

Identify

Measure

Dig in to details

Troubleshoot/Get the victim

Page 8: SQL Server Performance Tuning

TuneCorrect it!

Optimize it!

Change your

approach

Page 9: SQL Server Performance Tuning

Test and Implement

Page 10: SQL Server Performance Tuning

Get the victim!!The victim for performance majorly lies in any of

these areasCPUIOMemoryTemp DB Bottle NecksPoor Indexing ,query writing and maintenance

Page 11: SQL Server Performance Tuning

CPUCheck the Task ManagerCheck Perfmon CountersIf SQL Server is responsible for high CPU find

the session which is consuming the CPUDig in to details of the sessionsFind the CPU costing queries If the environment is OLTP beware of

MAXDOP

Page 12: SQL Server Performance Tuning
Page 13: SQL Server Performance Tuning

IODMV sys.dm_os_wait_stats is the best thing

which says you are at IO crunchPerfmon counters such as Diskreads/Sec,

Diskwrites/Sec, IO queue also gives clear picture in this front.

When you found IO as culpritSpread the data into different drivesCheck the queries which costs high Logical IOCheck for DISK Defragmentation and Index

Fragmentation

Page 14: SQL Server Performance Tuning
Page 15: SQL Server Performance Tuning

MemoryWe can get the very first glance of it through

Task ManagerPerfmon Counters like Page Life Expectancy,

Buffer Cache Hit Ratio, Memory Grants Pending, Free Pages

Page file configuration on the serverAdhoc QueriesPoor Query WritingIncorrect Memory SettingsLock of Memory Pages in 32 Bit System.

Page 16: SQL Server Performance Tuning
Page 17: SQL Server Performance Tuning

TEMPDB Bottle NecksIts used more than What we normally thinkIt is responsible for all Sorts, Hashes, DBCC,

Index Rebuilds and more.The bottle necks of TEMPDB are due to

Incorrect tempdb configurationIncorrect usage of temporary variablesUnnecessary Sorts on major tables etc.

Page 18: SQL Server Performance Tuning

Poor Indexing and maintenance

The above said problems are inter related and basic problems will bePoor Query writing like using joins(Not

appropriately of course ),Cursors, triggers etc.

Having huge index fragmentation and huge page density

No update for statisticsAnd lastly not having a Dedicated DBA

(ATLAST I HAVE SAID THAT )!!!!

Page 19: SQL Server Performance Tuning
Page 20: SQL Server Performance Tuning
Page 21: SQL Server Performance Tuning
Page 22: SQL Server Performance Tuning

AcknowledgementsPaul Randal –SQL SKILLSAdam Machanic-MicrosoftSQL Server Internals by KalenPinal Dave –SQL AuthoritySQL PASS and all SQL Organizations

Page 23: SQL Server Performance Tuning

LAST WORDI like to MAD

and U???

……