SlideShare a Scribd company logo
Forecasting Database Performance   Du  Shenglin June 6th 2011
What do Capacity do?Manager ask    “Can our database survive in next year or the new promotion program”?Performance Tuning != Capacity planningDBA  is not totally equal to Capacity Analyst
What do Capacity do?How Much headroom do we still have for further increasing, how many days can we hold without add/upgrade hardware?What’s the costs or impact to the site with adding or changing application codeWhat kind of platform/database/OS should we use for the new introduced applicationsHow to survive for the sudden performance deviations?
AgendaResourceModel and TheoryResponse Time AnalysisSteps to do Capacity AnalysisCase Study
Resource Site Level 	    Machine, License, database, Storage, Manpower…System Level 	    CPU, IO, Memory, Disk, Network, Kernel SettingsDatabase Level 	    Latch, Enqueue, Lock, Physical IO, Logical IO…
Modeling - Making the Complex Simple  The world is much too complex for us to understand. Mathematical ModelQueue theoryLine modelingRegression analysisUtilization BaselineModel is not perfect, not 100% precision
The Linear modeling
Linear Regression – Scalability
The Response Time CurveResponse Time=Service Time + Queue Time
Queuing TheoryRemain in the queue until its turn to be serviced Common FIFO or priority queueQueue lengthWait times and wait eventsCPU queue and IO queue
Response Time Drill DownResponse Time=Service Time + Queue TimeRt =St + QtCPUQueueNetworkTransferCPUUsr+SysMemoryQueueMemoryAccessDiskQueueDiskTransferNetworkQueue
Utilization and HeadroomHeadroom is available usable resources-Total Capacity minus Peak Utilization and Margin-Applies to CPU, RAM, Net, Disk and OS-Can be very complex to determine, it depends
CPU Capacity MeasurementsCPU utilization is defined as busy time divided by elapsed time for each CPUCPU time = CPU Queue + CPU usr+sysProcesses wait on a run queue, causing high load averages, then run on a CPU in user and system mode. More CPUs reduce queue wait. Faster CPUs reduce usr+sys time.
CPU Capacity MeasurementsU=Îť*St*MCPU Utilization=Arrival rate* cpu_time_exec(us)/POWER(10,6)/number_of_CPUCPU Utilization=buffer_gets* buffer_gets_time_per_exec(us)/POWER(10,6)/number_of_CPUWe can use this format for many cases
The Response Time Curve - Multiple CPU
IO Response Time ProfileRAM  60ns
HDD 5-10ms
SSD – 100 -500us
IO Service Time Includes 3 Components:	  - Access Time – Time It Takes To Move Heads To The Desired Track. 	   - Rotation Time – Time It Takes To Locate The Desired Sector on The Track.	    -Transfer Time – Time It Takes To Read/Write The DataAccess Time Constitutes 70% of The Service TimeIO Average Wait Time db file sequential read – less than 15 ms
 log file sync – less than 4msTrend Capacity MeasurementsSQL Execution Increase -> Traffic GrowthBuffer Gets Per Execution Fluctuates -> Normal Buffer ContentionsBuffer Gets Per Execution Increase Gradually -> SQL Efficiency ChangeCPU Increase Only -> System Overhead Increase, Latch Spinning…etcFind the commons during daily, weekly and yearly exexutions
Daily Executions
WoW Executions
YOY Executions
Data CollectionWhat kind of data to collectWhen to collect the dataWhere to put the dataHow often to collect the dataHow long to keep the dataHow to interpret and present the data    A Picture Is Worth A Thousand Words     Script and automate is necessary
Capacity Monitoring in database levelPeak executions SessionsShared pool usageLIO/execPIO/execCPU_time/LIORedo sizeFree memoryCommitsDisk space usage…..
Risk Mitigation StrategiesCapacity Analyst is not only DBATuning/fixing the issue  - DBA or SA’s task?Balancing existing workloadUpgrade and buy more CPU capacity Split and Sharding
Steps to take for Capacity Analysis1. Determine the question2. Gather workload data         	 - What, how and how often3. Characterize the workload data		- Map, Interpret the data	4. Develop and use appropriate model		-  Present your data, Graph5. Validate the forecast6. Forecast
Case Study #1 – Delete PerformanceQuestions:How many data can we delete every day?If the delete will catch up in no-peak time?How many thread can we use to do delete?What’s the main cost for delete job?
Case Study #1 – Delete Performancedelete performance is decided by IO response time/ PIO_Per_row.SNAP_TIME            EXEC_PER_SEC LIO Per Exec PIO Per Exec Rows Per Exec-------------------- ------------ ------------ ------------ -------------2011/02/10 15:49              .04     10194.44      2323.02          10002011/02/10 16:04              .05     10200.82         2322          10002011/02/10 16:19              .06     10198.03       1967.9         999.92011/02/10 16:34              .06     10201.81      1985.98          10002011/02/10 16:49              .06     10194.11      2088.38         999.91/6m/(2323/1000)=1000000/6/2323=71 rowsThe real case:deletion started at: 2011-02-10 15:38:45rows to delete: 1232177rows   deleted: 1232171deletion   ended at: 2011-02-10 20:47:511232171/((TO_DATE('2011-02-1020:47:51','YYYY-MM-DDHH24:MI:SS')-TO_DATE('2011-02-1015:38:45','YYYY-MM-DDHH24:MI:SS'))*24*60*60)66.4386391

More Related Content

PDF
381 ccs chapter7_updated(1)
Rabie Masoud
 
PDF
381 ccs chapter8_updated(1)
Rabie Masoud
 
PDF
381 ccs chapter6_updated(2)
Rabie Masoud
 
PDF
Slides for In-Datacenter Performance Analysis of a Tensor Processing Unit
Carlo C. del Mundo
 
PDF
Tracking a soccer game with big data
WSO2
 
PDF
energy efficient resource management in virtualised datacenters
Fabien Hermenier
 
PDF
2017 04-13-google-tpu-04
Brahim HAMADICHAREF
 
PPTX
Google warehouse scale computer
Tejhaskar Ashok Kumar
 
381 ccs chapter7_updated(1)
Rabie Masoud
 
381 ccs chapter8_updated(1)
Rabie Masoud
 
381 ccs chapter6_updated(2)
Rabie Masoud
 
Slides for In-Datacenter Performance Analysis of a Tensor Processing Unit
Carlo C. del Mundo
 
Tracking a soccer game with big data
WSO2
 
energy efficient resource management in virtualised datacenters
Fabien Hermenier
 
2017 04-13-google-tpu-04
Brahim HAMADICHAREF
 
Google warehouse scale computer
Tejhaskar Ashok Kumar
 

What's hot (11)

PDF
Opportunities of ML-based data analytics in ABCI
Ryousei Takano
 
PDF
ABCI: An Open Innovation Platform for Advancing AI Research and Deployment
Ryousei Takano
 
ODP
Dark silicon
Chinthaka Henadeera
 
PPTX
VMworld 2009: VMworld Data Center
Cisco Service Provider
 
PDF
Landset 8 的雲層去除技巧實作
鈵斯 倪
 
PDF
Technology Updates of PG-Strom at Aug-2014 (PGUnconf@Tokyo)
Kohei KaiGai
 
PPTX
Tensor Processing Unit (TPU)
Antonios Katsarakis
 
PPTX
A complete fingerprint matching algorithm on gpu
Hai le Hong
 
PPTX
Google TPU
Hao(Robin) Dong
 
PPTX
TPU paper slide
Dong-Hyun Hwang
 
PPTX
Horizontal scaling by partitioning
Manish Tomar
 
Opportunities of ML-based data analytics in ABCI
Ryousei Takano
 
ABCI: An Open Innovation Platform for Advancing AI Research and Deployment
Ryousei Takano
 
Dark silicon
Chinthaka Henadeera
 
VMworld 2009: VMworld Data Center
Cisco Service Provider
 
Landset 8 的雲層去除技巧實作
鈵斯 倪
 
Technology Updates of PG-Strom at Aug-2014 (PGUnconf@Tokyo)
Kohei KaiGai
 
Tensor Processing Unit (TPU)
Antonios Katsarakis
 
A complete fingerprint matching algorithm on gpu
Hai le Hong
 
Google TPU
Hao(Robin) Dong
 
TPU paper slide
Dong-Hyun Hwang
 
Horizontal scaling by partitioning
Manish Tomar
 
Ad

Viewers also liked (6)

PDF
TRSGUIDFORASSOCIATESREVISEDAP2014
Roger Sinniah
 
PPT
Team Work
Jatin Kumar Tanwar, PMP
 
PDF
Canadian tax configuration in sap
Amit Sawant
 
PDF
Vertex Configuration Guide. A to Z Steps with Description.
Keyur Mistry
 
PDF
Sap cin tax configuration
Keyur Mistry
 
PDF
Service taxes india and SAP Configuration (TAXINN)
Irfan Shokat
 
TRSGUIDFORASSOCIATESREVISEDAP2014
Roger Sinniah
 
Canadian tax configuration in sap
Amit Sawant
 
Vertex Configuration Guide. A to Z Steps with Description.
Keyur Mistry
 
Sap cin tax configuration
Keyur Mistry
 
Service taxes india and SAP Configuration (TAXINN)
Irfan Shokat
 
Ad

Similar to Forecasting database performance (20)

PDF
Doc 2011101412020074
Rhythm Sun
 
PPTX
Performance Tuning
Jannet Peetz
 
PDF
Performance Tuning for Pirates!
John Sterrett
 
PDF
The Fundamental Characteristics of Storage concepts for DBAs
Alireza Kamrani
 
PDF
Oracle databasecapacityanalysisusingstatisticalmethods
Ajith Narayanan
 
PPT
Hptf 2240 Final
prosullivan
 
PPT
SQL 2005 Disk IO Performance
Information Technology
 
PPT
Cp Repton
guestea711d0
 
PPTX
Oracle ebs capacity_analysisusingstatisticalmethods
Ajith Narayanan
 
PPTX
Leveraging Functional Tools and AWS for Performance Testing
Thoughtworks
 
PDF
Connecticut CMG - Demystifying Oracle database capacity management with wor...
Renato Bonomini
 
PPTX
Dmv's & Performance Monitor in SQL Server
Zeba Ansari
 
PPT
Troubleshooting SQL Server
Stephen Rose
 
PPTX
Performance Tuning
Jannet Peetz
 
PDF
Oracle database performance diagnostics - before your begin
Hemant K Chitale
 
PPTX
MongoDB Capacity Planning
Norberto Leite
 
PDF
Five steps perform_2009 (1)
PostgreSQL Experts, Inc.
 
PDF
5 Steps to PostgreSQL Performance
Command Prompt., Inc
 
PPTX
Webinar: Capacity Planning
MongoDB
 
PPTX
Designing Information Structures For Performance And Reliability
bryanrandol
 
Doc 2011101412020074
Rhythm Sun
 
Performance Tuning
Jannet Peetz
 
Performance Tuning for Pirates!
John Sterrett
 
The Fundamental Characteristics of Storage concepts for DBAs
Alireza Kamrani
 
Oracle databasecapacityanalysisusingstatisticalmethods
Ajith Narayanan
 
Hptf 2240 Final
prosullivan
 
SQL 2005 Disk IO Performance
Information Technology
 
Cp Repton
guestea711d0
 
Oracle ebs capacity_analysisusingstatisticalmethods
Ajith Narayanan
 
Leveraging Functional Tools and AWS for Performance Testing
Thoughtworks
 
Connecticut CMG - Demystifying Oracle database capacity management with wor...
Renato Bonomini
 
Dmv's & Performance Monitor in SQL Server
Zeba Ansari
 
Troubleshooting SQL Server
Stephen Rose
 
Performance Tuning
Jannet Peetz
 
Oracle database performance diagnostics - before your begin
Hemant K Chitale
 
MongoDB Capacity Planning
Norberto Leite
 
Five steps perform_2009 (1)
PostgreSQL Experts, Inc.
 
5 Steps to PostgreSQL Performance
Command Prompt., Inc
 
Webinar: Capacity Planning
MongoDB
 
Designing Information Structures For Performance And Reliability
bryanrandol
 

Recently uploaded (20)

PDF
Software Development Methodologies in 2025
KodekX
 
PDF
Accelerating Oracle Database 23ai Troubleshooting with Oracle AHF Fleet Insig...
Sandesh Rao
 
PPTX
What-is-the-World-Wide-Web -- Introduction
tonifi9488
 
PPTX
OA presentation.pptx OA presentation.pptx
pateldhruv002338
 
PDF
Trying to figure out MCP by actually building an app from scratch with open s...
Julien SIMON
 
PDF
Automating ArcGIS Content Discovery with FME: A Real World Use Case
Safe Software
 
PDF
Oracle AI Vector Search- Getting Started and what's new in 2025- AIOUG Yatra ...
Sandesh Rao
 
PDF
The Evolution of KM Roles (Presented at Knowledge Summit Dublin 2025)
Enterprise Knowledge
 
PDF
AI-Cloud-Business-Management-Platforms-The-Key-to-Efficiency-Growth.pdf
Artjoker Software Development Company
 
PDF
SparkLabs Primer on Artificial Intelligence 2025
SparkLabs Group
 
PDF
BLW VOCATIONAL TRAINING SUMMER INTERNSHIP REPORT
codernjn73
 
PPTX
cloud computing vai.pptx for the project
vaibhavdobariyal79
 
PPTX
The-Ethical-Hackers-Imperative-Safeguarding-the-Digital-Frontier.pptx
sujalchauhan1305
 
PPTX
AI in Daily Life: How Artificial Intelligence Helps Us Every Day
vanshrpatil7
 
PDF
How Open Source Changed My Career by abdelrahman ismail
a0m0rajab1
 
PPTX
AI and Robotics for Human Well-being.pptx
JAYMIN SUTHAR
 
PDF
Presentation about Hardware and Software in Computer
snehamodhawadiya
 
PDF
CIFDAQ's Market Wrap : Bears Back in Control?
CIFDAQ
 
PDF
Unlocking the Future- AI Agents Meet Oracle Database 23ai - AIOUG Yatra 2025.pdf
Sandesh Rao
 
PDF
Structs to JSON: How Go Powers REST APIs
Emily Achieng
 
Software Development Methodologies in 2025
KodekX
 
Accelerating Oracle Database 23ai Troubleshooting with Oracle AHF Fleet Insig...
Sandesh Rao
 
What-is-the-World-Wide-Web -- Introduction
tonifi9488
 
OA presentation.pptx OA presentation.pptx
pateldhruv002338
 
Trying to figure out MCP by actually building an app from scratch with open s...
Julien SIMON
 
Automating ArcGIS Content Discovery with FME: A Real World Use Case
Safe Software
 
Oracle AI Vector Search- Getting Started and what's new in 2025- AIOUG Yatra ...
Sandesh Rao
 
The Evolution of KM Roles (Presented at Knowledge Summit Dublin 2025)
Enterprise Knowledge
 
AI-Cloud-Business-Management-Platforms-The-Key-to-Efficiency-Growth.pdf
Artjoker Software Development Company
 
SparkLabs Primer on Artificial Intelligence 2025
SparkLabs Group
 
BLW VOCATIONAL TRAINING SUMMER INTERNSHIP REPORT
codernjn73
 
cloud computing vai.pptx for the project
vaibhavdobariyal79
 
The-Ethical-Hackers-Imperative-Safeguarding-the-Digital-Frontier.pptx
sujalchauhan1305
 
AI in Daily Life: How Artificial Intelligence Helps Us Every Day
vanshrpatil7
 
How Open Source Changed My Career by abdelrahman ismail
a0m0rajab1
 
AI and Robotics for Human Well-being.pptx
JAYMIN SUTHAR
 
Presentation about Hardware and Software in Computer
snehamodhawadiya
 
CIFDAQ's Market Wrap : Bears Back in Control?
CIFDAQ
 
Unlocking the Future- AI Agents Meet Oracle Database 23ai - AIOUG Yatra 2025.pdf
Sandesh Rao
 
Structs to JSON: How Go Powers REST APIs
Emily Achieng
 

Forecasting database performance

  • 1. Forecasting Database Performance Du Shenglin June 6th 2011
  • 2. What do Capacity do?Manager ask “Can our database survive in next year or the new promotion program”?Performance Tuning != Capacity planningDBA is not totally equal to Capacity Analyst
  • 3. What do Capacity do?How Much headroom do we still have for further increasing, how many days can we hold without add/upgrade hardware?What’s the costs or impact to the site with adding or changing application codeWhat kind of platform/database/OS should we use for the new introduced applicationsHow to survive for the sudden performance deviations?
  • 4. AgendaResourceModel and TheoryResponse Time AnalysisSteps to do Capacity AnalysisCase Study
  • 5. Resource Site Level Machine, License, database, Storage, Manpower…System Level CPU, IO, Memory, Disk, Network, Kernel SettingsDatabase Level Latch, Enqueue, Lock, Physical IO, Logical IO…
  • 6. Modeling - Making the Complex Simple The world is much too complex for us to understand. Mathematical ModelQueue theoryLine modelingRegression analysisUtilization BaselineModel is not perfect, not 100% precision
  • 9. The Response Time CurveResponse Time=Service Time + Queue Time
  • 10. Queuing TheoryRemain in the queue until its turn to be serviced Common FIFO or priority queueQueue lengthWait times and wait eventsCPU queue and IO queue
  • 11. Response Time Drill DownResponse Time=Service Time + Queue TimeRt =St + QtCPUQueueNetworkTransferCPUUsr+SysMemoryQueueMemoryAccessDiskQueueDiskTransferNetworkQueue
  • 12. Utilization and HeadroomHeadroom is available usable resources-Total Capacity minus Peak Utilization and Margin-Applies to CPU, RAM, Net, Disk and OS-Can be very complex to determine, it depends
  • 13. CPU Capacity MeasurementsCPU utilization is defined as busy time divided by elapsed time for each CPUCPU time = CPU Queue + CPU usr+sysProcesses wait on a run queue, causing high load averages, then run on a CPU in user and system mode. More CPUs reduce queue wait. Faster CPUs reduce usr+sys time.
  • 14. CPU Capacity MeasurementsU=Îť*St*MCPU Utilization=Arrival rate* cpu_time_exec(us)/POWER(10,6)/number_of_CPUCPU Utilization=buffer_gets* buffer_gets_time_per_exec(us)/POWER(10,6)/number_of_CPUWe can use this format for many cases
  • 15. The Response Time Curve - Multiple CPU
  • 16. IO Response Time ProfileRAM 60ns
  • 18. SSD – 100 -500us
  • 19. IO Service Time Includes 3 Components: - Access Time – Time It Takes To Move Heads To The Desired Track. - Rotation Time – Time It Takes To Locate The Desired Sector on The Track. -Transfer Time – Time It Takes To Read/Write The DataAccess Time Constitutes 70% of The Service TimeIO Average Wait Time db file sequential read – less than 15 ms
  • 20. log file sync – less than 4msTrend Capacity MeasurementsSQL Execution Increase -> Traffic GrowthBuffer Gets Per Execution Fluctuates -> Normal Buffer ContentionsBuffer Gets Per Execution Increase Gradually -> SQL Efficiency ChangeCPU Increase Only -> System Overhead Increase, Latch Spinning…etcFind the commons during daily, weekly and yearly exexutions
  • 24. Data CollectionWhat kind of data to collectWhen to collect the dataWhere to put the dataHow often to collect the dataHow long to keep the dataHow to interpret and present the data A Picture Is Worth A Thousand Words Script and automate is necessary
  • 25. Capacity Monitoring in database levelPeak executions SessionsShared pool usageLIO/execPIO/execCPU_time/LIORedo sizeFree memoryCommitsDisk space usage…..
  • 26. Risk Mitigation StrategiesCapacity Analyst is not only DBATuning/fixing the issue - DBA or SA’s task?Balancing existing workloadUpgrade and buy more CPU capacity Split and Sharding
  • 27. Steps to take for Capacity Analysis1. Determine the question2. Gather workload data - What, how and how often3. Characterize the workload data - Map, Interpret the data 4. Develop and use appropriate model - Present your data, Graph5. Validate the forecast6. Forecast
  • 28. Case Study #1 – Delete PerformanceQuestions:How many data can we delete every day?If the delete will catch up in no-peak time?How many thread can we use to do delete?What’s the main cost for delete job?
  • 29. Case Study #1 – Delete Performancedelete performance is decided by IO response time/ PIO_Per_row.SNAP_TIME EXEC_PER_SEC LIO Per Exec PIO Per Exec Rows Per Exec-------------------- ------------ ------------ ------------ -------------2011/02/10 15:49 .04 10194.44 2323.02 10002011/02/10 16:04 .05 10200.82 2322 10002011/02/10 16:19 .06 10198.03 1967.9 999.92011/02/10 16:34 .06 10201.81 1985.98 10002011/02/10 16:49 .06 10194.11 2088.38 999.91/6m/(2323/1000)=1000000/6/2323=71 rowsThe real case:deletion started at: 2011-02-10 15:38:45rows to delete: 1232177rows deleted: 1232171deletion ended at: 2011-02-10 20:47:511232171/((TO_DATE('2011-02-1020:47:51','YYYY-MM-DDHH24:MI:SS')-TO_DATE('2011-02-1015:38:45','YYYY-MM-DDHH24:MI:SS'))*24*60*60)66.4386391
  • 30. Case Study #2 – Using MySQLWhat capacity analysis Should we do to evaluate MySQL ?MySQL versionMachine OSLOCAL DISK/SSDKernel configurationMySQL Parametersmysql\MySQL InnoDB setup best practice.doc
  • 31. Answers to what Capacity need to doMeasure the capacity of the site correctly and accurately.Be able to predict the growth of site, identify future performance problemDefine what is balance and find a strategy to keep dynamic balance.Impact analysis of system level change.Identify dangerous performance deviations.