Effective testing for spark programs Strata NY 2015Holden Karau
This session explores best practices of creating both unit and integration tests for Spark programs as well as acceptance tests for the data produced by our Spark jobs. We will explore the difficulties with testing streaming programs, options for setting up integration testing with Spark, and also examine best practices for acceptance tests.
Unit testing of Spark programs is deceptively simple. The talk will look at how unit testing of Spark itself is accomplished, as well as factor out a number of best practices into traits we can use. This includes dealing with local mode cluster creation and teardown during test suites, factoring our functions to increase testability, mock data for RDDs, and mock data for Spark SQL.
Testing Spark Streaming programs has a number of interesting problems. These include handling of starting and stopping the Streaming context, and providing mock data and collecting results. As with the unit testing of Spark programs, we will factor out the common components of the tests that are useful into a trait that people can use.
While acceptance tests are not always part of testing, they share a number of similarities. We will look at which counters Spark programs generate that we can use for creating acceptance tests, best practices for storing historic values, and some common counters we can easily use to track the success of our job.
Relevant Spark Packages & Code:
https://github.com/holdenk/spark-testing-base / http://spark-packages.org/package/holdenk/spark-testing-base
https://github.com/holdenk/spark-validator
Effective testing for spark programs Strata NY 2015Holden Karau
This session explores best practices of creating both unit and integration tests for Spark programs as well as acceptance tests for the data produced by our Spark jobs. We will explore the difficulties with testing streaming programs, options for setting up integration testing with Spark, and also examine best practices for acceptance tests.
Unit testing of Spark programs is deceptively simple. The talk will look at how unit testing of Spark itself is accomplished, as well as factor out a number of best practices into traits we can use. This includes dealing with local mode cluster creation and teardown during test suites, factoring our functions to increase testability, mock data for RDDs, and mock data for Spark SQL.
Testing Spark Streaming programs has a number of interesting problems. These include handling of starting and stopping the Streaming context, and providing mock data and collecting results. As with the unit testing of Spark programs, we will factor out the common components of the tests that are useful into a trait that people can use.
While acceptance tests are not always part of testing, they share a number of similarities. We will look at which counters Spark programs generate that we can use for creating acceptance tests, best practices for storing historic values, and some common counters we can easily use to track the success of our job.
Relevant Spark Packages & Code:
https://github.com/holdenk/spark-testing-base / http://spark-packages.org/package/holdenk/spark-testing-base
https://github.com/holdenk/spark-validator
Adding Transparency and Automation into the Galaxy Tool Installation ProcessEnis Afgan
The talk will discuss process of unifying the tool installation approach within the Galaxy project and how it can be used by anyone to to install potentially hundreds of tools in an automated fashion.
All Your IOPS Are Belong To Us - A Pinteresting Case Study in MySQL Performan...Ernie Souhrada
Have you ever thought that your SSD storage just doesn't seem anywhere near as fast as advertised? What if I told you that a couple of small changes to your Linux servers had the potential to more than double the amount of throughput your MySQL servers could handle while simultaneously reducing query response time by around 50 percent? It's not a dream, Neo.
If you're still in a traditional data center and/or your MySQL footprint lives on spinning rust, then you might want to take the blue pill, attend a different session, and believe whatever you want to believe.
However, if your server footprint runs inside Amazon Web Services or if you use SSDs in any fashion, I invite you to take the red pill and come with me on a journey down the rabbit hole, where we'll discuss such things as the Linux block IO driver, CPU starvation, and interrupt handling, using real-world query performance data from the primary MySQL data stores at Pinterest to illustrate the effect.
Prometheus is a open-source time series database with a powerful query language designed for operational monitoring.
Contact us at prometheus@robustperception.io
Spark Autotuning: Spark Summit East talk by Lawrence SpracklenSpark Summit
While the performance delivered by Spark has enabled data scientists to undertake sophisticated analyses on big and complex data in actionable timeframes, too often, the process of manually configuring the underlying Spark jobs (including the number and size of the executors) can be a significant and time consuming undertaking. Not only it does this configuration process typically rely heavily on repeated trial-and-error, it necessitates that data scientists have a low-level understanding of Spark and detailed cluster sizing information. At Alpine Data we have been working to eliminate this requirement, and develop algorithms that can be used to automatically tune Spark jobs with minimal user involvement,
In this presentation, we discuss the algorithms we have developed and illustrate how they leverage information about the size of the data being analyzed, the analytical operations being used in the flow, the cluster size, configuration and real-time utilization, to automatically determine the optimal Spark job configuration for peak performance.
Dictionary based Annotation at Scale with Spark, SolrTextTagger and OpenNLPSujit Pal
Presented at Spark Summit EU 2015 at Amsterdam. Details the SoDA project, a micro-service accessible via Spark for naive annotation of large volumes of text against very large lexicons.
Scaling Security Threat Detection with Apache Spark and DatabricksDatabricks
Apple must detect a wide variety of security threats, and rises to the challenge using Apache Spark across a diverse pool of telemetry. This talk covers some of the home-grown solutions we’ve built to address complications of scale
A presentation at Twitter's official developer conference, Chirp, about why we use the Scala programming language and how we build services in it. Provides a tour of a number of libraries and tools, both developed at Twitter and otherwise.
Awr1page - Sanity checking time instrumentation in AWR reportsJohn Beresniewicz
Discusses Oracle time-based performance instrumentation as presented in AWR reports and inconsistencies between instrumentation sources that can cause confusion as conflicting information is presented. The cognitive load of investigating and reasoning about such conundrums is very high, discouraging even senior performance experts. A program (AWR1page) is discussed that consumes an AWR report and produces a 1-page normalized time summary by instrumentation source, precisely designed for reasoning about instrumentation inconsistencies in AWR reports.
Video: https://www.youtube.com/watch?v=FJW8nGV4jxY and https://www.youtube.com/watch?v=zrr2nUln9Kk . Tutorial slides for O'Reilly Velocity SC 2015, by Brendan Gregg.
There are many performance tools nowadays for Linux, but how do they all fit together, and when do we use them? This tutorial explains methodologies for using these tools, and provides a tour of four tool types: observability, benchmarking, tuning, and static tuning. Many tools will be discussed, including top, iostat, tcpdump, sar, perf_events, ftrace, SystemTap, sysdig, and others, as well observability frameworks in the Linux kernel: PMCs, tracepoints, kprobes, and uprobes.
This tutorial is updated and extended on an earlier talk that summarizes the Linux performance tool landscape. The value of this tutorial is not just learning that these tools exist and what they do, but hearing when and how they are used by a performance engineer to solve real world problems — important context that is typically not included in the standard documentation.
SPARKNaCl: A verified, fast cryptographic libraryAdaCore
SPARKNaCl https://github.com/rod-chapman/SPARKNaCl is a new, freely-available, verified and fast reference implementation of the NaCl cryptographic API, based on the TweetNaCl distribution. It has a fully automated, complete and sound proof of type-safety and several key correctness properties. In addition, the code is surprisingly fast - out-performing TweetNaCl's C implementation on an Ed25519 Sign operation by a factor of 3 at all optimisation levels on a 32-bit RISC-V bare-metal machine. This talk will concentrate on how "Proof Driven Optimisation" can result in code that is both correct and fast.
Distributed Model Validation with EpsilonSina Madani
Scalable performance is a major challenge with current model management tools. As the size and complexity of models and model management programs increases and the cost of computing falls, one solution for improving performance of model management programs is to perform computations on multiple computers. The developed prototype demonstrates a low-overhead data-parallel approach for distributed model validation in the context of an OCL-like language. The approach minimises communication costs by exploiting the deterministic structure of programs and can take advantage of multiple cores on each (heterogenous) machine with highly configurable computational granularity. Performance evaluation shows linear improvements with more machines and processor cores, being up to 340x faster than the baseline sequential program with 88 computers.
UKOUG version of a presentation trying to establish the sensible limits of parallelism on a couple of hardware configurations. Detailed white paper is at http://oracledoug.com/px_slaves.pdf
Adding Transparency and Automation into the Galaxy Tool Installation ProcessEnis Afgan
The talk will discuss process of unifying the tool installation approach within the Galaxy project and how it can be used by anyone to to install potentially hundreds of tools in an automated fashion.
All Your IOPS Are Belong To Us - A Pinteresting Case Study in MySQL Performan...Ernie Souhrada
Have you ever thought that your SSD storage just doesn't seem anywhere near as fast as advertised? What if I told you that a couple of small changes to your Linux servers had the potential to more than double the amount of throughput your MySQL servers could handle while simultaneously reducing query response time by around 50 percent? It's not a dream, Neo.
If you're still in a traditional data center and/or your MySQL footprint lives on spinning rust, then you might want to take the blue pill, attend a different session, and believe whatever you want to believe.
However, if your server footprint runs inside Amazon Web Services or if you use SSDs in any fashion, I invite you to take the red pill and come with me on a journey down the rabbit hole, where we'll discuss such things as the Linux block IO driver, CPU starvation, and interrupt handling, using real-world query performance data from the primary MySQL data stores at Pinterest to illustrate the effect.
Prometheus is a open-source time series database with a powerful query language designed for operational monitoring.
Contact us at prometheus@robustperception.io
Spark Autotuning: Spark Summit East talk by Lawrence SpracklenSpark Summit
While the performance delivered by Spark has enabled data scientists to undertake sophisticated analyses on big and complex data in actionable timeframes, too often, the process of manually configuring the underlying Spark jobs (including the number and size of the executors) can be a significant and time consuming undertaking. Not only it does this configuration process typically rely heavily on repeated trial-and-error, it necessitates that data scientists have a low-level understanding of Spark and detailed cluster sizing information. At Alpine Data we have been working to eliminate this requirement, and develop algorithms that can be used to automatically tune Spark jobs with minimal user involvement,
In this presentation, we discuss the algorithms we have developed and illustrate how they leverage information about the size of the data being analyzed, the analytical operations being used in the flow, the cluster size, configuration and real-time utilization, to automatically determine the optimal Spark job configuration for peak performance.
Dictionary based Annotation at Scale with Spark, SolrTextTagger and OpenNLPSujit Pal
Presented at Spark Summit EU 2015 at Amsterdam. Details the SoDA project, a micro-service accessible via Spark for naive annotation of large volumes of text against very large lexicons.
Scaling Security Threat Detection with Apache Spark and DatabricksDatabricks
Apple must detect a wide variety of security threats, and rises to the challenge using Apache Spark across a diverse pool of telemetry. This talk covers some of the home-grown solutions we’ve built to address complications of scale
A presentation at Twitter's official developer conference, Chirp, about why we use the Scala programming language and how we build services in it. Provides a tour of a number of libraries and tools, both developed at Twitter and otherwise.
Awr1page - Sanity checking time instrumentation in AWR reportsJohn Beresniewicz
Discusses Oracle time-based performance instrumentation as presented in AWR reports and inconsistencies between instrumentation sources that can cause confusion as conflicting information is presented. The cognitive load of investigating and reasoning about such conundrums is very high, discouraging even senior performance experts. A program (AWR1page) is discussed that consumes an AWR report and produces a 1-page normalized time summary by instrumentation source, precisely designed for reasoning about instrumentation inconsistencies in AWR reports.
Video: https://www.youtube.com/watch?v=FJW8nGV4jxY and https://www.youtube.com/watch?v=zrr2nUln9Kk . Tutorial slides for O'Reilly Velocity SC 2015, by Brendan Gregg.
There are many performance tools nowadays for Linux, but how do they all fit together, and when do we use them? This tutorial explains methodologies for using these tools, and provides a tour of four tool types: observability, benchmarking, tuning, and static tuning. Many tools will be discussed, including top, iostat, tcpdump, sar, perf_events, ftrace, SystemTap, sysdig, and others, as well observability frameworks in the Linux kernel: PMCs, tracepoints, kprobes, and uprobes.
This tutorial is updated and extended on an earlier talk that summarizes the Linux performance tool landscape. The value of this tutorial is not just learning that these tools exist and what they do, but hearing when and how they are used by a performance engineer to solve real world problems — important context that is typically not included in the standard documentation.
SPARKNaCl: A verified, fast cryptographic libraryAdaCore
SPARKNaCl https://github.com/rod-chapman/SPARKNaCl is a new, freely-available, verified and fast reference implementation of the NaCl cryptographic API, based on the TweetNaCl distribution. It has a fully automated, complete and sound proof of type-safety and several key correctness properties. In addition, the code is surprisingly fast - out-performing TweetNaCl's C implementation on an Ed25519 Sign operation by a factor of 3 at all optimisation levels on a 32-bit RISC-V bare-metal machine. This talk will concentrate on how "Proof Driven Optimisation" can result in code that is both correct and fast.
Distributed Model Validation with EpsilonSina Madani
Scalable performance is a major challenge with current model management tools. As the size and complexity of models and model management programs increases and the cost of computing falls, one solution for improving performance of model management programs is to perform computations on multiple computers. The developed prototype demonstrates a low-overhead data-parallel approach for distributed model validation in the context of an OCL-like language. The approach minimises communication costs by exploiting the deterministic structure of programs and can take advantage of multiple cores on each (heterogenous) machine with highly configurable computational granularity. Performance evaluation shows linear improvements with more machines and processor cores, being up to 340x faster than the baseline sequential program with 88 computers.
UKOUG version of a presentation trying to establish the sensible limits of parallelism on a couple of hardware configurations. Detailed white paper is at http://oracledoug.com/px_slaves.pdf
Two popular tools for doing Machine Learning on top of JVM ecosystem is H2O and SparkML. This presentation compares these two tools as Machine Learning libraries (Didn't consider Spark's Data Munjing perspective). This work was done during June of 2018.
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdfPaige Cruz
Monitoring and observability aren’t traditionally found in software curriculums and many of us cobble this knowledge together from whatever vendor or ecosystem we were first introduced to and whatever is a part of your current company’s observability stack.
While the dev and ops silo continues to crumble….many organizations still relegate monitoring & observability as the purview of ops, infra and SRE teams. This is a mistake - achieving a highly observable system requires collaboration up and down the stack.
I, a former op, would like to extend an invitation to all application developers to join the observability party will share these foundational concepts to build on:
In his public lecture, Christian Timmerer provides insights into the fascinating history of video streaming, starting from its humble beginnings before YouTube to the groundbreaking technologies that now dominate platforms like Netflix and ORF ON. Timmerer also presents provocative contributions of his own that have significantly influenced the industry. He concludes by looking at future challenges and invites the audience to join in a discussion.
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...James Anderson
Effective Application Security in Software Delivery lifecycle using Deployment Firewall and DBOM
The modern software delivery process (or the CI/CD process) includes many tools, distributed teams, open-source code, and cloud platforms. Constant focus on speed to release software to market, along with the traditional slow and manual security checks has caused gaps in continuous security as an important piece in the software supply chain. Today organizations feel more susceptible to external and internal cyber threats due to the vast attack surface in their applications supply chain and the lack of end-to-end governance and risk management.
The software team must secure its software delivery process to avoid vulnerability and security breaches. This needs to be achieved with existing tool chains and without extensive rework of the delivery processes. This talk will present strategies and techniques for providing visibility into the true risk of the existing vulnerabilities, preventing the introduction of security issues in the software, resolving vulnerabilities in production environments quickly, and capturing the deployment bill of materials (DBOM).
Speakers:
Bob Boule
Robert Boule is a technology enthusiast with PASSION for technology and making things work along with a knack for helping others understand how things work. He comes with around 20 years of solution engineering experience in application security, software continuous delivery, and SaaS platforms. He is known for his dynamic presentations in CI/CD and application security integrated in software delivery lifecycle.
Gopinath Rebala
Gopinath Rebala is the CTO of OpsMx, where he has overall responsibility for the machine learning and data processing architectures for Secure Software Delivery. Gopi also has a strong connection with our customers, leading design and architecture for strategic implementations. Gopi is a frequent speaker and well-known leader in continuous delivery and integrating security into software delivery.
Threats to mobile devices are more prevalent and increasing in scope and complexity. Users of mobile devices desire to take full advantage of the features
available on those devices, but many of the features provide convenience and capability but sacrifice security. This best practices guide outlines steps the users can take to better protect personal devices and information.
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!SOFTTECHHUB
As the digital landscape continually evolves, operating systems play a critical role in shaping user experiences and productivity. The launch of Nitrux Linux 3.5.0 marks a significant milestone, offering a robust alternative to traditional systems such as Windows 11. This article delves into the essence of Nitrux Linux 3.5.0, exploring its unique features, advantages, and how it stands as a compelling choice for both casual users and tech enthusiasts.
Pushing the limits of ePRTC: 100ns holdover for 100 daysAdtran
At WSTS 2024, Alon Stern explored the topic of parametric holdover and explained how recent research findings can be implemented in real-world PNT networks to achieve 100 nanoseconds of accuracy for up to 100 days.
Essentials of Automations: The Art of Triggers and Actions in FMESafe Software
In this second installment of our Essentials of Automations webinar series, we’ll explore the landscape of triggers and actions, guiding you through the nuances of authoring and adapting workspaces for seamless automations. Gain an understanding of the full spectrum of triggers and actions available in FME, empowering you to enhance your workspaces for efficient automation.
We’ll kick things off by showcasing the most commonly used event-based triggers, introducing you to various automation workflows like manual triggers, schedules, directory watchers, and more. Plus, see how these elements play out in real scenarios.
Whether you’re tweaking your current setup or building from the ground up, this session will arm you with the tools and insights needed to transform your FME usage into a powerhouse of productivity. Join us to discover effective strategies that simplify complex processes, enhancing your productivity and transforming your data management practices with FME. Let’s turn complexity into clarity and make your workspaces work wonders!
Maruthi Prithivirajan, Head of ASEAN & IN Solution Architecture, Neo4j
Get an inside look at the latest Neo4j innovations that enable relationship-driven intelligence at scale. Learn more about the newest cloud integrations and product enhancements that make Neo4j an essential choice for developers building apps with interconnected data and generative AI.
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...DanBrown980551
Do you want to learn how to model and simulate an electrical network from scratch in under an hour?
Then welcome to this PowSyBl workshop, hosted by Rte, the French Transmission System Operator (TSO)!
During the webinar, you will discover the PowSyBl ecosystem as well as handle and study an electrical network through an interactive Python notebook.
PowSyBl is an open source project hosted by LF Energy, which offers a comprehensive set of features for electrical grid modelling and simulation. Among other advanced features, PowSyBl provides:
- A fully editable and extendable library for grid component modelling;
- Visualization tools to display your network;
- Grid simulation tools, such as power flows, security analyses (with or without remedial actions) and sensitivity analyses;
The framework is mostly written in Java, with a Python binding so that Python developers can access PowSyBl functionalities as well.
What you will learn during the webinar:
- For beginners: discover PowSyBl's functionalities through a quick general presentation and the notebook, without needing any expert coding skills;
- For advanced developers: master the skills to efficiently apply PowSyBl functionalities to your real-world scenarios.
Sudheer Mechineni, Head of Application Frameworks, Standard Chartered Bank
Discover how Standard Chartered Bank harnessed the power of Neo4j to transform complex data access challenges into a dynamic, scalable graph database solution. This keynote will cover their journey from initial adoption to deploying a fully automated, enterprise-grade causal cluster, highlighting key strategies for modelling organisational changes and ensuring robust disaster recovery. Learn how these innovations have not only enhanced Standard Chartered Bank’s data infrastructure but also positioned them as pioneers in the banking sector’s adoption of graph technology.
DevOps and Testing slides at DASA ConnectKari Kakkonen
My and Rik Marselis slides at 30.5.2024 DASA Connect conference. We discuss about what is testing, then what is agile testing and finally what is Testing in DevOps. Finally we had lovely workshop with the participants trying to find out different ways to think about quality and testing in different parts of the DevOps infinity loop.
How to Get CNIC Information System with Paksim Ga.pptxdanishmna97
Pakdata Cf is a groundbreaking system designed to streamline and facilitate access to CNIC information. This innovative platform leverages advanced technology to provide users with efficient and secure access to their CNIC details.
A tale of scale & speed: How the US Navy is enabling software delivery from l...sonjaschweigert1
Rapid and secure feature delivery is a goal across every application team and every branch of the DoD. The Navy’s DevSecOps platform, Party Barge, has achieved:
- Reduction in onboarding time from 5 weeks to 1 day
- Improved developer experience and productivity through actionable findings and reduction of false positives
- Maintenance of superior security standards and inherent policy enforcement with Authorization to Operate (ATO)
Development teams can ship efficiently and ensure applications are cyber ready for Navy Authorizing Officials (AOs). In this webinar, Sigma Defense and Anchore will give attendees a look behind the scenes and demo secure pipeline automation and security artifacts that speed up application ATO and time to production.
We will cover:
- How to remove silos in DevSecOps
- How to build efficient development pipeline roles and component templates
- How to deliver security artifacts that matter for ATO’s (SBOMs, vulnerability reports, and policy evidence)
- How to streamline operations with automated policy checks on container images
Building RAG with self-deployed Milvus vector database and Snowpark Container...Zilliz
This talk will give hands-on advice on building RAG applications with an open-source Milvus database deployed as a docker container. We will also introduce the integration of Milvus with Snowpark Container Services.
1. SQL
Elapsed Time
Analysis
Craig A. Shallahamer
Founder - OraPub, Inc.
craig@orapub.com
SQL
Elapsed
Time
Analysis
2. OraPub is about Oracle performance.
• OraPub is all about Oracle performance Resources
management; systematic and quantitative
firefighting and predictive analysis.
•
Training
• Web site started in 1995 and the company was
founded in 1998 by Craig Shallahamer. •
Unique
Blog
• OraPub has always been about disseminating •
Free
Tools
Oracle database centric technical information.
• Consulting, training, books, papers, and •
Free
Papers
products are now being offered.
•
Books
• We have been on-site in 24 countries and our
resources have been received in probably •
Products
every country where there are DBAs.
•
Consul8ng
SQL
Elapsed
Time
Analysis
3. Short resume...kind of...
• Studies economics, mathematics, and computer science at
university in California, US.
• Started working with Oracle technology in 1989 as a Forms 2.3
developer on Oracle version 5.
• Soon after started performance firefighting...daily!
• Co-found both Oracle’s Core Technology and System
Performance Groups.
• Left Oracle to start OraPub, Inc. in 1998.
• Authored 24 technical papers and worked in 24 countries.
• Authors and teaches his classes Oracle Performance
Firefighting, Adv Oracle Performance Analysis, and Oracle
Forecasting & Predictive Analysis.
• Authored the books, Forecasting Oracle Performance and
Oracle Performance Firefighting.
• Oracle ACE Director.
• Frequent blog contributor: A Wider View
SQL
Elapsed
Time
Analysis
4. My two books...
OraPub
discount
code:
IS11
SQL
Elapsed
Time
Analysis
5. One presentation with two parts.
• “The average” can be misleading.
• Modeling E time leads to insights.
SQL
Elapsed
Time
Analysis
6. Working with limited information.
SQL ordered by Elapsed DB/Inst: LOOK/LOOK Snaps: 80298-80310!
-> Resources reported for PL/SQL code includes the resources used by all SQL!
statements called by the code.!
-> Total DB CPU (s): 22,800!
-> Captured SQL accounts for 109.8% of Total DB CPU!
-> SQL reported below exceeded 1.0% of Total DB CPU!
!
CPU CPU per Elapsd Old!
Time (s) Executions Exec (s) %Total Time (s) Physical Reads Hash Value!
---------- ------------ ---------- ------ ---------- --------------- ----------!
474.59 38,479 0.01 19.9 479909.89 923,822,548 4166296332!
BEGIN pkg_com_unite.st_execute_commune( i_daemon_id => :daemon_id, !
i_reload_subult_true_false => :reload_subult_true_false, !
i_dump_caches => :dump_caches, i_add_seq2_id => :add_seq2_id, !
i_dump_seq2_id => :dump_seq2_id, i_remove_seq2_id => :remove_seq2_id, !
i_multi_seq2_chg_true_false => :multi_seq2!
Total
Elapsed
Time
:
479,909.89
seconds
Total
ExecuFons
:
38,479
exec
SQL
Elapsed
Time
Analysis
7. So the average E time is...
E = 479909.89 secs / 38,479 exec!
= 12.47 sec/exec!
source:
Init
Hist
Work
2.nb
SQL
Elapsed
Time
Analysis
8. It’s more likely to be like this...
More?
“log
normal”
SQL
Elapsed
Time
Analysis
10. What can we do?
We don’t want to mislead others.
We need to truly understand the
situation if we are making decisions
based on this information.
SQL
Elapsed
Time
Analysis
11. We have a variety of collection options.
• SQL Trace. Valid option.
– Must have ability to parse the trace files producing E times.
– Can trace on sql_id.
– Must be the production system.
• Instrument SQL. Valid option.
– May not be practical or possible.
• Stopwatch. Risky.
– Limited scope and very few samples.
– OK for a specific user situation.
• Benchmark or Isolated Testing. Very risky.
– If you want real results, you need a real situation (HW, data, arrivals, concurrency).
• OraPub E Time Collector. Valid, but grabs a core.
– Free tool. OraPub search: “sql elapsed time”
– Gathers at sql_id and plan_hash_value level.
– Grabs and holds a CPU core, ouch!
• OraPub E Sampler. Valid but not free.
– Un-noticeable impact with same results as tracing or instrumentation!
– Gathers at sql_id level and samples stored in Oracle table.
– Licensed like a box of candy.
– Beta version available for Insync attendees....free!
More?
“SQL
sampler”
SQL
Elapsed
Time
Analysis
12. How good is sampled data?
This
is
smoothed
histogram
of
elapsed
Fmes
for
a
specific
sql_id
(query)
collected
using
SQL
Trace,
instrumentaFon,
and
OP
Elapsed
Fme
Sampler
(normal).
Over
a
5
minute
period,
around
80
samples
where
gathered
from
each
collecFon
method.
All
three
collecFons
methods
produce
the
same
results!
More?
True
SQL
Elapsed
SQL
Elapsed
Time
Analysis
13. Let’s take a look at some
real data
from
real systems.
SQL
Elapsed
Time
Analysis
14. #1: Showing all samples.
Samples : 230!
Mean : 57168!
Median : 60000!
Max : 793996!
Collector: OP E Time!
source:
Aber3129
SQL
Elapsed
Time
Analysis
15. #1: Showing most samples.
Samples : 230!
Mean : 57168!
Median : 60000!
Max : 793996!
Collector: OP E Time!
!
source:
Aber3129
SQL
Elapsed
Time
Analysis
16. #2: Showing most samples.
Samples : 368!
Mean : 158!
Median : 23!
Max : 2840!
Collector: OP E Time!
source:
Garret1jqj
SQL
Elapsed
Time
Analysis
17. #3: Showing all samples.
Samples : 506!
Mean : 48!
Median : 26!
Max : 476!
Collector: OP E Time!
source:
Garret8qt
SQL
Elapsed
Time
Analysis
18. #4: Showing all samples.
Samples : 179!
Mean : 38.72 ms!
Median : 38.04 ms!
Max : 58.40 ms!
Collector: OP E Sampler!
source:
Garret
0u2t
SQL
Elapsed
Time
Analysis
20. Conclusions about average E.
• Average elapsed time for a specific SQL
statement can be very misleading.
• Elapsed times are not normally distributed.
• The average elapsed time is not the typical
elapsed time.
• The modes are the typical elapsed times.
• If the mode is not available, then the median
can be used, in some cases.
• If you need to communicate typical elapsed
times, you need to gather real data.
More?
“SQL
elapsed”
SQL
Elapsed
Time
Analysis
21. Modeling elapsed time
E = units of work x time per unit
E (time/exec) = WL(work/exec) x RT(time/work)
SQL
Elapsed
Time
Analysis
22. Example of elapsed time.
Supposed
a
query
must
access
100,000
logical
IOs
and
each
LIO
takes
0.020ms.
Therefore,
the
elapsed
Fme
will
be
2,000ms
or
2.0
seconds.
E (ms/exec) = units of work (LIO/exec) X time per work (ms/LIO)!
!
2000 ms/exec = 100,000 LIO/exec X 0.020 ms/LIO !
SQL
Elapsed
Time
Analysis
23. When we tune, WL is reduced.
• SQL tuning fundamentally reduces the
work required to execute a statement.
• Since less work is required then generally,
the elapsed time will decrease!
• If your tuning prowess reduces the work
from 100,000 PIOs to 50,000 PIOs then
you can expect the elapsed time to
decrease by 50%.
• But does this really occur in reality? hum...
SQL
Elapsed
Time
Analysis
24. Experimental results!
Median
Stmt
Median
Tuned
Stmt
LIO
Elapsed
Logical
Elapsed
Samples
SQL
Change
Time
(s)
IO
Time
(s)
Change
No
355289
-‐
14.22
-‐
243
Yes
161495
-‐54.55%
5.88
-‐58.67%
339
• CollecFon
interval
was
2
hours.
• OraPub’s
Elapsed
Time
Sampler
was
used
to
collect
elapsed
Fmes.
• LIO
numbers
gathered
from
v$sysstat.
• Time
based
on
Fmestamp
data
type.
source:
E
Analysis
1a.xlsx,
256
latches
SQL
Elapsed
Time
Analysis
25. Ways to reduce UOW process time.
• There are many ways to reduce the time it
takes to process a single unit of work.
• There are direct methods and indirect
methods.
• Indirect: Because processes share and
compete for resources, when the big issue is
resolved, many other issues become less
intense.
• Direct: Tuning Oracle directly reduces the
time required to process a piece of work.
Hum...
SQL
Elapsed
Time
Analysis
26. Experimental results!
SQL
Stmt
Instance
Instance
CBC
Median
RT
Change
WL
Change
Samples
Latches
Elapsed
(ms/lio)
(lio/ms)
Time
(s)
256
0.03623
-‐
120
14.224
-‐
243
32768
0.00856
-‐76.36%
227
2.968
-‐79.13%
399
• CollecFon
interval
was
2
hours.
• OraPub’s
Elapsed
Time
Sampler
was
used
to
collect
elapsed
Fmes.
• RT
components
gathered
from
v$sysstat,
v$sys_Fme_model,
and
v$system_event.
• Time
based
on
Fmestamp
data
type.
source:
E
Analysis
1a.xlsx,
not
tuned
SQL
Elapsed
Time
Analysis
27. This graph shows the work process time.
+96%
WL
Change
-‐76%
RT
Change
source:
More
Latches
RT
Compare...xlsx
SQL
Elapsed
Time
Analysis
29. The point? #1 – Average is misleading.
• It is easy to calculate the average elapsed
time...even from Statspack.
• But saying, “The average elapsed time is X.”
will most likely mislead everyone.
• The median or mode(s) is a much better
representation of the typical elapsed times.
• If you need to communicate typical elapsed
times, you need to gather real data.
SQL
Elapsed
Time
Analysis
30. The point? #2 – Modeling SQL E.
• Two basic ways to reduce elapsed times:
– Reduce work to be done.
– Reduce time to process each piece of work.
• SQL statement elapsed time can be
simply modeled.
• SQL statement elapsed time can be
anticipated.
SQL
Elapsed
Time
Analysis
31. Want to dig deeper?
• Craig’s Blog – A W i d e r V i e w
• Training from OraPub
Melbourne
– Oracle Performance Firefighting (I)
&
Perth
in
– Adv Oracle Performance Analysis (II) Q2
2012
• Books
– Oracle Performance Firefighting (C. Shallahamer)
• Chapter 9 is FREE to download
SQL
Elapsed
Time
Analysis