40
Our Presto use case and performance test Hironori Ogibayashi Shin Matsuura

20140120 presto meetup_en

Embed Size (px)

Citation preview

Page 1: 20140120 presto meetup_en

Our Presto use caseand

performance testHironori Ogibayashi

Shin Matsuura

Page 2: 20140120 presto meetup_en

About us

● Hironori Ogibayashi(@angostura11) ● Shin Matsuura

○ IT Infrastructure team in Japanese telecommunications carrier

○ Mainly working on middleware - test, installation, deployment.

Page 3: 20140120 presto meetup_en

Todays Topic

● Presto use case○ Deployment○ Use case○ Challenges○ Future work

● Performance comparison between Hive+Tez and Presto

Page 4: 20140120 presto meetup_en

Presto use case

Page 5: 20140120 presto meetup_en

Log Collection Flow

FluentdAggregator

Hadoop Cluster ApplicationWebHDFS

・1500 Fluentd instances・25,000 msg / sec・400GB / day・150 types of log

Page 6: 20140120 presto meetup_en

Log Usage

● Systems Infrastructure team○ Checking trends in server performance ○ Performance analysis of Oracle

Database

● Application development team○ Improving system and business

operations.

Page 7: 20140120 presto meetup_en

Application for Oracle DB Performance Analysis- Check existing/potential problems of Oracle database, for certain system, certain period.

- Utilize logs stored in HDFS. Queries were executed on Hive.

- But, it took more than one hour to get the result...

- (So, we migrated to Presto.)

Page 8: 20140120 presto meetup_en

Why Presto?

● Frequent use of Interactive / ad-hoc queries.

● Of cource, faster is better.

Page 9: 20140120 presto meetup_en

Hadoop Slave

Presto Deployment

Hadoop Slave

DataNode

TaskTracker

Presto Worker

Presto Coordinator

Hive Metastore

Application/Client

・・・

● A decicated physical machine as a Coordinator.

● Workers run on each Hadoop slaves.● Logs in HDFS are periodically

converted to RCfiles.● Presto versions

○ 0.66⇒0.73⇒0.75⇒0.82

Page 10: 20140120 presto meetup_en

Deployment Effect - Elapsed time of a single query

230sec

7sec- Elapsed time of one of

the queries issued by the application.

- Query was run on CDH4 (MRv1) cluster.

Page 11: 20140120 presto meetup_en

Deployment and Operation

● Deployment○ Easy;Just extract binaries in each server and modify

configuration file.○ Automated by Ansible + yum.

● What we use in operation○ Query history

■ Coordinator Web UI○ Logs

■ /var/presto/data/logs/{server.log,launcher.log}○ Metrics

■ presto-metrics(https://github.com/xerial/presto-metrics)⇒Fluentd⇒Elasticsearch + Kibana

○ sys schema

Page 12: 20140120 presto meetup_en

Challenges● Worker crash / hang.

○ OutOfMemory. In case of hanging, we resolve to “kill -9”.○ We Modified the memory parameter: task.shard.max-

threads×task.max-memory < -Xmx

● At first, we set node-scheduler.include-coordinator=true. In which case, Coordinator crashed due to heavy query.

● SQL difference from HiveQL○ At first our Application used both Hive and Presto because we used

Presto experimentally.Hence the Application had to support both HiveQL and Presto(ANSI SQL).

○ Now, the application no longer use Hive.

Page 13: 20140120 presto meetup_en

Future work

● Improve Coodinator’s availability.● Security

○ Now, all queries are executed as Presto’s daemon user.● Resource isolation between Presto and Hadoop daemons.

Page 14: 20140120 presto meetup_en

Presto VS Hive+Tez

Page 15: 20140120 presto meetup_en

Contents

From a Performance perspective

Presto VS Hive+Tez

(not tuning any parameteres)

Page 16: 20140120 presto meetup_en

Conclusion

Presto VS Hive+TezWin Lose

Page 17: 20140120 presto meetup_en

How Fast??

Presto VS Hive+Tez

2.0~136 times

Page 18: 20140120 presto meetup_en

more details

Page 19: 20140120 presto meetup_en

Testing environment Configurations2p12c

64GB Mem36TB Disk

NN

DN DN DN

Hadoop(HDP2.1)

Presto(0.82)

Coodinator

Worker Worker Worker

Master : 3nodes

Slave : 3nodes

NN

Metastore

Page 20: 20140120 presto meetup_en

Sample data

300GBcsv file

50 columns

1.1B records

Page 21: 20140120 presto meetup_en

Performance measurement perspectives

• Query patterns• Data format patterns• Repetitive Querying

Page 22: 20140120 presto meetup_en

Query patterns

Page 23: 20140120 presto meetup_en

Queries

Query1: select count(*) from TestTBL

Query2: select * from TestTBL where col1 = ‘XXX’

Query3: select * from TestTBL where col1 = ‘XXX’ and col2 = ‘YYY’

Query4: select col1, count(*) from TestTBL group by col1

Query5: select col1, count(*) from TestTBL where col2 = ‘YYY’ group by col1

Page 24: 20140120 presto meetup_en

data format :Txt

Results: Query patterns

Page 25: 20140120 presto meetup_en

data format :Txt

Results: Query patterns

100x faster

Presto was faster in processing speed than Hive+Tez in all queries.

Page 26: 20140120 presto meetup_en

Data format patterns

Page 27: 20140120 presto meetup_en

Data formats

• Text File (Textfile)• Record Columnar File (RCfile)• Optimized Row Columnar File (ORCfile)

Page 28: 20140120 presto meetup_en

Results: Data format patterns

※Query: Query2

Page 29: 20140120 presto meetup_en

Results: Data format patterns

※Query: Query2

Presto was faster in processing speed than Hive+Tez in all data formats.

Page 30: 20140120 presto meetup_en

Repetitive Querying

Page 31: 20140120 presto meetup_en

Change in processing time with repetitions(Presto)

※Query: Query2※Data format: Txt

Page 32: 20140120 presto meetup_en

Change in processing time with repetitions (Presto)※Query: Query2

※Data format: Txt

Became faster After the second time.Cache ???

2.5x faster

Page 33: 20140120 presto meetup_en

Change in processing time with repetitions (Hive+Tez)

※Query: Query2※Data format: Txt

Page 34: 20140120 presto meetup_en

Change in processing time with repetitions (Hive+Tez)

※Query: Query2※Data format: Txt

No real change in processing time

Page 35: 20140120 presto meetup_en

Page 36: 20140120 presto meetup_en

Engine:Presto

Query × Data format

Page 37: 20140120 presto meetup_en

Engine:Presto

Query × Data format

Is using RCfile the most stable and fastest way ??

Page 38: 20140120 presto meetup_en

Summary

Result● Presto was faster than Hive+Tez in all queries.● Presto was faster than Hive+Tez in all data formats.● With repetitive Querying, presto became faster.● By Using RCfile, Presto was the most stable and fastest.

Next● Benchmark from node scaling and data volumn

perspectives.● Benchmark while using compression functions of

ORCfile.● Benchmark with HDP2.2.

Page 39: 20140120 presto meetup_en

Appendix

Page 40: 20140120 presto meetup_en

ほぼすべての条件で2回目以降高速