SlideShare a Scribd company logo
Copyright ©2015 Treasure Data. All Rights Reserved.
Presto  as  a  Service
Tips  for  operation  and  monitoring
Dongmin Yu
Treasure  Data,  Inc.
min@treasure-­data.com
JeroMQ /  ZeroMQ committer  &  maintainer
Mar  19,  2015
Presto  Meetup @  Facebook
Copyright ©2015 Treasure Data. All Rights Reserved.
Topics  
• Presto  as  a  Service  in  Treasure  Data
– Error  Recovery
– Presto  Deployment
• Tips  for  Monitoring  Presto
– JSON  API
– Presto  +  Fluentd
• Custom  changes
2
Copyright ©2015 Treasure Data. All Rights Reserved.
Treasure  Data:  Presto  as  a  Service
3
Presto Public
Release
Hive
TD  API  /  
Web  ConsoleInteractive  query
batch  query
Presto
Treasure  Data
PlazmaDB:
MessagePack Columnar  Storage
td-­presto  connector
Copyright ©2015 Treasure Data. All Rights Reserved.
Deployment
• Building  Presto  takes  more  than  20  minutes.
• Facebook  frequently  releases  new  versions
• Let  CircleCI build  Presto  
– Deploy  jar  files  to  private  Maven  repository
– We  sometime  use  non-­release  versions
• for  fixing  serious  bugs
• hot-­fix  patches
• Integration  Test
– td-­presto  connector
• PlazmaDB,  Multi-­tenant  query  scheduler
• Query  optimizer
– Run  test  queries  on  staging  cluster
– Presto  Verifier
5
Copyright ©2015 Treasure Data. All Rights Reserved.
Production:  Blue-­Green  Deployment
• http://martinfowler.com/bliki/BlueGreenDeployment.html
• 2  Presto  Coordinators  (Blue/Green)
– Route  Presto  queries  to  the  active  cluster
– No  down-­time  upon  deployment
• Launch  Presto  worker  instances  with  chef      <-­ less  than  5  min.  in  AWS
• Inactive  clusters  is  used  for  pre-­production  testing  and  customer  support
– Investigation  and  tuning  of  customer  query  performance
– Trouble  shooting
6
Copyright ©2015 Treasure Data. All Rights Reserved.
Error  Recovery
• Presto  has  no  fault  tolerance
• Error  types
– User  error
• Syntax  errors
– SQL  syntax,  missing  function
• Semantic  errors
– missing  tables/columns
– Insufficient  resource  
• Exceeded  task  memory  size
– Internal  failure
• I/O  error
– S3/Riak CS
• worker  failure
• etc.
7
Worth A Retry!
Copyright ©2015 Treasure Data. All Rights Reserved.
Failed  Query  Rate
8
Copyright ©2015 Treasure Data. All Rights Reserved. 9
Copyright ©2015 Treasure Data. All Rights Reserved.
Query  Retry  Patterns  used  in  TD
• Error  code  +  message  pattern
10
Copyright ©2015 Treasure Data. All Rights Reserved.
Monitoring  Presto  with  Fluentd
11
Copyright ©2015 Treasure Data. All Rights Reserved.
Monitoring  Presto
• REST  API  for  monitoring  Presto  state
– JSON  format
• (presto  server  IP):8080/v1/query
– List  of  recent  queries    (BasicQueryInfo class)
• (presto  server  IP):8080/v1/query/(query  id)
– Detailed  query  state  information
– Query  plan,  tasks  and  running  worker  IDs  
– Processed  rows/data  size
12
Copyright ©2015 Treasure Data. All Rights Reserved.
Query  List      /v1/query
13
Copyright ©2015 Treasure Data. All Rights Reserved.
Detailed  query  Info  /v1/query/(query  id)
14
Copyright ©2015 Treasure Data. All Rights Reserved.
/ui/query-­execution/(query  id)
15
Copyright ©2015 Treasure Data. All Rights Reserved.
Complex  Queries
16
Copyright ©2015 Treasure Data. All Rights Reserved. 17
Copyright ©2015 Treasure Data. All Rights Reserved.
Presto  Coordinator
• Organizes  query  execution  pipelines
– Coordinates  presto  workers
• Retrieves  table  partition  and  split  location  from  connectors
– Creates  distributed  query  plans
• Full  GC
– Stalls  coordinator
• When  memory  is  insufficient
– Use  memory-­rich  machine
– GC  Tuning
• UseG1GC
18
Copyright ©2015 Treasure Data. All Rights Reserved.
presto-­metrics  (Ruby)
• https://github.com/xerial/presto-­metrics
19
Copyright ©2015 Treasure Data. All Rights Reserved. 20
Copyright ©2015 Treasure Data. All Rights Reserved.
Query  Collection  in  TD
• SQL  query  logs
– query,  detailed  query  plan,  elapsed  time,  processed  rows,  etc.
– newSetBinder(binder,EventClient.class).addBinding()
.to(FluentEventClient.class)
• Presto  is  used  for  analyzing  the  query  history
21
Copyright ©2015 Treasure Data. All Rights Reserved.
Daily/Hourly  Query  Usage
22
Copyright ©2015 Treasure Data. All Rights Reserved.
Query  Running  Time
• More  than  90%  of  queries  finishes  within  2  min.
≒ expected  response  time  for  interactive  queries
23
Copyright ©2015 Treasure Data. All Rights Reserved.
Detecting  Anomaly
• Started  Query  Rate  (in  5min/15min)
– If  no  query  has  started,  cluster  may  be  down  (or  not  started  properly)
• Processed  rows  in  a  query
– Sum  up  the  number  of  the  processed  rows  from  all  of  the  sub  stages
– Simple,  but  the  most  reliable  measure  
• Send  an  alert
– Slack  notification
– PagerDuty call
• JP/US  team  rotation
24
Copyright ©2015 Treasure Data. All Rights Reserved.
Benchmarking
• Query  performance  comparison
– between  two  versions  of  Presto
• Benchmark
– Run  query  set  multiple  times
– Store  the  results  to  TD
– Report  the  result  with  Presto
• Aggregation  query
25
Copyright ©2015 Treasure Data. All Rights Reserved.
Presto  Operation  Tool
• Prestop
– Our  internal  tool  for  managing  multiple  presto  
clusters
• written  in  Scala
– Query  monitoring
– Benchmarking
– Workload  simulation
• stress  testing
• Monitoring
– Datadog
– PageDuty
– ChartIO (query  stats)
26
Copyright ©2015 Treasure Data. All Rights Reserved.
buffer
Optimizing  Scan  Performance  – Storage  Manager
• Fully  utilize  the  network  bandwidth  from  S3
• TD  Presto  becomes  CPU  bottleneck
27
TableScanOperators
• s3  file  list
• table  schema
header  
request
S3 / RiakCS
• release(Buffer)
Buffer size limit
Reuse allocated buffers
Request Queue
• priority queue
• max connections limit
Header
Column Block 0
(column names)
Column Block 1
Column Block i
Column Block m
MPC1 file
HeaderReader
• callback  to  HeaderParser
ColumnBlockReader
header
HeaderParser
• parse  MPC  file  header
• column  block  offsets
• column  names
column block request
Column  block  requests
column
block
prepare
buffer
MessageUnpacker
MessageUnpacker
S3 read
S3 read
pull records
Retry  GET  request  on
-­ 500  (internal  error)
-­ 503  (slow  down)
-­ 404  (not  found)
-­ eventual  consistency
S3 read• decompression
• msgpack-­java  v07
• On-­demand  de-­ser
S3 read
S3 read
S3 read
Copyright ©2015 Treasure Data. All Rights Reserved.
Multi-­tenancy:  Resource  Allocation
• Price-­plan  based  resource  allocation
• Parameters
– The  number  of  worker  nodes  to  use  (min-­candidates)
– The  number  of  hash  partitions  (initial-­hash-­partitions)
– The  maximum  number  of  running  tasks  per  account
• If  running  queries  exceeds  allowed  number  of  tasks,  the  next  queries  need  to  wait  
(queued)
• Presto:  SqlQueryExecution class
– Controls  query  execution  state:  planning  -­>  running  -­>  finished
• No  resource  allocation  policy
– Extended  TDSqlQueryExection class  monitors  running  tasks  and  limits  resource  
usage
• Rewriting  SqlQueryExecutionFactory at  run-­time  by  using  ASM  library
28
Copyright ©2015 Treasure Data. All Rights Reserved.
WE  ARE  HIRING!
29
Check: www.treasuredata.com

More Related Content

What's hot

Presto @ Treasure Data - Presto Meetup Boston 2015
Presto @ Treasure Data - Presto Meetup Boston 2015Presto @ Treasure Data - Presto Meetup Boston 2015
Presto @ Treasure Data - Presto Meetup Boston 2015
Taro L. Saito
 
Presto - SQL on anything
Presto  - SQL on anythingPresto  - SQL on anything
Presto - SQL on anything
Grzegorz Kokosiński
 
Bullet: A Real Time Data Query Engine
Bullet: A Real Time Data Query EngineBullet: A Real Time Data Query Engine
Bullet: A Real Time Data Query Engine
DataWorks Summit
 
20140120 presto meetup_en
20140120 presto meetup_en20140120 presto meetup_en
20140120 presto meetup_en
Ogibayashi
 
Presto @ Facebook: Past, Present and Future
Presto @ Facebook: Past, Present and FuturePresto @ Facebook: Past, Present and Future
Presto @ Facebook: Past, Present and FutureDataWorks Summit
 
Presto in my_use_case
Presto in my_use_casePresto in my_use_case
Presto in my_use_case
wyukawa
 
Presto
PrestoPresto
Presto
Knoldus Inc.
 
Presto updates to 0.178
Presto updates to 0.178Presto updates to 0.178
Presto updates to 0.178
Kai Sasaki
 
Presto for the Enterprise @ Hadoop Meetup
Presto for the Enterprise @ Hadoop MeetupPresto for the Enterprise @ Hadoop Meetup
Presto for the Enterprise @ Hadoop Meetup
Wojciech Biela
 
Prestogres, ODBC & JDBC connectivity for Presto
Prestogres, ODBC & JDBC connectivity for PrestoPrestogres, ODBC & JDBC connectivity for Presto
Prestogres, ODBC & JDBC connectivity for Presto
Sadayuki Furuhashi
 
How to ensure Presto scalability 
in multi use case
How to ensure Presto scalability 
in multi use case How to ensure Presto scalability 
in multi use case
How to ensure Presto scalability 
in multi use case
Kai Sasaki
 
Speed up Interactive Analytic Queries over Existing Big Data on Hadoop with P...
Speed up Interactive Analytic Queries over Existing Big Data on Hadoop with P...Speed up Interactive Analytic Queries over Existing Big Data on Hadoop with P...
Speed up Interactive Analytic Queries over Existing Big Data on Hadoop with P...
viirya
 
Technologies, Data Analytics Service and Enterprise Business
Technologies, Data Analytics Service and Enterprise BusinessTechnologies, Data Analytics Service and Enterprise Business
Technologies, Data Analytics Service and Enterprise Business
SATOSHI TAGOMORI
 
Hoodie: How (And Why) We built an analytical datastore on Spark
Hoodie: How (And Why) We built an analytical datastore on SparkHoodie: How (And Why) We built an analytical datastore on Spark
Hoodie: How (And Why) We built an analytical datastore on Spark
Vinoth Chandar
 
presto-at-netflix-hadoop-summit-15
presto-at-netflix-hadoop-summit-15presto-at-netflix-hadoop-summit-15
presto-at-netflix-hadoop-summit-15
Zhenxiao Luo
 
Presto Meetup (2015-03-19)
Presto Meetup (2015-03-19)Presto Meetup (2015-03-19)
Presto Meetup (2015-03-19)
Dain Sundstrom
 
Presto+MySQLで分散SQL
Presto+MySQLで分散SQLPresto+MySQLで分散SQL
Presto+MySQLで分散SQL
Sadayuki Furuhashi
 
Presto@Uber
Presto@UberPresto@Uber
Presto@Uber
Zhenxiao Luo
 
Presto Meetup 2016 Small Start
Presto Meetup 2016 Small StartPresto Meetup 2016 Small Start
Presto Meetup 2016 Small Start
Hiroshi Toyama
 
From Batch to Streaming ET(L) with Apache Apex
From Batch to Streaming ET(L) with Apache ApexFrom Batch to Streaming ET(L) with Apache Apex
From Batch to Streaming ET(L) with Apache Apex
DataWorks Summit
 

What's hot (20)

Presto @ Treasure Data - Presto Meetup Boston 2015
Presto @ Treasure Data - Presto Meetup Boston 2015Presto @ Treasure Data - Presto Meetup Boston 2015
Presto @ Treasure Data - Presto Meetup Boston 2015
 
Presto - SQL on anything
Presto  - SQL on anythingPresto  - SQL on anything
Presto - SQL on anything
 
Bullet: A Real Time Data Query Engine
Bullet: A Real Time Data Query EngineBullet: A Real Time Data Query Engine
Bullet: A Real Time Data Query Engine
 
20140120 presto meetup_en
20140120 presto meetup_en20140120 presto meetup_en
20140120 presto meetup_en
 
Presto @ Facebook: Past, Present and Future
Presto @ Facebook: Past, Present and FuturePresto @ Facebook: Past, Present and Future
Presto @ Facebook: Past, Present and Future
 
Presto in my_use_case
Presto in my_use_casePresto in my_use_case
Presto in my_use_case
 
Presto
PrestoPresto
Presto
 
Presto updates to 0.178
Presto updates to 0.178Presto updates to 0.178
Presto updates to 0.178
 
Presto for the Enterprise @ Hadoop Meetup
Presto for the Enterprise @ Hadoop MeetupPresto for the Enterprise @ Hadoop Meetup
Presto for the Enterprise @ Hadoop Meetup
 
Prestogres, ODBC & JDBC connectivity for Presto
Prestogres, ODBC & JDBC connectivity for PrestoPrestogres, ODBC & JDBC connectivity for Presto
Prestogres, ODBC & JDBC connectivity for Presto
 
How to ensure Presto scalability 
in multi use case
How to ensure Presto scalability 
in multi use case How to ensure Presto scalability 
in multi use case
How to ensure Presto scalability 
in multi use case
 
Speed up Interactive Analytic Queries over Existing Big Data on Hadoop with P...
Speed up Interactive Analytic Queries over Existing Big Data on Hadoop with P...Speed up Interactive Analytic Queries over Existing Big Data on Hadoop with P...
Speed up Interactive Analytic Queries over Existing Big Data on Hadoop with P...
 
Technologies, Data Analytics Service and Enterprise Business
Technologies, Data Analytics Service and Enterprise BusinessTechnologies, Data Analytics Service and Enterprise Business
Technologies, Data Analytics Service and Enterprise Business
 
Hoodie: How (And Why) We built an analytical datastore on Spark
Hoodie: How (And Why) We built an analytical datastore on SparkHoodie: How (And Why) We built an analytical datastore on Spark
Hoodie: How (And Why) We built an analytical datastore on Spark
 
presto-at-netflix-hadoop-summit-15
presto-at-netflix-hadoop-summit-15presto-at-netflix-hadoop-summit-15
presto-at-netflix-hadoop-summit-15
 
Presto Meetup (2015-03-19)
Presto Meetup (2015-03-19)Presto Meetup (2015-03-19)
Presto Meetup (2015-03-19)
 
Presto+MySQLで分散SQL
Presto+MySQLで分散SQLPresto+MySQLで分散SQL
Presto+MySQLで分散SQL
 
Presto@Uber
Presto@UberPresto@Uber
Presto@Uber
 
Presto Meetup 2016 Small Start
Presto Meetup 2016 Small StartPresto Meetup 2016 Small Start
Presto Meetup 2016 Small Start
 
From Batch to Streaming ET(L) with Apache Apex
From Batch to Streaming ET(L) with Apache ApexFrom Batch to Streaming ET(L) with Apache Apex
From Batch to Streaming ET(L) with Apache Apex
 

Similar to Presto meetup 2015-03-19 @Facebook

Presto At Treasure Data
Presto At Treasure DataPresto At Treasure Data
Presto At Treasure Data
Taro L. Saito
 
Internals of Presto Service
Internals of Presto ServiceInternals of Presto Service
Internals of Presto Service
Treasure Data, Inc.
 
Presto as a Service - Tips for operation and monitoring
Presto as a Service - Tips for operation and monitoringPresto as a Service - Tips for operation and monitoring
Presto as a Service - Tips for operation and monitoringTaro L. Saito
 
Overview of data analytics service: Treasure Data Service
Overview of data analytics service: Treasure Data ServiceOverview of data analytics service: Treasure Data Service
Overview of data analytics service: Treasure Data Service
SATOSHI TAGOMORI
 
Oracle GoldenGate and Apache Kafka A Deep Dive Into Real-Time Data Streaming
Oracle GoldenGate and Apache Kafka A Deep Dive Into Real-Time Data StreamingOracle GoldenGate and Apache Kafka A Deep Dive Into Real-Time Data Streaming
Oracle GoldenGate and Apache Kafka A Deep Dive Into Real-Time Data Streaming
Michael Rainey
 
Measuring CDN performance and why you're doing it wrong
Measuring CDN performance and why you're doing it wrongMeasuring CDN performance and why you're doing it wrong
Measuring CDN performance and why you're doing it wrong
Fastly
 
SharePoint Saturday The Conference 2011 - SP2010 Performance
SharePoint Saturday The Conference 2011 - SP2010 PerformanceSharePoint Saturday The Conference 2011 - SP2010 Performance
SharePoint Saturday The Conference 2011 - SP2010 Performance
Brian Culver
 
SharePoint Saturday San Antonio: SharePoint 2010 Performance
SharePoint Saturday San Antonio: SharePoint 2010 PerformanceSharePoint Saturday San Antonio: SharePoint 2010 Performance
SharePoint Saturday San Antonio: SharePoint 2010 Performance
Brian Culver
 
Presto Summit 2018 - 07 - Lyft
Presto Summit 2018 - 07 - LyftPresto Summit 2018 - 07 - Lyft
Presto Summit 2018 - 07 - Lyft
kbajda
 
Oracle GoldenGate and Apache Kafka: A Deep Dive Into Real-Time Data Streaming
Oracle GoldenGate and Apache Kafka: A Deep Dive Into Real-Time Data StreamingOracle GoldenGate and Apache Kafka: A Deep Dive Into Real-Time Data Streaming
Oracle GoldenGate and Apache Kafka: A Deep Dive Into Real-Time Data Streaming
Michael Rainey
 
Planet-scale Data Ingestion Pipeline: Bigdam
Planet-scale Data Ingestion Pipeline: BigdamPlanet-scale Data Ingestion Pipeline: Bigdam
Planet-scale Data Ingestion Pipeline: Bigdam
SATOSHI TAGOMORI
 
Enterprise Presto PaaS offering in Google Cloud
Enterprise Presto PaaS offering in Google Cloud Enterprise Presto PaaS offering in Google Cloud
Enterprise Presto PaaS offering in Google Cloud
Ashish Tadose
 
Day 7 - Make it Fast
Day 7 - Make it FastDay 7 - Make it Fast
Day 7 - Make it Fast
Barry Jones
 
(ATS6-PLAT06) Maximizing AEP Performance
(ATS6-PLAT06) Maximizing AEP Performance(ATS6-PLAT06) Maximizing AEP Performance
(ATS6-PLAT06) Maximizing AEP Performance
BIOVIA
 
NoSQL em Windows Azure Table Storage - Vitor Tomaz
NoSQL em Windows Azure Table Storage - Vitor TomazNoSQL em Windows Azure Table Storage - Vitor Tomaz
NoSQL em Windows Azure Table Storage - Vitor Tomaz
Comunidade NetPonto
 
Oracle GoldenGate and Apache Kafka A Deep Dive Into Real-Time Data Streaming
Oracle GoldenGate and Apache Kafka A Deep Dive Into Real-Time Data StreamingOracle GoldenGate and Apache Kafka A Deep Dive Into Real-Time Data Streaming
Oracle GoldenGate and Apache Kafka A Deep Dive Into Real-Time Data Streaming
Michael Rainey
 
Monitoring and Scaling Redis at DataDog - Ilan Rabinovitch, DataDog
 Monitoring and Scaling Redis at DataDog - Ilan Rabinovitch, DataDog Monitoring and Scaling Redis at DataDog - Ilan Rabinovitch, DataDog
Monitoring and Scaling Redis at DataDog - Ilan Rabinovitch, DataDog
Redis Labs
 
(ATS4-PLAT08) Server Pool Management
(ATS4-PLAT08) Server Pool Management(ATS4-PLAT08) Server Pool Management
(ATS4-PLAT08) Server Pool Management
BIOVIA
 
John adams talk cloudy
John adams   talk cloudyJohn adams   talk cloudy
John adams talk cloudy
John Adams
 
Cloud Security Monitoring and Spark Analytics
Cloud Security Monitoring and Spark AnalyticsCloud Security Monitoring and Spark Analytics
Cloud Security Monitoring and Spark Analytics
amesar0
 

Similar to Presto meetup 2015-03-19 @Facebook (20)

Presto At Treasure Data
Presto At Treasure DataPresto At Treasure Data
Presto At Treasure Data
 
Internals of Presto Service
Internals of Presto ServiceInternals of Presto Service
Internals of Presto Service
 
Presto as a Service - Tips for operation and monitoring
Presto as a Service - Tips for operation and monitoringPresto as a Service - Tips for operation and monitoring
Presto as a Service - Tips for operation and monitoring
 
Overview of data analytics service: Treasure Data Service
Overview of data analytics service: Treasure Data ServiceOverview of data analytics service: Treasure Data Service
Overview of data analytics service: Treasure Data Service
 
Oracle GoldenGate and Apache Kafka A Deep Dive Into Real-Time Data Streaming
Oracle GoldenGate and Apache Kafka A Deep Dive Into Real-Time Data StreamingOracle GoldenGate and Apache Kafka A Deep Dive Into Real-Time Data Streaming
Oracle GoldenGate and Apache Kafka A Deep Dive Into Real-Time Data Streaming
 
Measuring CDN performance and why you're doing it wrong
Measuring CDN performance and why you're doing it wrongMeasuring CDN performance and why you're doing it wrong
Measuring CDN performance and why you're doing it wrong
 
SharePoint Saturday The Conference 2011 - SP2010 Performance
SharePoint Saturday The Conference 2011 - SP2010 PerformanceSharePoint Saturday The Conference 2011 - SP2010 Performance
SharePoint Saturday The Conference 2011 - SP2010 Performance
 
SharePoint Saturday San Antonio: SharePoint 2010 Performance
SharePoint Saturday San Antonio: SharePoint 2010 PerformanceSharePoint Saturday San Antonio: SharePoint 2010 Performance
SharePoint Saturday San Antonio: SharePoint 2010 Performance
 
Presto Summit 2018 - 07 - Lyft
Presto Summit 2018 - 07 - LyftPresto Summit 2018 - 07 - Lyft
Presto Summit 2018 - 07 - Lyft
 
Oracle GoldenGate and Apache Kafka: A Deep Dive Into Real-Time Data Streaming
Oracle GoldenGate and Apache Kafka: A Deep Dive Into Real-Time Data StreamingOracle GoldenGate and Apache Kafka: A Deep Dive Into Real-Time Data Streaming
Oracle GoldenGate and Apache Kafka: A Deep Dive Into Real-Time Data Streaming
 
Planet-scale Data Ingestion Pipeline: Bigdam
Planet-scale Data Ingestion Pipeline: BigdamPlanet-scale Data Ingestion Pipeline: Bigdam
Planet-scale Data Ingestion Pipeline: Bigdam
 
Enterprise Presto PaaS offering in Google Cloud
Enterprise Presto PaaS offering in Google Cloud Enterprise Presto PaaS offering in Google Cloud
Enterprise Presto PaaS offering in Google Cloud
 
Day 7 - Make it Fast
Day 7 - Make it FastDay 7 - Make it Fast
Day 7 - Make it Fast
 
(ATS6-PLAT06) Maximizing AEP Performance
(ATS6-PLAT06) Maximizing AEP Performance(ATS6-PLAT06) Maximizing AEP Performance
(ATS6-PLAT06) Maximizing AEP Performance
 
NoSQL em Windows Azure Table Storage - Vitor Tomaz
NoSQL em Windows Azure Table Storage - Vitor TomazNoSQL em Windows Azure Table Storage - Vitor Tomaz
NoSQL em Windows Azure Table Storage - Vitor Tomaz
 
Oracle GoldenGate and Apache Kafka A Deep Dive Into Real-Time Data Streaming
Oracle GoldenGate and Apache Kafka A Deep Dive Into Real-Time Data StreamingOracle GoldenGate and Apache Kafka A Deep Dive Into Real-Time Data Streaming
Oracle GoldenGate and Apache Kafka A Deep Dive Into Real-Time Data Streaming
 
Monitoring and Scaling Redis at DataDog - Ilan Rabinovitch, DataDog
 Monitoring and Scaling Redis at DataDog - Ilan Rabinovitch, DataDog Monitoring and Scaling Redis at DataDog - Ilan Rabinovitch, DataDog
Monitoring and Scaling Redis at DataDog - Ilan Rabinovitch, DataDog
 
(ATS4-PLAT08) Server Pool Management
(ATS4-PLAT08) Server Pool Management(ATS4-PLAT08) Server Pool Management
(ATS4-PLAT08) Server Pool Management
 
John adams talk cloudy
John adams   talk cloudyJohn adams   talk cloudy
John adams talk cloudy
 
Cloud Security Monitoring and Spark Analytics
Cloud Security Monitoring and Spark AnalyticsCloud Security Monitoring and Spark Analytics
Cloud Security Monitoring and Spark Analytics
 

More from Treasure Data, Inc.

GDPR: A Practical Guide for Marketers
GDPR: A Practical Guide for MarketersGDPR: A Practical Guide for Marketers
GDPR: A Practical Guide for Marketers
Treasure Data, Inc.
 
AR and VR by the Numbers: A Data First Approach to the Technology and Market
AR and VR by the Numbers: A Data First Approach to the Technology and MarketAR and VR by the Numbers: A Data First Approach to the Technology and Market
AR and VR by the Numbers: A Data First Approach to the Technology and Market
Treasure Data, Inc.
 
Introduction to Customer Data Platforms
Introduction to Customer Data PlatformsIntroduction to Customer Data Platforms
Introduction to Customer Data Platforms
Treasure Data, Inc.
 
Hands On: Javascript SDK
Hands On: Javascript SDKHands On: Javascript SDK
Hands On: Javascript SDK
Treasure Data, Inc.
 
Hands-On: Managing Slowly Changing Dimensions Using TD Workflow
Hands-On: Managing Slowly Changing Dimensions Using TD WorkflowHands-On: Managing Slowly Changing Dimensions Using TD Workflow
Hands-On: Managing Slowly Changing Dimensions Using TD Workflow
Treasure Data, Inc.
 
Brand Analytics Management: Measuring CLV Across Platforms, Devices and Apps
Brand Analytics Management: Measuring CLV Across Platforms, Devices and AppsBrand Analytics Management: Measuring CLV Across Platforms, Devices and Apps
Brand Analytics Management: Measuring CLV Across Platforms, Devices and Apps
Treasure Data, Inc.
 
How to Power Your Customer Experience with Data
How to Power Your Customer Experience with DataHow to Power Your Customer Experience with Data
How to Power Your Customer Experience with Data
Treasure Data, Inc.
 
Why Your VR Game is Virtually Useless Without Data
Why Your VR Game is Virtually Useless Without DataWhy Your VR Game is Virtually Useless Without Data
Why Your VR Game is Virtually Useless Without Data
Treasure Data, Inc.
 
Connecting the Customer Data Dots
Connecting the Customer Data DotsConnecting the Customer Data Dots
Connecting the Customer Data Dots
Treasure Data, Inc.
 
Harnessing Data for Better Customer Experience and Company Success
Harnessing Data for Better Customer Experience and Company SuccessHarnessing Data for Better Customer Experience and Company Success
Harnessing Data for Better Customer Experience and Company Success
Treasure Data, Inc.
 
Packaging Ecosystems -Monki Gras 2017
Packaging Ecosystems -Monki Gras 2017Packaging Ecosystems -Monki Gras 2017
Packaging Ecosystems -Monki Gras 2017
Treasure Data, Inc.
 
글로벌 사례로 보는 데이터로 돈 버는 법 - 트레저데이터 (Treasure Data)
글로벌 사례로 보는 데이터로 돈 버는 법 - 트레저데이터 (Treasure Data)글로벌 사례로 보는 데이터로 돈 버는 법 - 트레저데이터 (Treasure Data)
글로벌 사례로 보는 데이터로 돈 버는 법 - 트레저데이터 (Treasure Data)
Treasure Data, Inc.
 
Keynote - Fluentd meetup v14
Keynote - Fluentd meetup v14Keynote - Fluentd meetup v14
Keynote - Fluentd meetup v14
Treasure Data, Inc.
 
Introduction to New features and Use cases of Hivemall
Introduction to New features and Use cases of HivemallIntroduction to New features and Use cases of Hivemall
Introduction to New features and Use cases of Hivemall
Treasure Data, Inc.
 
Scalable Hadoop in the cloud
Scalable Hadoop in the cloudScalable Hadoop in the cloud
Scalable Hadoop in the cloud
Treasure Data, Inc.
 
Using Embulk at Treasure Data
Using Embulk at Treasure DataUsing Embulk at Treasure Data
Using Embulk at Treasure Data
Treasure Data, Inc.
 
Scaling to Infinity - Open Source meets Big Data
Scaling to Infinity - Open Source meets Big DataScaling to Infinity - Open Source meets Big Data
Scaling to Infinity - Open Source meets Big Data
Treasure Data, Inc.
 
Treasure Data: Move your data from MySQL to Redshift with (not much more tha...
Treasure Data:  Move your data from MySQL to Redshift with (not much more tha...Treasure Data:  Move your data from MySQL to Redshift with (not much more tha...
Treasure Data: Move your data from MySQL to Redshift with (not much more tha...
Treasure Data, Inc.
 
Treasure Data From MySQL to Redshift
Treasure Data  From MySQL to RedshiftTreasure Data  From MySQL to Redshift
Treasure Data From MySQL to Redshift
Treasure Data, Inc.
 
Unifying Events and Logs into the Cloud
Unifying Events and Logs into the CloudUnifying Events and Logs into the Cloud
Unifying Events and Logs into the Cloud
Treasure Data, Inc.
 

More from Treasure Data, Inc. (20)

GDPR: A Practical Guide for Marketers
GDPR: A Practical Guide for MarketersGDPR: A Practical Guide for Marketers
GDPR: A Practical Guide for Marketers
 
AR and VR by the Numbers: A Data First Approach to the Technology and Market
AR and VR by the Numbers: A Data First Approach to the Technology and MarketAR and VR by the Numbers: A Data First Approach to the Technology and Market
AR and VR by the Numbers: A Data First Approach to the Technology and Market
 
Introduction to Customer Data Platforms
Introduction to Customer Data PlatformsIntroduction to Customer Data Platforms
Introduction to Customer Data Platforms
 
Hands On: Javascript SDK
Hands On: Javascript SDKHands On: Javascript SDK
Hands On: Javascript SDK
 
Hands-On: Managing Slowly Changing Dimensions Using TD Workflow
Hands-On: Managing Slowly Changing Dimensions Using TD WorkflowHands-On: Managing Slowly Changing Dimensions Using TD Workflow
Hands-On: Managing Slowly Changing Dimensions Using TD Workflow
 
Brand Analytics Management: Measuring CLV Across Platforms, Devices and Apps
Brand Analytics Management: Measuring CLV Across Platforms, Devices and AppsBrand Analytics Management: Measuring CLV Across Platforms, Devices and Apps
Brand Analytics Management: Measuring CLV Across Platforms, Devices and Apps
 
How to Power Your Customer Experience with Data
How to Power Your Customer Experience with DataHow to Power Your Customer Experience with Data
How to Power Your Customer Experience with Data
 
Why Your VR Game is Virtually Useless Without Data
Why Your VR Game is Virtually Useless Without DataWhy Your VR Game is Virtually Useless Without Data
Why Your VR Game is Virtually Useless Without Data
 
Connecting the Customer Data Dots
Connecting the Customer Data DotsConnecting the Customer Data Dots
Connecting the Customer Data Dots
 
Harnessing Data for Better Customer Experience and Company Success
Harnessing Data for Better Customer Experience and Company SuccessHarnessing Data for Better Customer Experience and Company Success
Harnessing Data for Better Customer Experience and Company Success
 
Packaging Ecosystems -Monki Gras 2017
Packaging Ecosystems -Monki Gras 2017Packaging Ecosystems -Monki Gras 2017
Packaging Ecosystems -Monki Gras 2017
 
글로벌 사례로 보는 데이터로 돈 버는 법 - 트레저데이터 (Treasure Data)
글로벌 사례로 보는 데이터로 돈 버는 법 - 트레저데이터 (Treasure Data)글로벌 사례로 보는 데이터로 돈 버는 법 - 트레저데이터 (Treasure Data)
글로벌 사례로 보는 데이터로 돈 버는 법 - 트레저데이터 (Treasure Data)
 
Keynote - Fluentd meetup v14
Keynote - Fluentd meetup v14Keynote - Fluentd meetup v14
Keynote - Fluentd meetup v14
 
Introduction to New features and Use cases of Hivemall
Introduction to New features and Use cases of HivemallIntroduction to New features and Use cases of Hivemall
Introduction to New features and Use cases of Hivemall
 
Scalable Hadoop in the cloud
Scalable Hadoop in the cloudScalable Hadoop in the cloud
Scalable Hadoop in the cloud
 
Using Embulk at Treasure Data
Using Embulk at Treasure DataUsing Embulk at Treasure Data
Using Embulk at Treasure Data
 
Scaling to Infinity - Open Source meets Big Data
Scaling to Infinity - Open Source meets Big DataScaling to Infinity - Open Source meets Big Data
Scaling to Infinity - Open Source meets Big Data
 
Treasure Data: Move your data from MySQL to Redshift with (not much more tha...
Treasure Data:  Move your data from MySQL to Redshift with (not much more tha...Treasure Data:  Move your data from MySQL to Redshift with (not much more tha...
Treasure Data: Move your data from MySQL to Redshift with (not much more tha...
 
Treasure Data From MySQL to Redshift
Treasure Data  From MySQL to RedshiftTreasure Data  From MySQL to Redshift
Treasure Data From MySQL to Redshift
 
Unifying Events and Logs into the Cloud
Unifying Events and Logs into the CloudUnifying Events and Logs into the Cloud
Unifying Events and Logs into the Cloud
 

Recently uploaded

Cyaniclab : Software Development Agency Portfolio.pdf
Cyaniclab : Software Development Agency Portfolio.pdfCyaniclab : Software Development Agency Portfolio.pdf
Cyaniclab : Software Development Agency Portfolio.pdf
Cyanic lab
 
Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...
Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...
Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...
Anthony Dahanne
 
Designing for Privacy in Amazon Web Services
Designing for Privacy in Amazon Web ServicesDesigning for Privacy in Amazon Web Services
Designing for Privacy in Amazon Web Services
KrzysztofKkol1
 
Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus Compute wth IRI Workflows - GlobusWorld 2024Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus
 
Why React Native as a Strategic Advantage for Startup Innovation.pdf
Why React Native as a Strategic Advantage for Startup Innovation.pdfWhy React Native as a Strategic Advantage for Startup Innovation.pdf
Why React Native as a Strategic Advantage for Startup Innovation.pdf
ayushiqss
 
GlobusWorld 2024 Opening Keynote session
GlobusWorld 2024 Opening Keynote sessionGlobusWorld 2024 Opening Keynote session
GlobusWorld 2024 Opening Keynote session
Globus
 
Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...
Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...
Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...
informapgpstrackings
 
Globus Connect Server Deep Dive - GlobusWorld 2024
Globus Connect Server Deep Dive - GlobusWorld 2024Globus Connect Server Deep Dive - GlobusWorld 2024
Globus Connect Server Deep Dive - GlobusWorld 2024
Globus
 
Explore Modern SharePoint Templates for 2024
Explore Modern SharePoint Templates for 2024Explore Modern SharePoint Templates for 2024
Explore Modern SharePoint Templates for 2024
Sharepoint Designs
 
Prosigns: Transforming Business with Tailored Technology Solutions
Prosigns: Transforming Business with Tailored Technology SolutionsProsigns: Transforming Business with Tailored Technology Solutions
Prosigns: Transforming Business with Tailored Technology Solutions
Prosigns
 
Software Testing Exam imp Ques Notes.pdf
Software Testing Exam imp Ques Notes.pdfSoftware Testing Exam imp Ques Notes.pdf
Software Testing Exam imp Ques Notes.pdf
MayankTawar1
 
Lecture 1 Introduction to games development
Lecture 1 Introduction to games developmentLecture 1 Introduction to games development
Lecture 1 Introduction to games development
abdulrafaychaudhry
 
Enhancing Research Orchestration Capabilities at ORNL.pdf
Enhancing Research Orchestration Capabilities at ORNL.pdfEnhancing Research Orchestration Capabilities at ORNL.pdf
Enhancing Research Orchestration Capabilities at ORNL.pdf
Globus
 
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoam
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoamOpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoam
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoam
takuyayamamoto1800
 
Providing Globus Services to Users of JASMIN for Environmental Data Analysis
Providing Globus Services to Users of JASMIN for Environmental Data AnalysisProviding Globus Services to Users of JASMIN for Environmental Data Analysis
Providing Globus Services to Users of JASMIN for Environmental Data Analysis
Globus
 
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital TransformationWSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2
 
Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...
Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...
Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...
Shahin Sheidaei
 
Beyond Event Sourcing - Embracing CRUD for Wix Platform - Java.IL
Beyond Event Sourcing - Embracing CRUD for Wix Platform - Java.ILBeyond Event Sourcing - Embracing CRUD for Wix Platform - Java.IL
Beyond Event Sourcing - Embracing CRUD for Wix Platform - Java.IL
Natan Silnitsky
 
BoxLang: Review our Visionary Licenses of 2024
BoxLang: Review our Visionary Licenses of 2024BoxLang: Review our Visionary Licenses of 2024
BoxLang: Review our Visionary Licenses of 2024
Ortus Solutions, Corp
 
Understanding Globus Data Transfers with NetSage
Understanding Globus Data Transfers with NetSageUnderstanding Globus Data Transfers with NetSage
Understanding Globus Data Transfers with NetSage
Globus
 

Recently uploaded (20)

Cyaniclab : Software Development Agency Portfolio.pdf
Cyaniclab : Software Development Agency Portfolio.pdfCyaniclab : Software Development Agency Portfolio.pdf
Cyaniclab : Software Development Agency Portfolio.pdf
 
Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...
Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...
Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...
 
Designing for Privacy in Amazon Web Services
Designing for Privacy in Amazon Web ServicesDesigning for Privacy in Amazon Web Services
Designing for Privacy in Amazon Web Services
 
Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus Compute wth IRI Workflows - GlobusWorld 2024Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus Compute wth IRI Workflows - GlobusWorld 2024
 
Why React Native as a Strategic Advantage for Startup Innovation.pdf
Why React Native as a Strategic Advantage for Startup Innovation.pdfWhy React Native as a Strategic Advantage for Startup Innovation.pdf
Why React Native as a Strategic Advantage for Startup Innovation.pdf
 
GlobusWorld 2024 Opening Keynote session
GlobusWorld 2024 Opening Keynote sessionGlobusWorld 2024 Opening Keynote session
GlobusWorld 2024 Opening Keynote session
 
Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...
Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...
Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...
 
Globus Connect Server Deep Dive - GlobusWorld 2024
Globus Connect Server Deep Dive - GlobusWorld 2024Globus Connect Server Deep Dive - GlobusWorld 2024
Globus Connect Server Deep Dive - GlobusWorld 2024
 
Explore Modern SharePoint Templates for 2024
Explore Modern SharePoint Templates for 2024Explore Modern SharePoint Templates for 2024
Explore Modern SharePoint Templates for 2024
 
Prosigns: Transforming Business with Tailored Technology Solutions
Prosigns: Transforming Business with Tailored Technology SolutionsProsigns: Transforming Business with Tailored Technology Solutions
Prosigns: Transforming Business with Tailored Technology Solutions
 
Software Testing Exam imp Ques Notes.pdf
Software Testing Exam imp Ques Notes.pdfSoftware Testing Exam imp Ques Notes.pdf
Software Testing Exam imp Ques Notes.pdf
 
Lecture 1 Introduction to games development
Lecture 1 Introduction to games developmentLecture 1 Introduction to games development
Lecture 1 Introduction to games development
 
Enhancing Research Orchestration Capabilities at ORNL.pdf
Enhancing Research Orchestration Capabilities at ORNL.pdfEnhancing Research Orchestration Capabilities at ORNL.pdf
Enhancing Research Orchestration Capabilities at ORNL.pdf
 
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoam
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoamOpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoam
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoam
 
Providing Globus Services to Users of JASMIN for Environmental Data Analysis
Providing Globus Services to Users of JASMIN for Environmental Data AnalysisProviding Globus Services to Users of JASMIN for Environmental Data Analysis
Providing Globus Services to Users of JASMIN for Environmental Data Analysis
 
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital TransformationWSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
 
Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...
Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...
Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...
 
Beyond Event Sourcing - Embracing CRUD for Wix Platform - Java.IL
Beyond Event Sourcing - Embracing CRUD for Wix Platform - Java.ILBeyond Event Sourcing - Embracing CRUD for Wix Platform - Java.IL
Beyond Event Sourcing - Embracing CRUD for Wix Platform - Java.IL
 
BoxLang: Review our Visionary Licenses of 2024
BoxLang: Review our Visionary Licenses of 2024BoxLang: Review our Visionary Licenses of 2024
BoxLang: Review our Visionary Licenses of 2024
 
Understanding Globus Data Transfers with NetSage
Understanding Globus Data Transfers with NetSageUnderstanding Globus Data Transfers with NetSage
Understanding Globus Data Transfers with NetSage
 

Presto meetup 2015-03-19 @Facebook

  • 1. Copyright ©2015 Treasure Data. All Rights Reserved. Presto  as  a  Service Tips  for  operation  and  monitoring Dongmin Yu Treasure  Data,  Inc. min@treasure-­data.com JeroMQ /  ZeroMQ committer  &  maintainer Mar  19,  2015 Presto  Meetup @  Facebook
  • 2. Copyright ©2015 Treasure Data. All Rights Reserved. Topics   • Presto  as  a  Service  in  Treasure  Data – Error  Recovery – Presto  Deployment • Tips  for  Monitoring  Presto – JSON  API – Presto  +  Fluentd • Custom  changes 2
  • 3. Copyright ©2015 Treasure Data. All Rights Reserved. Treasure  Data:  Presto  as  a  Service 3 Presto Public Release
  • 4. Hive TD  API  /   Web  ConsoleInteractive  query batch  query Presto Treasure  Data PlazmaDB: MessagePack Columnar  Storage td-­presto  connector
  • 5. Copyright ©2015 Treasure Data. All Rights Reserved. Deployment • Building  Presto  takes  more  than  20  minutes. • Facebook  frequently  releases  new  versions • Let  CircleCI build  Presto   – Deploy  jar  files  to  private  Maven  repository – We  sometime  use  non-­release  versions • for  fixing  serious  bugs • hot-­fix  patches • Integration  Test – td-­presto  connector • PlazmaDB,  Multi-­tenant  query  scheduler • Query  optimizer – Run  test  queries  on  staging  cluster – Presto  Verifier 5
  • 6. Copyright ©2015 Treasure Data. All Rights Reserved. Production:  Blue-­Green  Deployment • http://martinfowler.com/bliki/BlueGreenDeployment.html • 2  Presto  Coordinators  (Blue/Green) – Route  Presto  queries  to  the  active  cluster – No  down-­time  upon  deployment • Launch  Presto  worker  instances  with  chef      <-­ less  than  5  min.  in  AWS • Inactive  clusters  is  used  for  pre-­production  testing  and  customer  support – Investigation  and  tuning  of  customer  query  performance – Trouble  shooting 6
  • 7. Copyright ©2015 Treasure Data. All Rights Reserved. Error  Recovery • Presto  has  no  fault  tolerance • Error  types – User  error • Syntax  errors – SQL  syntax,  missing  function • Semantic  errors – missing  tables/columns – Insufficient  resource   • Exceeded  task  memory  size – Internal  failure • I/O  error – S3/Riak CS • worker  failure • etc. 7 Worth A Retry!
  • 8. Copyright ©2015 Treasure Data. All Rights Reserved. Failed  Query  Rate 8
  • 9. Copyright ©2015 Treasure Data. All Rights Reserved. 9
  • 10. Copyright ©2015 Treasure Data. All Rights Reserved. Query  Retry  Patterns  used  in  TD • Error  code  +  message  pattern 10
  • 11. Copyright ©2015 Treasure Data. All Rights Reserved. Monitoring  Presto  with  Fluentd 11
  • 12. Copyright ©2015 Treasure Data. All Rights Reserved. Monitoring  Presto • REST  API  for  monitoring  Presto  state – JSON  format • (presto  server  IP):8080/v1/query – List  of  recent  queries    (BasicQueryInfo class) • (presto  server  IP):8080/v1/query/(query  id) – Detailed  query  state  information – Query  plan,  tasks  and  running  worker  IDs   – Processed  rows/data  size 12
  • 13. Copyright ©2015 Treasure Data. All Rights Reserved. Query  List      /v1/query 13
  • 14. Copyright ©2015 Treasure Data. All Rights Reserved. Detailed  query  Info  /v1/query/(query  id) 14
  • 15. Copyright ©2015 Treasure Data. All Rights Reserved. /ui/query-­execution/(query  id) 15
  • 16. Copyright ©2015 Treasure Data. All Rights Reserved. Complex  Queries 16
  • 17. Copyright ©2015 Treasure Data. All Rights Reserved. 17
  • 18. Copyright ©2015 Treasure Data. All Rights Reserved. Presto  Coordinator • Organizes  query  execution  pipelines – Coordinates  presto  workers • Retrieves  table  partition  and  split  location  from  connectors – Creates  distributed  query  plans • Full  GC – Stalls  coordinator • When  memory  is  insufficient – Use  memory-­rich  machine – GC  Tuning • UseG1GC 18
  • 19. Copyright ©2015 Treasure Data. All Rights Reserved. presto-­metrics  (Ruby) • https://github.com/xerial/presto-­metrics 19
  • 20. Copyright ©2015 Treasure Data. All Rights Reserved. 20
  • 21. Copyright ©2015 Treasure Data. All Rights Reserved. Query  Collection  in  TD • SQL  query  logs – query,  detailed  query  plan,  elapsed  time,  processed  rows,  etc. – newSetBinder(binder,EventClient.class).addBinding() .to(FluentEventClient.class) • Presto  is  used  for  analyzing  the  query  history 21
  • 22. Copyright ©2015 Treasure Data. All Rights Reserved. Daily/Hourly  Query  Usage 22
  • 23. Copyright ©2015 Treasure Data. All Rights Reserved. Query  Running  Time • More  than  90%  of  queries  finishes  within  2  min. ≒ expected  response  time  for  interactive  queries 23
  • 24. Copyright ©2015 Treasure Data. All Rights Reserved. Detecting  Anomaly • Started  Query  Rate  (in  5min/15min) – If  no  query  has  started,  cluster  may  be  down  (or  not  started  properly) • Processed  rows  in  a  query – Sum  up  the  number  of  the  processed  rows  from  all  of  the  sub  stages – Simple,  but  the  most  reliable  measure   • Send  an  alert – Slack  notification – PagerDuty call • JP/US  team  rotation 24
  • 25. Copyright ©2015 Treasure Data. All Rights Reserved. Benchmarking • Query  performance  comparison – between  two  versions  of  Presto • Benchmark – Run  query  set  multiple  times – Store  the  results  to  TD – Report  the  result  with  Presto • Aggregation  query 25
  • 26. Copyright ©2015 Treasure Data. All Rights Reserved. Presto  Operation  Tool • Prestop – Our  internal  tool  for  managing  multiple  presto   clusters • written  in  Scala – Query  monitoring – Benchmarking – Workload  simulation • stress  testing • Monitoring – Datadog – PageDuty – ChartIO (query  stats) 26
  • 27. Copyright ©2015 Treasure Data. All Rights Reserved. buffer Optimizing  Scan  Performance  – Storage  Manager • Fully  utilize  the  network  bandwidth  from  S3 • TD  Presto  becomes  CPU  bottleneck 27 TableScanOperators • s3  file  list • table  schema header   request S3 / RiakCS • release(Buffer) Buffer size limit Reuse allocated buffers Request Queue • priority queue • max connections limit Header Column Block 0 (column names) Column Block 1 Column Block i Column Block m MPC1 file HeaderReader • callback  to  HeaderParser ColumnBlockReader header HeaderParser • parse  MPC  file  header • column  block  offsets • column  names column block request Column  block  requests column block prepare buffer MessageUnpacker MessageUnpacker S3 read S3 read pull records Retry  GET  request  on -­ 500  (internal  error) -­ 503  (slow  down) -­ 404  (not  found) -­ eventual  consistency S3 read• decompression • msgpack-­java  v07 • On-­demand  de-­ser S3 read S3 read S3 read
  • 28. Copyright ©2015 Treasure Data. All Rights Reserved. Multi-­tenancy:  Resource  Allocation • Price-­plan  based  resource  allocation • Parameters – The  number  of  worker  nodes  to  use  (min-­candidates) – The  number  of  hash  partitions  (initial-­hash-­partitions) – The  maximum  number  of  running  tasks  per  account • If  running  queries  exceeds  allowed  number  of  tasks,  the  next  queries  need  to  wait   (queued) • Presto:  SqlQueryExecution class – Controls  query  execution  state:  planning  -­>  running  -­>  finished • No  resource  allocation  policy – Extended  TDSqlQueryExection class  monitors  running  tasks  and  limits  resource   usage • Rewriting  SqlQueryExecutionFactory at  run-­time  by  using  ASM  library 28
  • 29. Copyright ©2015 Treasure Data. All Rights Reserved. WE  ARE  HIRING! 29 Check: www.treasuredata.com