This document discusses using Java agents to extend Spark functionality. Java agents allow instrumentation of JVM applications like Spark at runtime. Specifically, agents could be used to monitor block caching in Spark and make recommendations to improve caching decisions. The document provides examples of how to transform Spark classes at runtime using agents to track block usage and cache hits. Overall, agents provide a powerful way to enhance Spark without requiring code changes.
Video: https://www.facebook.com/atscaleevents/videos/1693888610884236/ . Talk by Brendan Gregg from Facebook's Performance @Scale: "Linux performance analysis has been the domain of ancient tools and metrics, but that's now changing in the Linux 4.x series. A new tracer is available in the mainline kernel, built from dynamic tracing (kprobes, uprobes) and enhanced BPF (Berkeley Packet Filter), aka, eBPF. It allows us to measure latency distributions for file system I/O and run queue latency, print details of storage device I/O and TCP retransmits, investigate blocked stack traces and memory leaks, and a whole lot more. These lead to performance wins large and small, especially when instrumenting areas that previously had zero visibility. This talk will summarize this new technology and some long-standing issues that it can solve, and how we intend to use it at Netflix."
Video: https://www.facebook.com/atscaleevents/videos/1693888610884236/ . Talk by Brendan Gregg from Facebook's Performance @Scale: "Linux performance analysis has been the domain of ancient tools and metrics, but that's now changing in the Linux 4.x series. A new tracer is available in the mainline kernel, built from dynamic tracing (kprobes, uprobes) and enhanced BPF (Berkeley Packet Filter), aka, eBPF. It allows us to measure latency distributions for file system I/O and run queue latency, print details of storage device I/O and TCP retransmits, investigate blocked stack traces and memory leaks, and a whole lot more. These lead to performance wins large and small, especially when instrumenting areas that previously had zero visibility. This talk will summarize this new technology and some long-standing issues that it can solve, and how we intend to use it at Netflix."
Building a Streaming Microservice Architecture: with Apache Spark Structured ...Databricks
As we continue to push the boundaries of what is possible with respect to pipeline throughput and data serving tiers, new methodologies and techniques continue to emerge to handle larger and larger workloads
Ever tried to get get clarity on what kinds of memory there are and how to tune each of them ? If not, very likely your jobs are configured incorrectly. As we found out, its is not straightforward and it is not well documented either. This session will provide information on the types of memory to be aware of, the calculations involved in determining how much is allocated to each type of memory and how to tune it depending on the use case.
The Linux kernel is undergoing the most fundamental architecture evolution in history and is becoming a microkernel. Why is the Linux kernel evolving into a microkernel? The potentially biggest fundamental change ever happening to the Linux kernel. This talk covers how companies like Facebook and Google use BPF to patch 0-day exploits, how BPF will change the way features are added to the kernel forever, and how BPF is introducing a new type of application deployment method for the Linux kernel.
Performance Wins with BPF: Getting StartedBrendan Gregg
Keynote by Brendan Gregg for the eBPF summit, 2020. How to get started finding performance wins using the BPF (eBPF) technology. This short talk covers the quickest and easiest way to find performance wins using BPF observability tools on Linux.
Presto is an open source distributed SQL query engine for running interactive analytic queries against data sources of all sizes ranging from gigabytes to petabytes. Presto was designed and written from the ground up for interactive analytics and approaches the speed of commercial data warehouses while scaling to the size of organizations like Facebook. One key feature in Presto is the ability to query data where it lives via a uniform ANSI SQL interface. Presto’s connector architecture creates an abstraction layer for anything that can be expressed in a row-like format, such as HDFS, Amazon S3, Azure Storage, NoSQL stores, relational databases, Kafka streams and even proprietary data stores. Furthermore, a single Presto query can combine data from multiple sources, allowing for analytics across your entire organization.
This talk will be co-presented by Facebook and Teradata, the two largest contributors to Presto. The talk will focus on Presto’s ability to query virtually any data source via it’s connector interface. Facebook and Teradata will present some of their use cases of Presto querying various data sources, discuss the existing connectors in Presto, and describe the anatomy of a connector.
Running Airflow Workflows as ETL Processes on Hadoopclairvoyantllc
While working with Hadoop, you'll eventually encounter the need to schedule and run workflows to perform various operations like ingesting data or performing ETL. There are a number of tools available to assist you with this type of requirement and one such tool that we at Clairvoyant have been looking to use is Apache Airflow. Apache Airflow is an Apache Incubator project that allows you to programmatically create workflows through a python script. This provides a flexible and effective way to design your workflows with little code and setup. In this talk, we will discuss Apache Airflow and how we at Clairvoyant have utilized it for ETL pipelines on Hadoop.
Overcoming Scaling Challenges in MongoDB Deployments with SSDMongoDB
Horizontal scaling of databases can increase performance and capacity, but adding nodes also increases infrastructure and management complexities. Cluster management can challenge even the most seasoned IT professional. While vertical scaling is easier to implement, it has traditionally been limited by memory and disk throughput. As both SSD latency and price continue to improve, the MongoDB database scaling equation changes. This session will review a number of SSD technologies that Intel employs (SATA, NVMe) and their impacts on I/O performance and database scaling. We will look at various architectural options for optimizing I/O based on our discussions with real world users. We will also provide attendees a glimpse at our future plans in terms of technologies in the storage area.
Apache Solr, an open source enterprise search platform, is being used by a number of organizations to serve mission critical production data. With Solr, it has long been a challenge for organizations to mitigate the risk when change is on the way - upgrades, development of applications, change of configurations, etc. Backup and disaster recovery capability in Solr addresses a number of concerns related to storing and serving business critical data using Solr.
In this talk, we will discuss the backup and disaster recovery capability in Solr. We will also discuss how the integration of Solr with Hadoop ecosystem enables performing backup operations efficiently and in a scalable fashion within the same datacenter or to the public clouds.
MongoDB Ops Manager is the easiest way to manage/monitor/operationalize your MongoDB footprint across your enterprise. Ops Manager automates key operations such as deployments, scaling, upgrades, and backups, all with the click of a button and integration with your favorite tools. It also provide the ability to monitor and alert on dozens of platform specific metrics. In this webinar, we'll cover the components of Ops Manager, as well as how it integrates and accelerates your use of MongoDB.
Building a Streaming Microservice Architecture: with Apache Spark Structured ...Databricks
As we continue to push the boundaries of what is possible with respect to pipeline throughput and data serving tiers, new methodologies and techniques continue to emerge to handle larger and larger workloads
Ever tried to get get clarity on what kinds of memory there are and how to tune each of them ? If not, very likely your jobs are configured incorrectly. As we found out, its is not straightforward and it is not well documented either. This session will provide information on the types of memory to be aware of, the calculations involved in determining how much is allocated to each type of memory and how to tune it depending on the use case.
The Linux kernel is undergoing the most fundamental architecture evolution in history and is becoming a microkernel. Why is the Linux kernel evolving into a microkernel? The potentially biggest fundamental change ever happening to the Linux kernel. This talk covers how companies like Facebook and Google use BPF to patch 0-day exploits, how BPF will change the way features are added to the kernel forever, and how BPF is introducing a new type of application deployment method for the Linux kernel.
Performance Wins with BPF: Getting StartedBrendan Gregg
Keynote by Brendan Gregg for the eBPF summit, 2020. How to get started finding performance wins using the BPF (eBPF) technology. This short talk covers the quickest and easiest way to find performance wins using BPF observability tools on Linux.
Presto is an open source distributed SQL query engine for running interactive analytic queries against data sources of all sizes ranging from gigabytes to petabytes. Presto was designed and written from the ground up for interactive analytics and approaches the speed of commercial data warehouses while scaling to the size of organizations like Facebook. One key feature in Presto is the ability to query data where it lives via a uniform ANSI SQL interface. Presto’s connector architecture creates an abstraction layer for anything that can be expressed in a row-like format, such as HDFS, Amazon S3, Azure Storage, NoSQL stores, relational databases, Kafka streams and even proprietary data stores. Furthermore, a single Presto query can combine data from multiple sources, allowing for analytics across your entire organization.
This talk will be co-presented by Facebook and Teradata, the two largest contributors to Presto. The talk will focus on Presto’s ability to query virtually any data source via it’s connector interface. Facebook and Teradata will present some of their use cases of Presto querying various data sources, discuss the existing connectors in Presto, and describe the anatomy of a connector.
Running Airflow Workflows as ETL Processes on Hadoopclairvoyantllc
While working with Hadoop, you'll eventually encounter the need to schedule and run workflows to perform various operations like ingesting data or performing ETL. There are a number of tools available to assist you with this type of requirement and one such tool that we at Clairvoyant have been looking to use is Apache Airflow. Apache Airflow is an Apache Incubator project that allows you to programmatically create workflows through a python script. This provides a flexible and effective way to design your workflows with little code and setup. In this talk, we will discuss Apache Airflow and how we at Clairvoyant have utilized it for ETL pipelines on Hadoop.
Overcoming Scaling Challenges in MongoDB Deployments with SSDMongoDB
Horizontal scaling of databases can increase performance and capacity, but adding nodes also increases infrastructure and management complexities. Cluster management can challenge even the most seasoned IT professional. While vertical scaling is easier to implement, it has traditionally been limited by memory and disk throughput. As both SSD latency and price continue to improve, the MongoDB database scaling equation changes. This session will review a number of SSD technologies that Intel employs (SATA, NVMe) and their impacts on I/O performance and database scaling. We will look at various architectural options for optimizing I/O based on our discussions with real world users. We will also provide attendees a glimpse at our future plans in terms of technologies in the storage area.
Apache Solr, an open source enterprise search platform, is being used by a number of organizations to serve mission critical production data. With Solr, it has long been a challenge for organizations to mitigate the risk when change is on the way - upgrades, development of applications, change of configurations, etc. Backup and disaster recovery capability in Solr addresses a number of concerns related to storing and serving business critical data using Solr.
In this talk, we will discuss the backup and disaster recovery capability in Solr. We will also discuss how the integration of Solr with Hadoop ecosystem enables performing backup operations efficiently and in a scalable fashion within the same datacenter or to the public clouds.
MongoDB Ops Manager is the easiest way to manage/monitor/operationalize your MongoDB footprint across your enterprise. Ops Manager automates key operations such as deployments, scaling, upgrades, and backups, all with the click of a button and integration with your favorite tools. It also provide the ability to monitor and alert on dozens of platform specific metrics. In this webinar, we'll cover the components of Ops Manager, as well as how it integrates and accelerates your use of MongoDB.
Following presentation answers:
- Why do we need evolution?
- What happens if we do not evolve the software?
- What are the types of software evolution?
- What are Lehman's laws
- What are the strategies for evolution?
Youmah, meaning mother in Arabic, harkens back to a time when moms used to feed their children straight from the farm and bath them with olive oil soap mixed with natural blended oils. It was the soft voice of “Youmah” that expressed unconditional love, care and warmth, creating a safe family environment.
http://www.youmah.com/
Youmah, meaning mother in Arabic, harkens back to a time when moms used to feed their children straight from the farm and bath them with olive oil soap mixed with natural blended oils. It was the soft voice of “Youmah” that expressed unconditional love, care and warmth, creating a safe family environment. http://www.youmah.com/
Suomen Asiakastieto: AREX ja laskurahoituksen uudet muodotAREX
Suomen Asiakastieto-lehti kirjoitti jutun AREX:sta ja siitä miten uusi palvelumme antaa pienille ja keskisuurille yrityksille uudentyyppisiä mahdollisuuksia hallita yrityksen kassavirtaa esimerkiksi perinteisen ja kalliin faktoroinnin sijaan nopeammin, joustavammin ja vain 0,25% palkkiolla.
Lue lisää ja jos kiinnostuit niin laita mailia:
Web:
http://www.arex.io
Email:
finland@arex.io
Monitoring crop consumptive water use by applying recent remote sensing techniques has become a topic of research interest in water resources management and planning. In irrigated agriculture, conventional methods of estimating water use are costly. This study aims at estimate the relationship between tobacco crop evapotranspiration (ETcrop) and the normalized difference vegetation index (NDVI) during the crop development stage at Chedgelow irrigated farm in Zimbabwe. Tobacco ETcrop was estimated as a product of reference evapotranspiration (ETo) and crop coefficient (Kc). The Penman-Monteith model was applied to estimate ETo using climate data from Kutsaga research station, some 2 km away from the farm. Kc values were extracted from FAO tables. Five cloud-free MODIS images for the month of October in 2000, 2001, 2002, 2003 and 2007 were processed extract the NDVI values using ILWIS GIS. The results show significant (p = 0.000) differences between tobacco NDVI values over the years studied. The results also show a strong and significant positive relationship (r2 = 0.8061, p = 0.047) between ETcrop estimated using Penman Monteith model and NDVI. Research findings show that satellite derived NDVI is a good and reliable predictor of tobacco crop water evapotranspiration. Therefore, remotely sensed NDVI can be used to monitor crop water use in irrigated tobacco fields in areas where resources do not permit field measurements.
An experiment was carried out in Bakura and Zaria to evaluate heterosis for downy mildew resistance in some pearl millet using Complete Randomized Block Design. Four resistant varieties (PEO5532, SOSATC88, P1449 and DMR15) and four susceptible varieties (BDP1, MOP1, LCIC9702 and PEO5984 were used as male and female respectively. The resistant varieties were crossed with the susceptible varieties using North Carolina design 11. Sixteen (F1) hybrids obtained were evaluated along with their parents for downy mildew resistance, grain yield and other agronomic traits. The analysis of variance showed highly significant difference among parents and hybrids for all agronomic characters. Location × genotype interaction effects were only significant for grain yield and number of panicles per plot. The study selected the best parents that give high heterosis in terms of yield components, yield and downy mildew resistance. Two hybrids PEO5984 × P1449 and PEO5984 × PEO5532 had significant heterosis for 50% days to flower ng, PEO5984 × P1449, PEO5984 × PEO5532, PEO5984 × DMR15 and PEO5984 × SOSATC88 for yield, the best MP and BP heterosis for downy mildew incidence is PEO5984 × P1449 and MOP1 × p1449 for MP heterosis and BDP1 × P1449 for BP heterosis. Correlation among the characters studied showed that magnitudes of genetic correlation were higher than those of phenotypic correlation in some of the traits considered. The number of panicles / plot and panicle weight / plot showed significant genetic correlations indicate degree of correlation with grain yield. This showed that selection for any of these characters could lead to indirect selection of grain yield.
Youmah.com believes that moms should use non-toxic products for their families always. We are committed to providing mothers of the Middle East with nothing but the safest products.
http://www.youmah.com/
Java Colombo Meetup on 22nd March 2018
Speaker: Isuru Perera, Technical Lead at WSO2
Flame graphs are a visualization of profiled software and it was developed by Brendan Gregg, an industry expert in computing performance and cloud computing. Finding out why CPUs are busy is an important task when troubleshooting performance issues and we often use a sampling profiler to see which code-paths are hot. However, a profiler will dump a lot of data with thousands of lines and it is not easy to go through all data. With Flame Graphs, we can identify the most frequent code-paths quickly and accurately. Basically, a Flame Graph can simply visualize the stack traces output of a sampling profiler.
There are many ways to profile Java applications and Java Flight Recorder (JFR) is a really good tool to profile a Java application with a very low overhead. I will show how we can generate a Flame Graph from a Java Flight Recording using the JFR Flame Graph tool (https://github.com/chrishantha/jfr-flame-graph) I developed.
Since Flame Graphs can visualize any stack profiles, we can also use a Linux system profiler (perf) and create a Java Mixed-Mode Flame Graph, which will show how much CPU time is spent in Java methods, system libraries and the kernel. We can troubleshoot performance issues related to high CPU usage easily with a flame graph showing profile information from both system code paths and Java code paths. I will discuss how we can use the -XX:+PreserveFramePointer option in JDK and the perf system profiler to generate a Java Mixed-mode flame graph.
From common errors seen in running Spark applications, e.g., OutOfMemory, NoClassFound, disk IO bottlenecks, History Server crash, cluster under-utilization to advanced settings used to resolve large-scale Spark SQL workloads such as HDFS blocksize vs Parquet blocksize, how best to run HDFS Balancer to re-distribute file blocks, etc. you will get all the scoop in this information-packed presentation.
Java Training | Java Tutorial for Beginners | Java Programming | Java Certifi...Edureka!
This Edureka Java Training tutorial will help you in understanding the core fundamentals of Java. It helps you to learn following topics:
1) Introduction to Java
2) Java Timeline
3) Features of Java
4) How does Java work?
5) Data Types in Java
6) Operators in Java
7) Functions in Java
8) Object Oriented Concepts in Java
Java Performance and Using Java Flight RecorderIsuru Perera
Slides used for an internal training. Explains why throughput and latency are important when measuring performance. How Java Flight Recording can be used to analyze performance issues.
Java is one of the most popular languages and it's very important to understand the performance of Java servers. Modern JVMs compile the Java code in runtime using Just-In-Time (JIT) compiler and such JIT compiled code runs very close to optimized native code in terms of speed.
When understanding performance, it's important to know how Java works and we can also measure the performance using key metrics like Throughput and Latency. After measuring the performance, we can use profilers to understand the application behavior and find performance bottlenecks.
In this session, we will look at how Java manages the memory and how it optimizes the Java code using JIT compilation. We will also look at how we can use the Java Flight Recorder (JFR) to profile the JVM and find performance bottlenecks.
Finally, we can look at how "Flame Graphs" can be used to identify the most frequent code-paths quickly and accurately.
Unit testing in JavaScript? There is no such thing.” This is something most of the Java developers would say. With AngularJS coming more and more to scene and Google standing behind it, testing is starting to be core part of all AngularJS project. I would like to show how you can do unit testing in pure JavaScript (AngularJS) application (together with backend mocking…).
DCSF19 Docker Containers & Java: What I Wish I Had Been ToldDocker, Inc.
Mohammed Aboullaite, xHub
Nowadays, containers are more than a cool new tool to play with - they've revolutionized the way we develop, architect and ship software and have become part of our day-to-day operations. On the other hand, Java has been around for more than 2 decades, dominating the entreprise world. Both advocate the "RUN anywhere" principal, but, is it that easy? No! Your perfect working local container will most probably fail on production because of MEMORY &/or CPU issues, since jvm apps assume they OWN the server they are running on.
This session will look at the gotchas of running JVM apps in containers & how to avoid costly pitfalls. We will cover:
_ what updates Java 10 brought to the table to improve container awareness and the issues related to prior versions, including how to address each one of them to avoid the mess.
- tips and tricks to obtain smaller images & best practices while writing your DockerFiles
- some plugins to helps non-containers experts integrate docker in their development process; and
- the concept of "Distroless" Docker Images and how to benefit from it.
Covers the common issues seen when migrating from Java 8 to Java 9. This deck shows simplified examples of the issues and code snippets of how to address them.
DevoxxUK: Optimizating Application Performance on KubernetesDinakar Guniguntala
Now that you have your apps running on K8s, wondering how to get the response time that you need ? Tuning a polyglot set of microservices to get the performance that you need can be challenging in Kubernetes. The key to overcoming this is observability. Luckily there are a number of tools such as Prometheus that can provide all the metrics you need, but here is the catch, there is so much of data and metrics that is difficult make sense of it all. This is where Hyperparameter tuning can come to the rescue to help build the right models.
This talk covers best practices that will help attendees
1. To understand and avoid common performance related problems.
2. Discuss observability tools and how they can help identify perf issues.
3. Look closer into Kruize Autotune which is a Open Source Autonomous Performance Tuning Tool for Kubernetes and where it can help.
What Is Java | Java Tutorial | Java Programming | Learn Java | EdurekaEdureka!
This Edureka "What Is Java" tutorial will help you in understanding the various fundamentals of Java in detail with examples. Below are the topics covered in this tutorial:
1) What is Java?
2) Where is Java used?
3) Features of Java
4) Java Environment
5) How does Java work?
6) Data Types in Java
7) Operators in Java
8) Functions in Java
9) Object Oriented Concepts in Java
Stage Level Scheduling Improving Big Data and AI IntegrationDatabricks
In this talk, I will dive into the stage level scheduling feature added to Apache Spark 3.1. Stage level scheduling extends upon Project Hydrogen by improving big data ETL and AI integration and also enables multiple other use cases. It is beneficial any time the user wants to change container resources between stages in a single Apache Spark application, whether those resources are CPU, Memory or GPUs. One of the most popular use cases is enabling end-to-end scalable Deep Learning and AI to efficiently use GPU resources. In this type of use case, users read from a distributed file system, do data manipulation and filtering to get the data into a format that the Deep Learning algorithm needs for training or inference and then sends the data into a Deep Learning algorithm. Using stage level scheduling combined with accelerator aware scheduling enables users to seamlessly go from ETL to Deep Learning running on the GPU by adjusting the container requirements for different stages in Spark within the same application. This makes writing these applications easier and can help with hardware utilization and costs.
There are other ETL use cases where users want to change CPU and memory resources between stages, for instance there is data skew or perhaps the data size is much larger in certain stages of the application. In this talk, I will go over the feature details, cluster requirements, the API and use cases. I will demo how the stage level scheduling API can be used by Horovod to seamlessly go from data preparation to training using the Tensorflow Keras API using GPUs.
The talk will also touch on other new Apache Spark 3.1 functionality, such as pluggable caching, which can be used to enable faster dataframe access when operating from GPUs.
2. Meet The Speakers
● Backend engineer
● Hands-on experience with JVM
○ OpenJDK Reviewer
● Strong focus on performance
○ VisualVM Contributor
○ BTrace Maintainer and Lead
Developer
Jaroslav Adrian
● Backend engineer
● 5+ years of experience in
performance monitoring &
modeling
● Focusing on tuning and
optimization of Big Data apps
4. Caching in Spark
…
rdd.cache()
rdd.count()
…
rdd.reduceBy
Key((x,y) =>
x+y).count()
1. Evaluate
part #1
Executor
part #2
Executor
part #3
Executor
Block
Manager
Block
Manager
Block
Manager
2. Caching
part #1 part #2 part #3
3. Fetch or
re-evaluate part #1 part #2 part #3
Avoiding re-evaluation for cached RDD blocks
5. Spark Caching Problem
• RDD Caching
- Benefits: speedup, saved resources
- Too much caching may waste resources
• Spot the opportunity
- Which RDDs to cache (for most benefit)?
- How to prioritize when memory is scarce?
- Where to cache?
- Benefit depends on memory state
• http://unraveldata.com/to-cache-or-not-to-cache/
Challenging to decide when, what, and where to cache
6. Algorithm
1. Find stages that share RDDs
2. Cached RDDs: Measure benefit
Block hitRate & time saved for every Stage
3. RDDs not cached: Potential benefit
Approximate time saved & RDD storage size
4. Suggest which RDDs to cache
Need to collect additional metrics
Insufficient visibility
into Spark structures
e.g., only block info in
BlockStatusListener
8. Meet Java Agent
Premain-Class: com.myorg.agents.FancyAgent
Can-Redefine-Classes: true
Can-Retransform-Classes: true
META-INF/manifest.mf
public static void premain(String args, Instrumentation inst) {
// do the magic stuff here
}
FancyAgent.java
Launcher
java -javaagent:myfancyagent.jar=<args>
● Runs JVM with an agent
● Agent jar
○ agent class
○ required manifest entries
● Arguments
○ any string understood by agent class
● Multiple agents can be specified
9. Meet Java Agent
Premain-Class: com.myorg.agents.FancyAgent
Can-Redefine-Classes: true
Can-Retransform-Classes: true
META-INF/manifest.mf
public static void premain(String args, Instrumentation inst) {
// do the magic stuff here
}
FancyAgent.java
Launcher
java -javaagent:myfancyagent.jar=<args>
● Executed at JVM startup
● Instrumentation provides access to JVM internals
10. Meet Java Agent
Premain-Class: com.myorg.agents.FancyAgent
Can-Redefine-Classes: true
Can-Retransform-Classes: true
META-INF/manifest.mf
public static void premain(String args, Instrumentation inst) {
// do the magic stuff here
}
FancyAgent.java
Launcher
java -javaagent:myfancyagent.jar=<args>
● Agent class
● Must be present in the agent jar
11. Meet Java Agent
Premain-Class: com.myorg.agents.FancyAgent
Can-Redefine-Classes: true
Can-Retransform-Classes: true
META-INF/manifest.mf
public static void premain(String args, Instrumentation inst) {
// do the magic stuff here
}
FancyAgent.java
Launcher
java -javaagent:myfancyagent.jar=<args>
Transform classes upon load
12. Meet Java Agent
Premain-Class: com.myorg.agents.FancyAgent
Can-Redefine-Classes: true
Can-Retransform-Classes: true
META-INF/manifest.mf
public static void premain(String args, Instrumentation inst) {
// do the magic stuff here
}
FancyAgent.java
Launcher
java -javaagent:myfancyagent.jar=<args>
● Agent capabilities and settings
○ retransform classes
○ redefine classes
○ native method prefix
https://docs.oracle.com/javase/7/docs/api/java/lang/instrument/package-summary.html
13. Class Transformers
class SpecialLibraryClass {
public void doStuff() {
System.out.println(
"Doing stuff #" + id(System.currentTimeMillis())
);
}
private int id(int input) {
return input % 42;
}
}
Private method in 3rd
party package
private method.
Patch and recompile? Reflection?
http://pixabay.com
14. Class Transformers
class SpecialLibraryClass {
public void doStuff() {
System.out.println("Doing stuff #" + id(System.currentTimeMillis()));
}
private int id(int input) {
AgentCallbacks.onEnter("SLC", "id", "input = " + input);
int tmp = input % 42;
AgentCallbacks.onReturn("SLC", "id", tmp);
return tmp;
}
}
http://pixabay.com
15. Class Transformers
java.lang.instrument.ClassTransformer
byte[] transform(ClassLoader l, String name, Class<?> cls,
ProtectionDomain pd, byte[] classfileBuffer)
● Inspect and modify class data
○ without recompilation
○ even on-the-fly
● Powerful
○ introduce callbacks
○ patch problematic code
● Not a simple task
○ class data structure
○ constant pool
○ stack frame maps
http://wikipedia.org
16. BTrace
● Open source dynamic instrumentation
framework for JVM
● Java annotations based DSL for class
transformations
● Optimized for high performance
● Used eg. in VisualVM
(http://visualvm.github.io)
https://github.com/btraceio/btrace
17. Spark Config Tuning
● Intercept SparkContext instantiation at Spark Driver
● Modify the associated SparkConf object
○ before SparkContext is fully instantiated
● Any Spark property can be changed
○ eg. “spark.executor.cores” based on system
load
● Modified SparkConf will be applied to the current job
○ and distributed to to all executors
20. Agents on Spark!
● Spark is a JVM application
● Any Java agent can be used with Spark
http://apache.org
http://pixabay.com
21. Register JVM Agent for Spark
java -javaagent:myfancyagent.jar=<args>
spark.executor.extraJavaOptions=
”-javaagent:/opt/myagent/myagent.jar=opt.load:true”
spark.driver.extraJavaOptions=
”-javaagent:/opt/myagent/myagent.jar=track.conf:true”
Store the options in spark-defaults.conf to apply system-wide.
Spark configuration parameters
http://arthurandsage.blogspot.cz/
28. Distributing Agents for Spark
• Manually copy agents to all nodes
Make sure all nodes have the latest and same copy of agent binaries
https://www.quickmeme.com
• Put that script in CRON!
• Script that copy process
29. Yarn Localization Service
● Built-in resource distribution system
● Cluster resources
○ linked into executor working
directories
○ kept up-to-date
● Supported resource types
○ files
○ archives
● https://spark.apache.org/docs/1.5.2/running-on-yarn.html
30. Takeaways
● Sometimes even rich set of Spark metrics, logs and events is not
sufficient
● Java agents are powerful tool
○ extend application beyond the original intent
○ hot-patch problems or enhancements
○ may be removed when not needed
● Try Unravel to see the power of Java agents unleashed
31. Resources
● To simplify application and operations management with Spark, try out
Unravel
○ http://unraveldata.com/free-trial/
● Start with Java agents and try out BTrace
○ https://github.com/btraceio/btrace
○ contributors most sincerely welcome!
● Spark Configuration
○ http://spark.apache.org/docs/latest/configuration.html
○ https://spark.apache.org/docs/1.5.2/running-on-yarn.html
● Java Agents
○ https://docs.oracle.com/javase/7/docs/api/java/lang/instrument/pac
kage-summary.html
○ http://zeroturnaround.com/rebellabs/how-to-inspect-classes-in-your
-jvm/