SlideShare a Scribd company logo
Page1 © Hortonworks Inc. 2011 – 2015. All Rights Reserved
LLAP: Building Cloud-First BI
Sergey Shelukhin
Page2 © Hortonworks Inc. 2011 – 2015. All Rights Reserved
LLAP: Building Cloud-First BI
• What is LLAP? Overview
• Cloud-first BI
• Efficient, scalable multi-user execution and caching
• Secure
• Universal (not just for Hive)
• Production-ready tools
• How to run LLAP
Page3 © Hortonworks Inc. 2011 – 2015. All Rights Reserved
Overview
Page4 © Hortonworks Inc. 2011 – 2015. All Rights Reserved
What is LLAP?
• Hybrid model combining daemons and containers for
fast, concurrent execution of analytical workloads
(e.g. Hive SQL queries)
• Concurrent queries without specialized YARN queue setup
• Multi-threaded execution of vectorized operator pipelines
• Asynchronous IO and efficient in-memory caching
• Relational view of the data available thru the API
• High performance scans, code pushdown, centralized security
• Not an "execution engine" (like Tez, MR, Spark)
• Not a storage substrate – reads from HDFS/S3/…
Node
LLAP Process
Cache
Query Fragment
HDFS
Query Fragment
Page5 © Hortonworks Inc. 2011 – 2015. All Rights Reserved
LLAP and Hive
• Transparent to users, BI tools, etc. – HS2/JDBC is the access point
Deep
Storage
YARN Cluster
HiveServer2
(Query
Endpoint)
ODBC,
JDBC SQL
Queries
LLAP Daemon
Query
Executors
LLAP Daemon
Query
Executors
LLAP Daemon
Query
Executors
LLAP Daemon
Query
Executors
Query
Coordinators
Coord-
inator
Coord-
inator
Coord-
inator
In-Memory Cache
(Shared Across All Users)
HDFS and
Compatible
S3 WASB Isilon
DAGs
Page6 © Hortonworks Inc. 2011 – 2015. All Rights Reserved
LLAP and Hive
• LLAP is Hive
• Supports all file formats that Hive does
• Hive Operators used for processing, same compiler, etc.
• ⇒ Automatic support for most new optimizations and features
• HS2 controls the concurrent queries (session pool)
• Each Query coordinated by a Tez AM; LLAP hosts Tez shuffle
• Can run in parallel with container-based jobs
• After perf testing, we recommend running most Hive workloads in LLAP
• In this new model, the cluster capacity is divided proportionally if needed
Page7 © Hortonworks Inc. 2011 – 2015. All Rights Reserved
LLAP in a BI system - overview
• No split brain – a single platform for ETL…
• Fault-tolerant components and proven scalability (runs TPCDS 100 Tb)
• ANSI SQL, CB Optimizer, ACID transactions
• …and BI
• Vectorized engine for fast processing
• Intelligent scheduling of different workloads running together
• Caching, incl. on local disk (SSD), to avoid expensive reads
• Zero-ETL analytics with efficient caching of text data
• External access, one metadata store, unified security
Page8 © Hortonworks Inc. 2011 – 2015. All Rights Reserved
Efficient BI queries
Page9 © Hortonworks Inc. 2011 – 2015. All Rights Reserved
LLAP
Queue
Short overview – execution
• LLAP daemon has a number of executors
(think containers) that run "fragments"
• Fragments are parts of multiple parallel
workloads (e.g. Hive SQL queries)
• Work queue with pluggable priority
• Geared towards low latency queries over long-
running queries (by default)
• I/O is similar to containers – read/write to
HDFS, shuffle, other storages and formats
• Streaming output for data API
Executor
Q1 Map 1
Executor
External read
Executor
Q3 Reducer 3
Q1 Map 1
Q1 Map 1
Q3 Map 19
HDFS
Waiting for
shuffle inputs
HBase
LLAP
(shuffle input)
Spark
executor
Page10 © Hortonworks Inc. 2011 – 2015. All Rights Reserved
Efficiency for individual queries
• Eliminates container startup costs
• JIT optimizer has a chance to work (esp. for vectorization)
• Data sharing (hash join tables, etc.)
0 5 10 15 20 25
New containers
Cold LLAP
Warm LLAP (no cache, new user)
4th run of the query (no cache,…
Time, sec
Page11 © Hortonworks Inc. 2011 – 2015. All Rights Reserved
Individual queries – LLAP vs Hive 1 (x26 faster)
0
5
10
15
20
25
30
35
40
45
50
0
50
100
150
200
250
Speedup(xFactor)
QueryTime(s)(LowerisBetter)
Hive 1 / Tez Time (s) Hive 2 / LLAP Time(s) Speedup (x Factor)
Page12 © Hortonworks Inc. 2011 – 2015. All Rights Reserved
Hive LLAP vs Impala; TPCDS 10Tb on 9 nodes
5000 7000 9000 11000 13000
CDH 5.12
HDP 2.6
Total Runtime (sec)
(Lower is Better)
0 20 40 60 80 100
CDH 5.12
HDP 2.6
TPC-DS Queries
Supported
(Higher is Better)
60
99/99
Page13 © Hortonworks Inc. 2011 – 2015. All Rights Reserved
Hive LLAP vs Impala (log scale; lower is better)
1
10
100
1000
10000
query64
query13
query83
query91
query93
query47
query85
query57
query99
query78
query59
query62
query2
query89
query71
query51
query43
query48
query88
query28
query17
query11
query25
query3
query97
query74
query50
query53
query63
query90
query33
query96
query60
query15
query69
query75
query46
query26
query34
query7
query1
query55
query52
query73
query42
query65
query30
query56
query81
query19
query61
query39
query79
query4
query29
query9
query68
query31
query49
query76
Runtime(s)(LogScale)
HDP 2.6 (Hive LLAP) versus CDH 5.12 (Impala)
Page14 © Hortonworks Inc. 2011 – 2015. All Rights Reserved
Parallel queries – priorities, preemption
• Lower-priority fragments can be preempted
• For example, a fragment can start running before its inputs are
ready, for better pipelining; such fragments may be preempted
• LLAP work queue examines the DAG parameters to give
preference to interactive (BI) queries
LLAP
QueueExecutor
Executor
Interactive
query map 1/3
…
Interactive
query map 3/3
Executor
Interactive
query map 2/3
Wide query
reduce waiting
Time
ClusterUtilization
Long-Running Query
Short-Running Query
Page15 © Hortonworks Inc. 2011 – 2015. All Rights Reserved
Workload management (WIP - HIVE-17481)
Page16 © Hortonworks Inc. 2011 – 2015. All Rights Reserved
Overview
• Effectively share LLAP cluster resources
• Resource allocation per user policy; separate ETL and BI, etc.
• Resources based guardrails
• Protect against long running queries, high memory usage
• Improved, query-aware scheduling
• Scheduler is aware of query characteristics, types, etc.
• Fragments easy to pre-empt compared to containers
• Queries get guaranteed fractions of the cluster, but
can use empty space
Theory
Practice
Page17 © Hortonworks Inc. 2011 – 2015. All Rights Reserved
Resource plans
• Resource plan is a workload management configuration for a cluster
• Switching is allowed without stopping queries, e.g. based on time of day
• Cluster is divided into query pools (optionally nested)
• Each pool defines query parallelism, cluster resources percentage
• Queries are automatically routed to pools based on user name, app, etc.
• Rules to kill, move, or deprioritized queries based on DFS usage, runtime, etc.
• Example (commands may change in the final version):
CREATE RESOURCE PLAN daytime;
CREATE POOL bi IN daytime (resource_percent=75, concurrent_queries=5);
CREATE POOL etl IN daytime TIME (resource_percent=25, concurrent_queries=10);
CREATE RULE downgrade IN daytime WHEN total_runtime > 300 THEN MOVE etl;
ADD RULE downgrade TO bi;
CREATE MAPPING tableau (application=“Tableau”, pool=bi);
ALTER PLAN daytime SET default_pool='etl';
APPLY PLAN daytime;
Page18 © Hortonworks Inc. 2011 – 2015. All Rights Reserved
Decentralized guaranteed resources
• A guaranteed task for each resource (currently executor slots)
• HS2 gives N guaranteed tasks to an AM based on configured resource plan
• AMs mark N of its most important tasks as guaranteed at any given time
• Guarantee is not a requirement to use resource
• Guaranteed tasks pre-empt speculative tasks
• Future improvements – coordination improvements
• E.g. try to place on the least busy nodes
Page19 © Hortonworks Inc. 2011 – 2015. All Rights Reserved
Guaranteed tasks – BI and ETL example
BI (80% = 14 guaranteed) ETL (20% = 4 guaranteed)
Query 1 Query 2
LLAP Daemon 1 LLAP Daemon 2 LLAP Daemon 3
Wait Queue
Executors
10 active tasks (running):
10 guaranteed (running)
4 unused for now
19 active tasks (8 running):
4 guaranteed (4 running)
15 speculative (4 running)
HS2
18 executors total
Page20 © Hortonworks Inc. 2011 – 2015. All Rights Reserved
Caching
Page21 © Hortonworks Inc. 2011 – 2015. All Rights Reserved
Caching for BI workloads - basics
• Fine-grained (columnar), compact (dictionary, RLE encoded)
• Important due to projections over many wide EDW tables
• Prioritized – indexes are cached with higher priority
• Important to make use of PPD for BI query filters
• Off-heap (no extra GC), supports SSD
• Saves on cloud reads
• LRFU replacement policy avoids the damage from large scans
• Automatic coherence, flexible locality (hash based)
• Locality can be strict, or create additional replicas to avoid hotspots
Page22 © Hortonworks Inc. 2011 – 2015. All Rights Reserved
Caching for BI workloads – formats, zero-ETL
• On-prem, does not make large queries on ORC much faster
• On S3/Azure though, reads are much more slow
• Even disk cache is still much faster than FS reads
• Especially if text is involved
• Cache supports columnar data and text
• ORC cached natively; in 3.0, Parquet is also cached natively
• Possible future improvement – move Parquet caching onto IO threads
• Zero-ETL analytics on CSV and JSON data with text caching
• Text is efficiently encoded in background; once cached, queries speed up
Page23 © Hortonworks Inc. 2011 – 2015. All Rights Reserved
I/O threads
In-memory processing – native columnar (ORC)
SSD cache
Off-heap cache
Compact encoded data
Distributed FS
Compressed data
Decoder: ORC
col1
col2
Compression
codec
Read planner
Execution thread
Fragment
Hive
operator
Hive
operator
Vectorized
processin
g
col1 col2
Native data
vectors
Replacement
policy
Page24 © Hortonworks Inc. 2011 – 2015. All Rights Reserved
In-memory processing – columnar (Parquet)
SSD cache
Off-heap cache
Compact data
Distributed FS
Compressed data
Parquet reader
Execution thread
Fragment
Hive
operator
Hive
operator
Vectorized
processin
g
col1 col2
Native data
vectors
Replacement
policy
col1
col2
Cache
coordinator
Page25 © Hortonworks Inc. 2011 – 2015. All Rights Reserved
Up to 10x speed up with a cloud FS (100 Tb dataset, SSD)
0
1
2
3
4
5
6
7
8
9
10
0
500
1000
1500
2000
2500
3000
query71
query19
query73
query82
query68
query91
query12
query90
query18
query85
query27
query45
query13
query40
query48
query89
query79
query58
query66
query15
query42
query98
query26
query20
query46
query7
query17
query34
query96
query25
query32
query28
query21
query49
query87
query84
query50
query95
query97
query64
query55
query52
query93
query39
query76
query92
query94
query88
query3
query43
Speedup
Time,sec
Cold
With cache
Speedup
10x
• 1.5x overall
• 2.1x small
queries
Page26 © Hortonworks Inc. 2011 – 2015. All Rights Reserved
I/O threads
Execution thread
In-memory processing – text – the first read
Fragment
Hive
operator
Hive
operator
Vectorized
processin
g
col1 col2
SSD cache
Native data
vectors
Off-heap cache
Compact encoded data
Distributed FS
Compressed data
Decoder: ORC Read planner
Compression
codec
"Decoder": text
col1 col2
Encoder: ORC lite
Page27 © Hortonworks Inc. 2011 – 2015. All Rights Reserved
I/O threads
Execution thread
In-memory processing – text – the second read
Fragment
Hive
operator
Hive
operator
Vectorized
processin
g
col1 col2
SSD cache
Native data
vectors
Off-heap cache
Compact encoded data
Distributed FS
Compressed data
Decoder: ORC
col2
Read planner
Compression
codec
"Decoder": text
Encoder: ORC lite
Page28 © Hortonworks Inc. 2011 – 2015. All Rights Reserved
Up to 38x speed up with text cache + cloud FS
Page29 © Hortonworks Inc. 2011 – 2015. All Rights Reserved
External access
Page30 © Hortonworks Inc. 2011 – 2015. All Rights Reserved
External access – relational view for everyone
• Hive-on-Tez and other DAG executors can use LLAP directly
• LLAP also provides a "relational datanode" view of the data
• Anyone (with access) can push the (approved) code in, from
complex query fragments to simple data reads
• E.g. a Spark DataFrame can be created with LlapInputFormat
• Gives the external services the access to
• Hive data: centralized, secure data access
• Ability to read all Hive table types, like ACID transactional tables
• Hive features: from column-level security, to LLAP columnar cache
Page31 © Hortonworks Inc. 2011 – 2015. All Rights Reserved
SparkSQL+LLAP example
• Ranger for Hive support cell-level security and masking
• With SparkSQL utilizing LLAP, this can be used from Spark
• More at https://hortonworks.com/blog/row-column-level-control-apache-spark/
Page32 © Hortonworks Inc. 2011 – 2015. All Rights Reserved
SparkSQL+LLAP example
• Ranger for Hive support cell-level security and masking
• With SparkSQL utilizing LLAP, this can be used from Spark
• More at https://hortonworks.com/blog/row-column-level-control-apache-spark/
Page33 © Hortonworks Inc. 2011 – 2015. All Rights Reserved
SparkSQL+LLAP example
• Ranger for Hive support cell-level security and masking
• With SparkSQL utilizing LLAP, this can be used from Spark
• More at https://hortonworks.com/blog/row-column-level-control-apache-spark/
Page34 © Hortonworks Inc. 2011 – 2015. All Rights Reserved
Security
Page35 © Hortonworks Inc. 2011 – 2015. All Rights Reserved
LLAP security – the EDW usage patterns
• Single, centrally administered LLAP cluster for all users
• For now, separate ad hoc clusters cannot use Ambari
• Use Ranger
• Hive SQL standard auth is an option; doAs is not recommended
• Hive session AMs and LLAP run as hive superuser; managed by HS2
• HS2 serves as a central coordinator for security
• Beeline and JDBC access; no CLI (requires client kinit)
• HS2 checks permissions, enforces Ranger policies
• Coordinates the usual Hadoop security dance (tokens for tasks, etc.)
Page36 © Hortonworks Inc. 2011 – 2015. All Rights Reserved
LLAP daemon
Task Jo
b
FS
SM T TK
LLAP security – internals with Tez
HS2
SM T TK
SessionSession
FS
Tez AM
T FS
ZK
Paths w/ACLs
T TK
Jo
b
Ranger
Policies
FS
LLAP daemon
Task Jo
b
FS
SM T TK
FS
Jo
b
F💓
FS
FS T🔐
T Task
Jo
b
Page37 © Hortonworks Inc. 2011 – 2015. All Rights Reserved
LLAP security – external (Spark) additions
FS
LLAP daemon
Task Jo
b
FS
SM T TK
Spark Client
FS Jo
b
FS
T
🔏 Specs
K
HS2
SM T TK
Session
FS
K
🔏 TaskT
K
K
Page38 © Hortonworks Inc. 2011 – 2015. All Rights Reserved
Integration and tools
Page39 © Hortonworks Inc. 2011 – 2015. All Rights Reserved
LLAP in Ambari (and HDP)
• Ambari 2.5 + HDP 2.6 = LLAP GA
• The latest recommended update is HDP 2.6.2.0
• Do not use Tech Preview versions; use GA
• Separate version of Hive, "Hive Interactive"
• Ambari 3.0 – no more separate versions
• Enable "Interactive Query" in Hive tab
• A default configuration is chosen; more on that later
• No Ambari? Will cover this later
Page40 © Hortonworks Inc. 2011 – 2015. All Rights Reserved
LLAP on the cloud
• LLAP is in HDC (Hortonworks Data Cloud)
• For quick, automated cluster deployments on AWS
• Also available on Azure HDInsight
• Details and links at the end!
Page41 © Hortonworks Inc. 2011 – 2015. All Rights Reserved
Tez UI – queries and LLAP integration
Page42 © Hortonworks Inc. 2011 – 2015. All Rights Reserved
Tez UI – query swimlane
Page43 © Hortonworks Inc. 2011 – 2015. All Rights Reserved
Tez UI – DAG swimlane with LLAP counters
Page44 © Hortonworks Inc. 2011 – 2015. All Rights Reserved
Tez UI – query information and debug data
Page45 © Hortonworks Inc. 2011 – 2015. All Rights Reserved
Monitoring
• LLAP exposes a UI for
monitoring
• Aggregate monitoring UI is
work in progress
• Lots of debug views and tools
– JMX, logging, etc. – see
backup slides
Page46 © Hortonworks Inc. 2011 – 2015. All Rights Reserved
Making the best use of LLAP - summary
• Java 8, G1GC; some kernel configs, esp. for TCP connections
• Ambari comes with reasonable Hive perf configuration
• May still need tweaking for specific workload; more so w/o Ambari
• SSD and text cache require "advanced config" until Ambari 3.0
• LLAP cluster sizing in a nutshell
• AM per query (+ 1-2), AMs on all nodes; 2Gb RAM per AM, rest to LLAP
• (Executor+IO thread) per core, 3-4Gb RAM per executor, rest to cache
• Without Ambari, see hive --service llap command + Slider
• See backup slides for some details ;)
Page47 © Hortonworks Inc. 2011 – 2015. All Rights Reserved
Future work for manageability
• UDF, configuration changes without affecting queries (rolling restart)
• In-place restart of the daemons – preserves cache
• Ambari integration for faster startup in common cases
• Improved scale-up/down (with Ambari and Slider integration)
Page48 © Hortonworks Inc. 2011 – 2015. All Rights Reserved
Summary
LLAP provides a
• unified, managed and secure cloud-ready EDW
solution for BI and ETL workloads via a
• fast execution substrate harnessing Hive
vectorized SQL engine and
• efficient in-memory caching layer for columnar
and text data
Page49 © Hortonworks Inc. 2011 – 2015. All Rights Reserved
Try Hive LLAP Today on-prem or in the Cloud
Hortonworks Data Platform 2.6
Powered by 100% open source Apache Hadoop
http://hortonworks.com/downloads/
Hortonworks Data Cloud
Easy HDP on Amazon Web Services
http://hortonworks.com/products/cloud/aws/
Microsoft Azure HDInsight
A cloud Spark and Hadoop service for your enterprise
http://azure.microsoft.com/en-us/services/hdinsight/
Page50 © Hortonworks Inc. 2011 – 2015. All Rights Reserved
Questions?
?
Interested? Stop by the Hortonworks booth to learn more
Page51 © Hortonworks Inc. 2011 – 2015. All Rights Reserved
Backup slides
Page52 © Hortonworks Inc. 2011 – 2015. All Rights Reserved
Tez UI – LLAP counters
Page53 © Hortonworks Inc. 2011 – 2015. All Rights Reserved
Debugging
• JMX view (:15002/jmx) contains many detailed metrics
• E.g. "ExecutorsState" shows the running tasks and their state
• Log lines for most operations are annotated with task attempt #
• By default, stores separate log files per query
• Logs can be downloaded (yarn logs ...) even for a running LLAP app
• Log file contains the statements annotated for the query
• File name contains session application ID and DAG# - "dag_TTTT_MMM_N"
- e.g. dag_1490656001509_4602_1 for Tez AM application_1490656001509_4602
Page54 © Hortonworks Inc. 2011 – 2015. All Rights Reserved
Making the best use of LLAP – OS and Java
• Java 8 strongly recommended
• G1 GC recommended (e.g. --args " -XX:+UseG1GC -XX:+ResizeTLAB -XX:-ResizePLAB")
• Kernel settings
sysctl -w net.core.somaxconn=16384;
echo "never" > /sys/kernel/mm/transparent_hugepage/enabled
echo "never" > /sys/kernel/mm/transparent_hugepage/defrag
/etc/init.d/nscd restart
Page55 © Hortonworks Inc. 2011 – 2015. All Rights Reserved
Making the best use of LLAP – cluster sizing
1. Pick the number of parallel queries (not just sessions)
• AM per query + some constant slack
2. Pick executors per node, and io.threadpool count (# of cores per node)
3. Determine total memory size for LLAP - subtract the AM(s) from each NM
(YARN memory per node)
• 1 AM = 2 Gb; best to spread the AMs across each node
4. Determine the Xmx for LLAP; one executor (core) == 3-4Gb
5. Determine cache size - from the total, take out Xmx + ~3Gb (if lower, 20%)
• ~3Gb for Java overhead, shared overhead
6. Tweak based on workload?
Page56 © Hortonworks Inc. 2011 – 2015. All Rights Reserved
Cluster sizing example
• 6 node cluster – 100Gb RAM each, 24 cores, NM Size = 96Gb, 25
concurrent queries
• 28 AMs; total AM memory = 28*2 = 56
• (96*6 – 28*2)/6 = 86.66 => "Memory per daemon" = 85Gb
• "LLAP heap size" (Xmx) = 3Gb*24 = 72Gb
• "Cache size" = 85Gb – 72Gb – 3Gb ~= 10Gb
Page57 © Hortonworks Inc. 2011 – 2015. All Rights Reserved
Making the best use of LLAP – Hive settings
• Ambari has a lot of this configured by default
• The basics - use ORC; enable PPD, configure mapjoin size, etc.
• Enable vectorization and consider new vectorization features
• hive.vectorized.execution.*.enabled – see the configuration file documentation
• Enable LLAP split locality - hive.llap.client.consistent.splits
• hive.llap.task.scheduler.locality.delay to tweak strict/relaxed locality
• Consider disabling CBO for interactive queries (test your queries!)
• Use parallel compilation in HS2 - hive.driver.parallel.compilation
• Shuffle improvement - tez.am.am-rm.heartbeat.interval-ms.max=5000
Page58 © Hortonworks Inc. 2011 – 2015. All Rights Reserved
Making the best use of LLAP – new cache stuff
• Text cache (not turned on in Ambari until 3.0!)
• hive.llap.io.encode.enabled,
hive.vectorized.use.(row|vector).serde.deserialize
• SSD cache (not turned on in Ambari until 3.0!)
• hive.llap.io.allocator.mmap; hive.llap.io.allocator.mmap.path
• hive.llap.io.memory.size controls the total cache size (on disk)
• You have to disable YARN memory check for now until YARN 2.8
• Cache on cloud FS
• hive.orc.splits.allow.synthetic.fileid,
hive.llap.cache.allow.synthetic.fileid
Page59 © Hortonworks Inc. 2011 – 2015. All Rights Reserved
LLAP without Ambari
• Requires Hive 2.X (2.2-2.3 are coming soon); ZK, YARN, Slider
• hive --service llap generates a slider package
• Run this as the correct user – slider paths are user-specific! kinit on secure cluster
• Specify a name, # of instances; memory, cache size, etc.; see --help
• Generates run.sh to start the cluster (in --output) directory
• Or use --startImmediately in newer versions
• Queries can be run from HS2 and CLI; basic configuration:
• hive.execution.mode=llap, hive.llap.execution.mode=all,
hive.llap.io.enabled=true, hive.llap.daemon.service.hosts=@<cluster
name>

More Related Content

PPTX
Hive + Tez: A Performance Deep Dive
PDF
Optimizing Hive Queries
PDF
Deep Dive into Spark SQL with Advanced Performance Tuning with Xiao Li & Wenc...
PPTX
Hive: Loading Data
PPTX
Introduction to Apache Kudu
PDF
Apache Iceberg - A Table Format for Hige Analytic Datasets
PPT
Chicago Data Summit: Apache HBase: An Introduction
PPTX
Reshape Data Lake (as of 2020.07)
Hive + Tez: A Performance Deep Dive
Optimizing Hive Queries
Deep Dive into Spark SQL with Advanced Performance Tuning with Xiao Li & Wenc...
Hive: Loading Data
Introduction to Apache Kudu
Apache Iceberg - A Table Format for Hige Analytic Datasets
Chicago Data Summit: Apache HBase: An Introduction
Reshape Data Lake (as of 2020.07)

What's hot (20)

PDF
Apache HBase Improvements and Practices at Xiaomi
PDF
Experiences Migrating Hive Workload to SparkSQL with Jie Xiong and Zhan Zhang
PPTX
Understanding the Value and Architecture of Apache Drill
PPTX
Apache HBase Performance Tuning
PDF
A Thorough Comparison of Delta Lake, Iceberg and Hudi
PDF
Apache Iceberg Presentation for the St. Louis Big Data IDEA
PDF
Parquet performance tuning: the missing guide
PDF
The Parquet Format and Performance Optimization Opportunities
PDF
Module 2 - Datalake
PPTX
Securing Hadoop with Apache Ranger
PDF
Apache Iceberg: An Architectural Look Under the Covers
PDF
HBase Advanced - Lars George
PDF
Hive Data Modeling and Query Optimization
PPTX
HBase in Practice
PDF
Deep Dive: Memory Management in Apache Spark
PPTX
The Impala Cookbook
PDF
Intro to Delta Lake
PPTX
HBase Low Latency
PPTX
File Format Benchmark - Avro, JSON, ORC & Parquet
PPTX
Hive 3 - a new horizon
Apache HBase Improvements and Practices at Xiaomi
Experiences Migrating Hive Workload to SparkSQL with Jie Xiong and Zhan Zhang
Understanding the Value and Architecture of Apache Drill
Apache HBase Performance Tuning
A Thorough Comparison of Delta Lake, Iceberg and Hudi
Apache Iceberg Presentation for the St. Louis Big Data IDEA
Parquet performance tuning: the missing guide
The Parquet Format and Performance Optimization Opportunities
Module 2 - Datalake
Securing Hadoop with Apache Ranger
Apache Iceberg: An Architectural Look Under the Covers
HBase Advanced - Lars George
Hive Data Modeling and Query Optimization
HBase in Practice
Deep Dive: Memory Management in Apache Spark
The Impala Cookbook
Intro to Delta Lake
HBase Low Latency
File Format Benchmark - Avro, JSON, ORC & Parquet
Hive 3 - a new horizon
Ad

Similar to LLAP: Building Cloud First BI (20)

PPTX
LLAP: Sub-Second Analytical Queries in Hive
PPTX
LLAP: Sub-Second Analytical Queries in Hive
PPTX
LLAP: Sub-Second Analytical Queries in Hive
PPTX
LLAP: Sub-Second Analytical Queries in Hive
PPTX
LLAP: Sub-Second Analytical Queries in Hive
PPTX
LLAP: long-lived execution in Hive
PPTX
Hive acid and_2.x new_features
PPTX
Apache Hive 2.0: SQL, Speed, Scale
PPTX
Stinger.Next by Alan Gates of Hortonworks
PPTX
Apache Hive 2.0: SQL, Speed, Scale
PPTX
Apache Hive 2.0; SQL, Speed, Scale
PPTX
Hive2.0 sql speed-scale--hadoop-summit-dublin-apr-2016
PPTX
Apache Hive 2.0: SQL, Speed, Scale
PDF
What is New in Apache Hive 3.0?
PPTX
Hive 3 New Horizons DataWorks Summit Melbourne February 2019
PDF
Sub-second-sql-on-hadoop-at-scale
PPTX
Achieving Mega-Scale Business Intelligence Through Speed of Thought Analytics...
PDF
What is new in Apache Hive 3.0?
PDF
Apache Hive 2.0 SQL, Speed, Scale by Alan Gates
PDF
The Enterprise and Connected Data, Trends in the Apache Hadoop Ecosystem by A...
LLAP: Sub-Second Analytical Queries in Hive
LLAP: Sub-Second Analytical Queries in Hive
LLAP: Sub-Second Analytical Queries in Hive
LLAP: Sub-Second Analytical Queries in Hive
LLAP: Sub-Second Analytical Queries in Hive
LLAP: long-lived execution in Hive
Hive acid and_2.x new_features
Apache Hive 2.0: SQL, Speed, Scale
Stinger.Next by Alan Gates of Hortonworks
Apache Hive 2.0: SQL, Speed, Scale
Apache Hive 2.0; SQL, Speed, Scale
Hive2.0 sql speed-scale--hadoop-summit-dublin-apr-2016
Apache Hive 2.0: SQL, Speed, Scale
What is New in Apache Hive 3.0?
Hive 3 New Horizons DataWorks Summit Melbourne February 2019
Sub-second-sql-on-hadoop-at-scale
Achieving Mega-Scale Business Intelligence Through Speed of Thought Analytics...
What is new in Apache Hive 3.0?
Apache Hive 2.0 SQL, Speed, Scale by Alan Gates
The Enterprise and Connected Data, Trends in the Apache Hadoop Ecosystem by A...
Ad

More from DataWorks Summit (20)

PPTX
Data Science Crash Course
PPTX
Floating on a RAFT: HBase Durability with Apache Ratis
PPTX
Tracking Crime as It Occurs with Apache Phoenix, Apache HBase and Apache NiFi
PDF
HBase Tales From the Trenches - Short stories about most common HBase operati...
PPTX
Optimizing Geospatial Operations with Server-side Programming in HBase and Ac...
PPTX
Managing the Dewey Decimal System
PPTX
Practical NoSQL: Accumulo's dirlist Example
PPTX
HBase Global Indexing to support large-scale data ingestion at Uber
PPTX
Scaling Cloud-Scale Translytics Workloads with Omid and Phoenix
PPTX
Building the High Speed Cybersecurity Data Pipeline Using Apache NiFi
PPTX
Supporting Apache HBase : Troubleshooting and Supportability Improvements
PPTX
Security Framework for Multitenant Architecture
PDF
Presto: Optimizing Performance of SQL-on-Anything Engine
PPTX
Introducing MlFlow: An Open Source Platform for the Machine Learning Lifecycl...
PPTX
Extending Twitter's Data Platform to Google Cloud
PPTX
Event-Driven Messaging and Actions using Apache Flink and Apache NiFi
PPTX
Securing Data in Hybrid on-premise and Cloud Environments using Apache Ranger
PPTX
Big Data Meets NVM: Accelerating Big Data Processing with Non-Volatile Memory...
PDF
Computer Vision: Coming to a Store Near You
PPTX
Big Data Genomics: Clustering Billions of DNA Sequences with Apache Spark
Data Science Crash Course
Floating on a RAFT: HBase Durability with Apache Ratis
Tracking Crime as It Occurs with Apache Phoenix, Apache HBase and Apache NiFi
HBase Tales From the Trenches - Short stories about most common HBase operati...
Optimizing Geospatial Operations with Server-side Programming in HBase and Ac...
Managing the Dewey Decimal System
Practical NoSQL: Accumulo's dirlist Example
HBase Global Indexing to support large-scale data ingestion at Uber
Scaling Cloud-Scale Translytics Workloads with Omid and Phoenix
Building the High Speed Cybersecurity Data Pipeline Using Apache NiFi
Supporting Apache HBase : Troubleshooting and Supportability Improvements
Security Framework for Multitenant Architecture
Presto: Optimizing Performance of SQL-on-Anything Engine
Introducing MlFlow: An Open Source Platform for the Machine Learning Lifecycl...
Extending Twitter's Data Platform to Google Cloud
Event-Driven Messaging and Actions using Apache Flink and Apache NiFi
Securing Data in Hybrid on-premise and Cloud Environments using Apache Ranger
Big Data Meets NVM: Accelerating Big Data Processing with Non-Volatile Memory...
Computer Vision: Coming to a Store Near You
Big Data Genomics: Clustering Billions of DNA Sequences with Apache Spark

Recently uploaded (20)

PDF
Hybrid model detection and classification of lung cancer
PPTX
SOPHOS-XG Firewall Administrator PPT.pptx
PDF
Enhancing emotion recognition model for a student engagement use case through...
PPTX
Programs and apps: productivity, graphics, security and other tools
PDF
Transform Your ITIL® 4 & ITSM Strategy with AI in 2025.pdf
PDF
Accuracy of neural networks in brain wave diagnosis of schizophrenia
PDF
Microsoft Solutions Partner Drive Digital Transformation with D365.pdf
PDF
Hindi spoken digit analysis for native and non-native speakers
PDF
Heart disease approach using modified random forest and particle swarm optimi...
PDF
MIND Revenue Release Quarter 2 2025 Press Release
PDF
ENT215_Completing-a-large-scale-migration-and-modernization-with-AWS.pdf
PPTX
Group 1 Presentation -Planning and Decision Making .pptx
PPTX
TechTalks-8-2019-Service-Management-ITIL-Refresh-ITIL-4-Framework-Supports-Ou...
PPTX
Chapter 5: Probability Theory and Statistics
PPTX
Tartificialntelligence_presentation.pptx
PDF
Encapsulation_ Review paper, used for researhc scholars
PDF
Assigned Numbers - 2025 - Bluetooth® Document
PDF
A novel scalable deep ensemble learning framework for big data classification...
PDF
WOOl fibre morphology and structure.pdf for textiles
PPTX
TLE Review Electricity (Electricity).pptx
Hybrid model detection and classification of lung cancer
SOPHOS-XG Firewall Administrator PPT.pptx
Enhancing emotion recognition model for a student engagement use case through...
Programs and apps: productivity, graphics, security and other tools
Transform Your ITIL® 4 & ITSM Strategy with AI in 2025.pdf
Accuracy of neural networks in brain wave diagnosis of schizophrenia
Microsoft Solutions Partner Drive Digital Transformation with D365.pdf
Hindi spoken digit analysis for native and non-native speakers
Heart disease approach using modified random forest and particle swarm optimi...
MIND Revenue Release Quarter 2 2025 Press Release
ENT215_Completing-a-large-scale-migration-and-modernization-with-AWS.pdf
Group 1 Presentation -Planning and Decision Making .pptx
TechTalks-8-2019-Service-Management-ITIL-Refresh-ITIL-4-Framework-Supports-Ou...
Chapter 5: Probability Theory and Statistics
Tartificialntelligence_presentation.pptx
Encapsulation_ Review paper, used for researhc scholars
Assigned Numbers - 2025 - Bluetooth® Document
A novel scalable deep ensemble learning framework for big data classification...
WOOl fibre morphology and structure.pdf for textiles
TLE Review Electricity (Electricity).pptx

LLAP: Building Cloud First BI

  • 1. Page1 © Hortonworks Inc. 2011 – 2015. All Rights Reserved LLAP: Building Cloud-First BI Sergey Shelukhin
  • 2. Page2 © Hortonworks Inc. 2011 – 2015. All Rights Reserved LLAP: Building Cloud-First BI • What is LLAP? Overview • Cloud-first BI • Efficient, scalable multi-user execution and caching • Secure • Universal (not just for Hive) • Production-ready tools • How to run LLAP
  • 3. Page3 © Hortonworks Inc. 2011 – 2015. All Rights Reserved Overview
  • 4. Page4 © Hortonworks Inc. 2011 – 2015. All Rights Reserved What is LLAP? • Hybrid model combining daemons and containers for fast, concurrent execution of analytical workloads (e.g. Hive SQL queries) • Concurrent queries without specialized YARN queue setup • Multi-threaded execution of vectorized operator pipelines • Asynchronous IO and efficient in-memory caching • Relational view of the data available thru the API • High performance scans, code pushdown, centralized security • Not an "execution engine" (like Tez, MR, Spark) • Not a storage substrate – reads from HDFS/S3/… Node LLAP Process Cache Query Fragment HDFS Query Fragment
  • 5. Page5 © Hortonworks Inc. 2011 – 2015. All Rights Reserved LLAP and Hive • Transparent to users, BI tools, etc. – HS2/JDBC is the access point Deep Storage YARN Cluster HiveServer2 (Query Endpoint) ODBC, JDBC SQL Queries LLAP Daemon Query Executors LLAP Daemon Query Executors LLAP Daemon Query Executors LLAP Daemon Query Executors Query Coordinators Coord- inator Coord- inator Coord- inator In-Memory Cache (Shared Across All Users) HDFS and Compatible S3 WASB Isilon DAGs
  • 6. Page6 © Hortonworks Inc. 2011 – 2015. All Rights Reserved LLAP and Hive • LLAP is Hive • Supports all file formats that Hive does • Hive Operators used for processing, same compiler, etc. • ⇒ Automatic support for most new optimizations and features • HS2 controls the concurrent queries (session pool) • Each Query coordinated by a Tez AM; LLAP hosts Tez shuffle • Can run in parallel with container-based jobs • After perf testing, we recommend running most Hive workloads in LLAP • In this new model, the cluster capacity is divided proportionally if needed
  • 7. Page7 © Hortonworks Inc. 2011 – 2015. All Rights Reserved LLAP in a BI system - overview • No split brain – a single platform for ETL… • Fault-tolerant components and proven scalability (runs TPCDS 100 Tb) • ANSI SQL, CB Optimizer, ACID transactions • …and BI • Vectorized engine for fast processing • Intelligent scheduling of different workloads running together • Caching, incl. on local disk (SSD), to avoid expensive reads • Zero-ETL analytics with efficient caching of text data • External access, one metadata store, unified security
  • 8. Page8 © Hortonworks Inc. 2011 – 2015. All Rights Reserved Efficient BI queries
  • 9. Page9 © Hortonworks Inc. 2011 – 2015. All Rights Reserved LLAP Queue Short overview – execution • LLAP daemon has a number of executors (think containers) that run "fragments" • Fragments are parts of multiple parallel workloads (e.g. Hive SQL queries) • Work queue with pluggable priority • Geared towards low latency queries over long- running queries (by default) • I/O is similar to containers – read/write to HDFS, shuffle, other storages and formats • Streaming output for data API Executor Q1 Map 1 Executor External read Executor Q3 Reducer 3 Q1 Map 1 Q1 Map 1 Q3 Map 19 HDFS Waiting for shuffle inputs HBase LLAP (shuffle input) Spark executor
  • 10. Page10 © Hortonworks Inc. 2011 – 2015. All Rights Reserved Efficiency for individual queries • Eliminates container startup costs • JIT optimizer has a chance to work (esp. for vectorization) • Data sharing (hash join tables, etc.) 0 5 10 15 20 25 New containers Cold LLAP Warm LLAP (no cache, new user) 4th run of the query (no cache,… Time, sec
  • 11. Page11 © Hortonworks Inc. 2011 – 2015. All Rights Reserved Individual queries – LLAP vs Hive 1 (x26 faster) 0 5 10 15 20 25 30 35 40 45 50 0 50 100 150 200 250 Speedup(xFactor) QueryTime(s)(LowerisBetter) Hive 1 / Tez Time (s) Hive 2 / LLAP Time(s) Speedup (x Factor)
  • 12. Page12 © Hortonworks Inc. 2011 – 2015. All Rights Reserved Hive LLAP vs Impala; TPCDS 10Tb on 9 nodes 5000 7000 9000 11000 13000 CDH 5.12 HDP 2.6 Total Runtime (sec) (Lower is Better) 0 20 40 60 80 100 CDH 5.12 HDP 2.6 TPC-DS Queries Supported (Higher is Better) 60 99/99
  • 13. Page13 © Hortonworks Inc. 2011 – 2015. All Rights Reserved Hive LLAP vs Impala (log scale; lower is better) 1 10 100 1000 10000 query64 query13 query83 query91 query93 query47 query85 query57 query99 query78 query59 query62 query2 query89 query71 query51 query43 query48 query88 query28 query17 query11 query25 query3 query97 query74 query50 query53 query63 query90 query33 query96 query60 query15 query69 query75 query46 query26 query34 query7 query1 query55 query52 query73 query42 query65 query30 query56 query81 query19 query61 query39 query79 query4 query29 query9 query68 query31 query49 query76 Runtime(s)(LogScale) HDP 2.6 (Hive LLAP) versus CDH 5.12 (Impala)
  • 14. Page14 © Hortonworks Inc. 2011 – 2015. All Rights Reserved Parallel queries – priorities, preemption • Lower-priority fragments can be preempted • For example, a fragment can start running before its inputs are ready, for better pipelining; such fragments may be preempted • LLAP work queue examines the DAG parameters to give preference to interactive (BI) queries LLAP QueueExecutor Executor Interactive query map 1/3 … Interactive query map 3/3 Executor Interactive query map 2/3 Wide query reduce waiting Time ClusterUtilization Long-Running Query Short-Running Query
  • 15. Page15 © Hortonworks Inc. 2011 – 2015. All Rights Reserved Workload management (WIP - HIVE-17481)
  • 16. Page16 © Hortonworks Inc. 2011 – 2015. All Rights Reserved Overview • Effectively share LLAP cluster resources • Resource allocation per user policy; separate ETL and BI, etc. • Resources based guardrails • Protect against long running queries, high memory usage • Improved, query-aware scheduling • Scheduler is aware of query characteristics, types, etc. • Fragments easy to pre-empt compared to containers • Queries get guaranteed fractions of the cluster, but can use empty space Theory Practice
  • 17. Page17 © Hortonworks Inc. 2011 – 2015. All Rights Reserved Resource plans • Resource plan is a workload management configuration for a cluster • Switching is allowed without stopping queries, e.g. based on time of day • Cluster is divided into query pools (optionally nested) • Each pool defines query parallelism, cluster resources percentage • Queries are automatically routed to pools based on user name, app, etc. • Rules to kill, move, or deprioritized queries based on DFS usage, runtime, etc. • Example (commands may change in the final version): CREATE RESOURCE PLAN daytime; CREATE POOL bi IN daytime (resource_percent=75, concurrent_queries=5); CREATE POOL etl IN daytime TIME (resource_percent=25, concurrent_queries=10); CREATE RULE downgrade IN daytime WHEN total_runtime > 300 THEN MOVE etl; ADD RULE downgrade TO bi; CREATE MAPPING tableau (application=“Tableau”, pool=bi); ALTER PLAN daytime SET default_pool='etl'; APPLY PLAN daytime;
  • 18. Page18 © Hortonworks Inc. 2011 – 2015. All Rights Reserved Decentralized guaranteed resources • A guaranteed task for each resource (currently executor slots) • HS2 gives N guaranteed tasks to an AM based on configured resource plan • AMs mark N of its most important tasks as guaranteed at any given time • Guarantee is not a requirement to use resource • Guaranteed tasks pre-empt speculative tasks • Future improvements – coordination improvements • E.g. try to place on the least busy nodes
  • 19. Page19 © Hortonworks Inc. 2011 – 2015. All Rights Reserved Guaranteed tasks – BI and ETL example BI (80% = 14 guaranteed) ETL (20% = 4 guaranteed) Query 1 Query 2 LLAP Daemon 1 LLAP Daemon 2 LLAP Daemon 3 Wait Queue Executors 10 active tasks (running): 10 guaranteed (running) 4 unused for now 19 active tasks (8 running): 4 guaranteed (4 running) 15 speculative (4 running) HS2 18 executors total
  • 20. Page20 © Hortonworks Inc. 2011 – 2015. All Rights Reserved Caching
  • 21. Page21 © Hortonworks Inc. 2011 – 2015. All Rights Reserved Caching for BI workloads - basics • Fine-grained (columnar), compact (dictionary, RLE encoded) • Important due to projections over many wide EDW tables • Prioritized – indexes are cached with higher priority • Important to make use of PPD for BI query filters • Off-heap (no extra GC), supports SSD • Saves on cloud reads • LRFU replacement policy avoids the damage from large scans • Automatic coherence, flexible locality (hash based) • Locality can be strict, or create additional replicas to avoid hotspots
  • 22. Page22 © Hortonworks Inc. 2011 – 2015. All Rights Reserved Caching for BI workloads – formats, zero-ETL • On-prem, does not make large queries on ORC much faster • On S3/Azure though, reads are much more slow • Even disk cache is still much faster than FS reads • Especially if text is involved • Cache supports columnar data and text • ORC cached natively; in 3.0, Parquet is also cached natively • Possible future improvement – move Parquet caching onto IO threads • Zero-ETL analytics on CSV and JSON data with text caching • Text is efficiently encoded in background; once cached, queries speed up
  • 23. Page23 © Hortonworks Inc. 2011 – 2015. All Rights Reserved I/O threads In-memory processing – native columnar (ORC) SSD cache Off-heap cache Compact encoded data Distributed FS Compressed data Decoder: ORC col1 col2 Compression codec Read planner Execution thread Fragment Hive operator Hive operator Vectorized processin g col1 col2 Native data vectors Replacement policy
  • 24. Page24 © Hortonworks Inc. 2011 – 2015. All Rights Reserved In-memory processing – columnar (Parquet) SSD cache Off-heap cache Compact data Distributed FS Compressed data Parquet reader Execution thread Fragment Hive operator Hive operator Vectorized processin g col1 col2 Native data vectors Replacement policy col1 col2 Cache coordinator
  • 25. Page25 © Hortonworks Inc. 2011 – 2015. All Rights Reserved Up to 10x speed up with a cloud FS (100 Tb dataset, SSD) 0 1 2 3 4 5 6 7 8 9 10 0 500 1000 1500 2000 2500 3000 query71 query19 query73 query82 query68 query91 query12 query90 query18 query85 query27 query45 query13 query40 query48 query89 query79 query58 query66 query15 query42 query98 query26 query20 query46 query7 query17 query34 query96 query25 query32 query28 query21 query49 query87 query84 query50 query95 query97 query64 query55 query52 query93 query39 query76 query92 query94 query88 query3 query43 Speedup Time,sec Cold With cache Speedup 10x • 1.5x overall • 2.1x small queries
  • 26. Page26 © Hortonworks Inc. 2011 – 2015. All Rights Reserved I/O threads Execution thread In-memory processing – text – the first read Fragment Hive operator Hive operator Vectorized processin g col1 col2 SSD cache Native data vectors Off-heap cache Compact encoded data Distributed FS Compressed data Decoder: ORC Read planner Compression codec "Decoder": text col1 col2 Encoder: ORC lite
  • 27. Page27 © Hortonworks Inc. 2011 – 2015. All Rights Reserved I/O threads Execution thread In-memory processing – text – the second read Fragment Hive operator Hive operator Vectorized processin g col1 col2 SSD cache Native data vectors Off-heap cache Compact encoded data Distributed FS Compressed data Decoder: ORC col2 Read planner Compression codec "Decoder": text Encoder: ORC lite
  • 28. Page28 © Hortonworks Inc. 2011 – 2015. All Rights Reserved Up to 38x speed up with text cache + cloud FS
  • 29. Page29 © Hortonworks Inc. 2011 – 2015. All Rights Reserved External access
  • 30. Page30 © Hortonworks Inc. 2011 – 2015. All Rights Reserved External access – relational view for everyone • Hive-on-Tez and other DAG executors can use LLAP directly • LLAP also provides a "relational datanode" view of the data • Anyone (with access) can push the (approved) code in, from complex query fragments to simple data reads • E.g. a Spark DataFrame can be created with LlapInputFormat • Gives the external services the access to • Hive data: centralized, secure data access • Ability to read all Hive table types, like ACID transactional tables • Hive features: from column-level security, to LLAP columnar cache
  • 31. Page31 © Hortonworks Inc. 2011 – 2015. All Rights Reserved SparkSQL+LLAP example • Ranger for Hive support cell-level security and masking • With SparkSQL utilizing LLAP, this can be used from Spark • More at https://hortonworks.com/blog/row-column-level-control-apache-spark/
  • 32. Page32 © Hortonworks Inc. 2011 – 2015. All Rights Reserved SparkSQL+LLAP example • Ranger for Hive support cell-level security and masking • With SparkSQL utilizing LLAP, this can be used from Spark • More at https://hortonworks.com/blog/row-column-level-control-apache-spark/
  • 33. Page33 © Hortonworks Inc. 2011 – 2015. All Rights Reserved SparkSQL+LLAP example • Ranger for Hive support cell-level security and masking • With SparkSQL utilizing LLAP, this can be used from Spark • More at https://hortonworks.com/blog/row-column-level-control-apache-spark/
  • 34. Page34 © Hortonworks Inc. 2011 – 2015. All Rights Reserved Security
  • 35. Page35 © Hortonworks Inc. 2011 – 2015. All Rights Reserved LLAP security – the EDW usage patterns • Single, centrally administered LLAP cluster for all users • For now, separate ad hoc clusters cannot use Ambari • Use Ranger • Hive SQL standard auth is an option; doAs is not recommended • Hive session AMs and LLAP run as hive superuser; managed by HS2 • HS2 serves as a central coordinator for security • Beeline and JDBC access; no CLI (requires client kinit) • HS2 checks permissions, enforces Ranger policies • Coordinates the usual Hadoop security dance (tokens for tasks, etc.)
  • 36. Page36 © Hortonworks Inc. 2011 – 2015. All Rights Reserved LLAP daemon Task Jo b FS SM T TK LLAP security – internals with Tez HS2 SM T TK SessionSession FS Tez AM T FS ZK Paths w/ACLs T TK Jo b Ranger Policies FS LLAP daemon Task Jo b FS SM T TK FS Jo b F💓 FS FS T🔐 T Task Jo b
  • 37. Page37 © Hortonworks Inc. 2011 – 2015. All Rights Reserved LLAP security – external (Spark) additions FS LLAP daemon Task Jo b FS SM T TK Spark Client FS Jo b FS T 🔏 Specs K HS2 SM T TK Session FS K 🔏 TaskT K K
  • 38. Page38 © Hortonworks Inc. 2011 – 2015. All Rights Reserved Integration and tools
  • 39. Page39 © Hortonworks Inc. 2011 – 2015. All Rights Reserved LLAP in Ambari (and HDP) • Ambari 2.5 + HDP 2.6 = LLAP GA • The latest recommended update is HDP 2.6.2.0 • Do not use Tech Preview versions; use GA • Separate version of Hive, "Hive Interactive" • Ambari 3.0 – no more separate versions • Enable "Interactive Query" in Hive tab • A default configuration is chosen; more on that later • No Ambari? Will cover this later
  • 40. Page40 © Hortonworks Inc. 2011 – 2015. All Rights Reserved LLAP on the cloud • LLAP is in HDC (Hortonworks Data Cloud) • For quick, automated cluster deployments on AWS • Also available on Azure HDInsight • Details and links at the end!
  • 41. Page41 © Hortonworks Inc. 2011 – 2015. All Rights Reserved Tez UI – queries and LLAP integration
  • 42. Page42 © Hortonworks Inc. 2011 – 2015. All Rights Reserved Tez UI – query swimlane
  • 43. Page43 © Hortonworks Inc. 2011 – 2015. All Rights Reserved Tez UI – DAG swimlane with LLAP counters
  • 44. Page44 © Hortonworks Inc. 2011 – 2015. All Rights Reserved Tez UI – query information and debug data
  • 45. Page45 © Hortonworks Inc. 2011 – 2015. All Rights Reserved Monitoring • LLAP exposes a UI for monitoring • Aggregate monitoring UI is work in progress • Lots of debug views and tools – JMX, logging, etc. – see backup slides
  • 46. Page46 © Hortonworks Inc. 2011 – 2015. All Rights Reserved Making the best use of LLAP - summary • Java 8, G1GC; some kernel configs, esp. for TCP connections • Ambari comes with reasonable Hive perf configuration • May still need tweaking for specific workload; more so w/o Ambari • SSD and text cache require "advanced config" until Ambari 3.0 • LLAP cluster sizing in a nutshell • AM per query (+ 1-2), AMs on all nodes; 2Gb RAM per AM, rest to LLAP • (Executor+IO thread) per core, 3-4Gb RAM per executor, rest to cache • Without Ambari, see hive --service llap command + Slider • See backup slides for some details ;)
  • 47. Page47 © Hortonworks Inc. 2011 – 2015. All Rights Reserved Future work for manageability • UDF, configuration changes without affecting queries (rolling restart) • In-place restart of the daemons – preserves cache • Ambari integration for faster startup in common cases • Improved scale-up/down (with Ambari and Slider integration)
  • 48. Page48 © Hortonworks Inc. 2011 – 2015. All Rights Reserved Summary LLAP provides a • unified, managed and secure cloud-ready EDW solution for BI and ETL workloads via a • fast execution substrate harnessing Hive vectorized SQL engine and • efficient in-memory caching layer for columnar and text data
  • 49. Page49 © Hortonworks Inc. 2011 – 2015. All Rights Reserved Try Hive LLAP Today on-prem or in the Cloud Hortonworks Data Platform 2.6 Powered by 100% open source Apache Hadoop http://hortonworks.com/downloads/ Hortonworks Data Cloud Easy HDP on Amazon Web Services http://hortonworks.com/products/cloud/aws/ Microsoft Azure HDInsight A cloud Spark and Hadoop service for your enterprise http://azure.microsoft.com/en-us/services/hdinsight/
  • 50. Page50 © Hortonworks Inc. 2011 – 2015. All Rights Reserved Questions? ? Interested? Stop by the Hortonworks booth to learn more
  • 51. Page51 © Hortonworks Inc. 2011 – 2015. All Rights Reserved Backup slides
  • 52. Page52 © Hortonworks Inc. 2011 – 2015. All Rights Reserved Tez UI – LLAP counters
  • 53. Page53 © Hortonworks Inc. 2011 – 2015. All Rights Reserved Debugging • JMX view (:15002/jmx) contains many detailed metrics • E.g. "ExecutorsState" shows the running tasks and their state • Log lines for most operations are annotated with task attempt # • By default, stores separate log files per query • Logs can be downloaded (yarn logs ...) even for a running LLAP app • Log file contains the statements annotated for the query • File name contains session application ID and DAG# - "dag_TTTT_MMM_N" - e.g. dag_1490656001509_4602_1 for Tez AM application_1490656001509_4602
  • 54. Page54 © Hortonworks Inc. 2011 – 2015. All Rights Reserved Making the best use of LLAP – OS and Java • Java 8 strongly recommended • G1 GC recommended (e.g. --args " -XX:+UseG1GC -XX:+ResizeTLAB -XX:-ResizePLAB") • Kernel settings sysctl -w net.core.somaxconn=16384; echo "never" > /sys/kernel/mm/transparent_hugepage/enabled echo "never" > /sys/kernel/mm/transparent_hugepage/defrag /etc/init.d/nscd restart
  • 55. Page55 © Hortonworks Inc. 2011 – 2015. All Rights Reserved Making the best use of LLAP – cluster sizing 1. Pick the number of parallel queries (not just sessions) • AM per query + some constant slack 2. Pick executors per node, and io.threadpool count (# of cores per node) 3. Determine total memory size for LLAP - subtract the AM(s) from each NM (YARN memory per node) • 1 AM = 2 Gb; best to spread the AMs across each node 4. Determine the Xmx for LLAP; one executor (core) == 3-4Gb 5. Determine cache size - from the total, take out Xmx + ~3Gb (if lower, 20%) • ~3Gb for Java overhead, shared overhead 6. Tweak based on workload?
  • 56. Page56 © Hortonworks Inc. 2011 – 2015. All Rights Reserved Cluster sizing example • 6 node cluster – 100Gb RAM each, 24 cores, NM Size = 96Gb, 25 concurrent queries • 28 AMs; total AM memory = 28*2 = 56 • (96*6 – 28*2)/6 = 86.66 => "Memory per daemon" = 85Gb • "LLAP heap size" (Xmx) = 3Gb*24 = 72Gb • "Cache size" = 85Gb – 72Gb – 3Gb ~= 10Gb
  • 57. Page57 © Hortonworks Inc. 2011 – 2015. All Rights Reserved Making the best use of LLAP – Hive settings • Ambari has a lot of this configured by default • The basics - use ORC; enable PPD, configure mapjoin size, etc. • Enable vectorization and consider new vectorization features • hive.vectorized.execution.*.enabled – see the configuration file documentation • Enable LLAP split locality - hive.llap.client.consistent.splits • hive.llap.task.scheduler.locality.delay to tweak strict/relaxed locality • Consider disabling CBO for interactive queries (test your queries!) • Use parallel compilation in HS2 - hive.driver.parallel.compilation • Shuffle improvement - tez.am.am-rm.heartbeat.interval-ms.max=5000
  • 58. Page58 © Hortonworks Inc. 2011 – 2015. All Rights Reserved Making the best use of LLAP – new cache stuff • Text cache (not turned on in Ambari until 3.0!) • hive.llap.io.encode.enabled, hive.vectorized.use.(row|vector).serde.deserialize • SSD cache (not turned on in Ambari until 3.0!) • hive.llap.io.allocator.mmap; hive.llap.io.allocator.mmap.path • hive.llap.io.memory.size controls the total cache size (on disk) • You have to disable YARN memory check for now until YARN 2.8 • Cache on cloud FS • hive.orc.splits.allow.synthetic.fileid, hive.llap.cache.allow.synthetic.fileid
  • 59. Page59 © Hortonworks Inc. 2011 – 2015. All Rights Reserved LLAP without Ambari • Requires Hive 2.X (2.2-2.3 are coming soon); ZK, YARN, Slider • hive --service llap generates a slider package • Run this as the correct user – slider paths are user-specific! kinit on secure cluster • Specify a name, # of instances; memory, cache size, etc.; see --help • Generates run.sh to start the cluster (in --output) directory • Or use --startImmediately in newer versions • Queries can be run from HS2 and CLI; basic configuration: • hive.execution.mode=llap, hive.llap.execution.mode=all, hive.llap.io.enabled=true, hive.llap.daemon.service.hosts=@<cluster name>

Editor's Notes

  • #11: 6 months note
  • #12: 6 months note
  • #20: Details on different modes – container only, llap only, etc
  • #36: Need to mention column level security again
  • #37: ----- Meeting Notes (17/1/11 10:19) ----- Knox HS2 #2 - what's the story?
  • #38: ----- Meeting Notes (17/1/11 10:19) ----- Knox HS2 #2 - what's the story?