SlideShare una empresa de Scribd logo
1 de 27
Optimizing SQL Server 2008
    For blazing fast SharePoint sites
Randy Williams
           • Enterprise Trainer & Evangelist
           • Based in San Diego, CA
           • SharePoint MVP alum (2009 – 2011)
           • Speaker at many global conferences
• 20+ years in IT
  ●   Developer, consultant, trainer, author
• Columnist: SharePoint Pro magazine
• randy.williams@avepoint.com
• @tweetraw
Agenda

•   Quick review of database basics
•   Optimize the server
•   Optimize tempdb
•   Optimize Content DBs
•   Scaling out
•   Best Practices
Quick Review of Database Basics

• Each database consists of
  ●    One or more data files (.mdf, .ndf)
  ●    One or more log files (.ldf)
• When changes occur
  1.       Log is written to first
  2.       Checkpoint process commits changes to
           data files
       •     In simple recovery inactive transaction in log is
             truncated
How SharePoint Uses SQL

• One configuration DB per farm
• Each web app has one or more content
  DBs
  ●   Container for site collections
  ●   All SharePoint content, including files, is
      stored in content DB
• Service application databases
  ●   Search databases are usually most important
      when optimizing
The Most Important Factors

1. RAM
2. CPU
3. Storage
  ●   SAN is best for performance (greatest IOPS)
  ●   Work with your storage vendor when configuring
      Logical Unit Numbers (LUNs)
4. Network
Optimize the DB Server

• Do not run non-SQL apps on SQL Server
• Dedicate SQL Server to one SharePoint
  Farm
• If virtualizing
  ●   Virtualize WFE and app servers first
  ●   SQL can be virtualized, but it will affect
      performance
Optimize the SQL Instance

• Adjust database default locations
  ●   Never place on C: drive
  ●   Log and data on separate LUNs/physical
      disks
• Adjust server memory settings if running
  multiple instances
• Use 64KB allocation units when formatting
  data and log partitions
Demo

OPTIMIZING SQL SERVER
Optimizing tempdb

• Pre-size – set to 25% of largest DB
• Use AutoGrow of ~100MB – if growing,
  increase initial size
• Use multiple data files of same size –
  latest guidance is ¼ - 1 per physical CPU
  ●   Each file on a separate LUN, if possible
  ●   Store log on its own LUN
• Use RAID 1+0
When working with a SharePoint DB

• Do not do any of following
  ●   Do not add, change or remove any built-in objects
      (tables, views, stored procedures, triggers, indexes)
  ●   Do not directly select from tables or views
  ●   Change the database collation

• Logging DB is the only exception
After creating a content DB

• Add multiple files of same size to primary
  file group
  ●   Ideally: count should equal # of cores per
      NUMA node (ask your hardware vendor if
      unsure)
• If DB is expected to grow large – pre-size
  the data files
  ●   Set autogrow between 50-100MB per file
• Preset log to about 25%
  ●   Set autogrow between 20-40MB
Optimizing content DBs
   • Very active content DBs should be placed
     on their own LUNs
   • Use RAID 5 or RAID 1+0
   • In most cases, keep size < 200GB
       ●   Why? Recovery and performance reasons
       ●   Use site collection quotas
       ●   Don’t forget about the 2nd stage recycle bin
       ●   Use PowerShell to create site collections -
           store in specific content DB
For more, see http://slidesha.re/t1xnxD
Why are larger DBs slower?

• Read queries take longer
  ●   More rows to filter, group and sort
• Write queries take longer
• Increased lock contention
  ●   Causes more blocking
• More data, but data cache same size
• DB maintenance takes longer
  ●   reindex
  ●   dbcc checkdb
Demo

SIZE AFFECTS PERFORMANCE
Book giveaway

• What is the recommended size when
  configuring tempdb?
Achieving storage performance

• Storage array (RAID 1+0)
  ●   10 300GB SAS drives, 15k RPM
  ●   1.5 TB effective space
  ●   ~1500 IOPS = 1.0 IOPS/GB
• Set of drives (RAID 1+0)
  ●   4 750GB SATA drives, 10k RPM
  ●   1.5 TB effective space
  ●   ~300 IOPS = 0.2 IOPS/GB
• Go with higher quality storage
  ●   SAS > SATA ; SAN > DAS
Scaling storage

• Multiple storage arrays (RAID 1+0)
• Break out into multiple LUNs
• Add additional data files to DB, one per
  array
                                F:SP_DocCenter_1.mdf
• Advice                        G: SP_DocCenter_2.ndf
                                                                 Data
   ●   Many smaller drives >           H: SP_DocCenter_3.ndf
                                        I: SP_DocCenter_4.ndf
       fewer larger ones
                                        J: SP_DocCenter.ldf     Log
   ●   RAID 1+0 > RAID 5
Optimizing Search DBs

• Max of 25 million items per each crawl and
  property DB
• Store crawl and property DBs on separate,
  dedicated LUNs
• Add data files to match Content DBs
• Use RAID 1+0 storage
• Consider storing on dedicated SQL server
Scaling out for performance

• For large, high-performance farms, scale
  out to multiple SQL servers
• No limit to the number of servers – each
  database can have its own
  ●   Best practice is to break out across some
      logical boundary (web app, service apps, etc.)
• Using clustered SQL servers?
  ●   Consider using instances and make each
      instance active on a separate physical node
Reindexing DBs

• Fragmentation happens by design –
  primary key uses GUID columns
• Indexes are rebuilt daily as part of health
  analyzer job
• No manual reindex needed
  ●   Do not drop and recreate indexes
RBS Guidance

  • Consider using in document-heavy databases
  • Trade off
       ●   Storage cost & performance benefits versus
       ●   More complex architecture (support, DR, HA)
  • Consider third party providers
       ●   More full-featured solutions
  • In general
       ●   Do not externalize documents <1MB
       ●   Ideal number varies widely
For more, see bit.ly/v4iMMm
Best Practices

• Use SQL 2008 R2 Enterprise for best performance
• Backup logs regularly to prevent runaway log files
• Do not use autoshrink
   ●   Shrink manually only when needed
• Do not use multiple file groups
   ●   Not supported by SharePoint
• Run database integrity checks
• Use Instant File Initialization
   ●   http://bit.ly/bRhdgH
Book giveaway

• What are the three primary types of
  databases that SharePoint uses?
Questions?
  randy.williams@avepoint.com
  http://linkd.in/plEEb1
  @tweetraw
Victory Lap- social event
  "SharePoint Victory Lap" Social Event for
     SPSLA will be at: 5:30pm to 8pm at
Di Piazzas (5205 E. Pacific Coast Hwy, 90804)
We want your feedback!
                   Use this QR code or visit:
                   http://sps.la/feedback

                   Silver Sponsors:

Más contenido relacionado

Último

Último (20)

Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of Brazil
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 

Destacado

How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
ThinkNow
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
Kurio // The Social Media Age(ncy)
 

Destacado (20)

Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
 
Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work
 

Optimizing SQL Server 2008 for Blazing-fast SharePoint Sites

  • 1. Optimizing SQL Server 2008 For blazing fast SharePoint sites
  • 2. Randy Williams • Enterprise Trainer & Evangelist • Based in San Diego, CA • SharePoint MVP alum (2009 – 2011) • Speaker at many global conferences • 20+ years in IT ● Developer, consultant, trainer, author • Columnist: SharePoint Pro magazine • randy.williams@avepoint.com • @tweetraw
  • 3. Agenda • Quick review of database basics • Optimize the server • Optimize tempdb • Optimize Content DBs • Scaling out • Best Practices
  • 4. Quick Review of Database Basics • Each database consists of ● One or more data files (.mdf, .ndf) ● One or more log files (.ldf) • When changes occur 1. Log is written to first 2. Checkpoint process commits changes to data files • In simple recovery inactive transaction in log is truncated
  • 5. How SharePoint Uses SQL • One configuration DB per farm • Each web app has one or more content DBs ● Container for site collections ● All SharePoint content, including files, is stored in content DB • Service application databases ● Search databases are usually most important when optimizing
  • 6. The Most Important Factors 1. RAM 2. CPU 3. Storage ● SAN is best for performance (greatest IOPS) ● Work with your storage vendor when configuring Logical Unit Numbers (LUNs) 4. Network
  • 7. Optimize the DB Server • Do not run non-SQL apps on SQL Server • Dedicate SQL Server to one SharePoint Farm • If virtualizing ● Virtualize WFE and app servers first ● SQL can be virtualized, but it will affect performance
  • 8. Optimize the SQL Instance • Adjust database default locations ● Never place on C: drive ● Log and data on separate LUNs/physical disks • Adjust server memory settings if running multiple instances • Use 64KB allocation units when formatting data and log partitions
  • 10. Optimizing tempdb • Pre-size – set to 25% of largest DB • Use AutoGrow of ~100MB – if growing, increase initial size • Use multiple data files of same size – latest guidance is ¼ - 1 per physical CPU ● Each file on a separate LUN, if possible ● Store log on its own LUN • Use RAID 1+0
  • 11. When working with a SharePoint DB • Do not do any of following ● Do not add, change or remove any built-in objects (tables, views, stored procedures, triggers, indexes) ● Do not directly select from tables or views ● Change the database collation • Logging DB is the only exception
  • 12. After creating a content DB • Add multiple files of same size to primary file group ● Ideally: count should equal # of cores per NUMA node (ask your hardware vendor if unsure) • If DB is expected to grow large – pre-size the data files ● Set autogrow between 50-100MB per file • Preset log to about 25% ● Set autogrow between 20-40MB
  • 13. Optimizing content DBs • Very active content DBs should be placed on their own LUNs • Use RAID 5 or RAID 1+0 • In most cases, keep size < 200GB ● Why? Recovery and performance reasons ● Use site collection quotas ● Don’t forget about the 2nd stage recycle bin ● Use PowerShell to create site collections - store in specific content DB For more, see http://slidesha.re/t1xnxD
  • 14. Why are larger DBs slower? • Read queries take longer ● More rows to filter, group and sort • Write queries take longer • Increased lock contention ● Causes more blocking • More data, but data cache same size • DB maintenance takes longer ● reindex ● dbcc checkdb
  • 16. Book giveaway • What is the recommended size when configuring tempdb?
  • 17. Achieving storage performance • Storage array (RAID 1+0) ● 10 300GB SAS drives, 15k RPM ● 1.5 TB effective space ● ~1500 IOPS = 1.0 IOPS/GB • Set of drives (RAID 1+0) ● 4 750GB SATA drives, 10k RPM ● 1.5 TB effective space ● ~300 IOPS = 0.2 IOPS/GB • Go with higher quality storage ● SAS > SATA ; SAN > DAS
  • 18. Scaling storage • Multiple storage arrays (RAID 1+0) • Break out into multiple LUNs • Add additional data files to DB, one per array F:SP_DocCenter_1.mdf • Advice G: SP_DocCenter_2.ndf Data ● Many smaller drives > H: SP_DocCenter_3.ndf I: SP_DocCenter_4.ndf fewer larger ones J: SP_DocCenter.ldf Log ● RAID 1+0 > RAID 5
  • 19. Optimizing Search DBs • Max of 25 million items per each crawl and property DB • Store crawl and property DBs on separate, dedicated LUNs • Add data files to match Content DBs • Use RAID 1+0 storage • Consider storing on dedicated SQL server
  • 20. Scaling out for performance • For large, high-performance farms, scale out to multiple SQL servers • No limit to the number of servers – each database can have its own ● Best practice is to break out across some logical boundary (web app, service apps, etc.) • Using clustered SQL servers? ● Consider using instances and make each instance active on a separate physical node
  • 21. Reindexing DBs • Fragmentation happens by design – primary key uses GUID columns • Indexes are rebuilt daily as part of health analyzer job • No manual reindex needed ● Do not drop and recreate indexes
  • 22. RBS Guidance • Consider using in document-heavy databases • Trade off ● Storage cost & performance benefits versus ● More complex architecture (support, DR, HA) • Consider third party providers ● More full-featured solutions • In general ● Do not externalize documents <1MB ● Ideal number varies widely For more, see bit.ly/v4iMMm
  • 23. Best Practices • Use SQL 2008 R2 Enterprise for best performance • Backup logs regularly to prevent runaway log files • Do not use autoshrink ● Shrink manually only when needed • Do not use multiple file groups ● Not supported by SharePoint • Run database integrity checks • Use Instant File Initialization ● http://bit.ly/bRhdgH
  • 24. Book giveaway • What are the three primary types of databases that SharePoint uses?
  • 25. Questions? randy.williams@avepoint.com http://linkd.in/plEEb1 @tweetraw
  • 26. Victory Lap- social event "SharePoint Victory Lap" Social Event for SPSLA will be at: 5:30pm to 8pm at Di Piazzas (5205 E. Pacific Coast Hwy, 90804)
  • 27. We want your feedback! Use this QR code or visit: http://sps.la/feedback Silver Sponsors:

Notas del editor

  1. v4iMMm