Statically Inferring Performance Properties of Software - - PowerPoint PPT Presentation

statically inferring performance properties of software
SMART_READER_LITE
LIVE PREVIEW

Statically Inferring Performance Properties of Software - - PowerPoint PPT Presentation

Statically Inferring Performance Properties of Software Configurations Chi Li , Shu Wang, Henry Hoffmann, Shan Lu Configurations Explosion Tianyin Xu, Long Jin, Xuepeng Fan, Yuanyuan Zhou, Shankar Pasupathy, and Rukma Talwadker . Hey, You Have


slide-1
SLIDE 1

Statically Inferring Performance Properties of Software Configurations Chi Li, Shu Wang, Henry Hoffmann, Shan Lu

slide-2
SLIDE 2

Configurations Explosion

2 Tianyin Xu, Long Jin, Xuepeng Fan, Yuanyuan Zhou, Shankar Pasupathy, and Rukma Talwadker . Hey, You Have Given Me Too Many Knobs! Understanding and Dealing with Over-Designed Configuration in System Software. In FSE, 2016

slide-3
SLIDE 3

Which configuration affects performance?

3

#36170959, Cassandra Performance Tuning "Please let me know what more settings I can tweak to get maximum performance out of my cluster." #47665640, Memory configurations “I am finding that I am running out of memory when running my

  • queries. I was able to figure out how to restrict cassandra to run in

less than 4gb. Is there such a setting for hadoop?” #45565896, MapReduce Error: Java heap space “Besides those parameters in the configuration, I do not change anything else, so I use the default values. How can I solve the Error: Java Heap Space”

slide-4
SLIDE 4

How to performance-tune configurations?

4

#37897438, Hbase Performance Tuning “I have the following petameters in Hbase: … Can anyone suggest any configuration changes to generate more IO per second? ” #7243670, Hbase performance “My major configurations are: … Am I doing something wrong with the configuration? This is my last shot at Hbase. Please help” #HBase-13919, Rationalize Client Timeout “There are current many setting that influence how/when an HBase client times out. This is hard to configure, hard to understand, and badly documented.”

slide-5
SLIDE 5

Performance Misconfigurations

5

  • Common

– 65% of configuration issue reports – 35% of configuration posts on Stack Overflow

  • Severe

– 20% of MySQL misconfig. -> severe slowdown – 1/3 of Hadoop misconfig. -> memory issue (OOM)

Shu Wang, Chi Li, Henry Hoffmann, Shan Lu, William Sentosa, and Achmad Imam Kistijantoro. Understanding and auto-adjusting performance-sensitive configurations. In ACM SIGPLAN Notices, volume 53, pages 154–168. ACM, 2018. Zuoning Yin, Xiao Ma, Jing Zheng, Yuanyuan Zhou, Lakshmi N Bairavasundaram, and Shankar Pasupathy. An empirical study on configuration errors in commercial and open source systems. In SOSP, 2011

slide-6
SLIDE 6

Can we help?

Can we automatically answer ...

6

Does a configuration affect performance? How does a configuration affect performance?

slide-7
SLIDE 7

Previous work ---- Auto-tuning

  • Expensive training and profiling
  • Not working if workload/environment changes at run time

7

Machine Learning and Control Theory Profiling Data Optimal Settings

How can we do better?

slide-8
SLIDE 8

Our Key Insights

8

Dynamic behavior reflects Static program logic Does a configuration affect performance? Does a Performance Operation (PerfOp) depend

  • n the configuration?

How does a Performance- sensitive Configuration (PerfConf) affect performance? How does the PerfOp depend on the PerfConf? int sortmb = job.getInt(“io.sort.mb”); int maxUsage = sortmb * 1024 * 1024; buffer = new Byte[maxUsage]; PerfConf PerfOp

slide-9
SLIDE 9

9

How to use program analysis to infer configurations' performance impact?

  • Understanding
  • Tool design
  • Evaluation
slide-10
SLIDE 10

10

How to use program analysis to infer configurations' performance impact?

  • Understanding
  • Tool design
  • Evaluation
slide-11
SLIDE 11

How can a Conf affect a Perf-Op?

11

?

Data Dependency Control Dependency If Related Loop Related

slide-12
SLIDE 12

How can a Conf affect performance?

12

Data Dependency Control Dependency If Related Loop Related Loop Bound Loop Stride

  • Sync. Loop

Infinite Loop Unrelated Bouncy Approaching Constant

How does Conf affect loop? What type of variables are compared in IF predicate?

slide-13
SLIDE 13

How can a Conf affect performance?

13

Data Dependency Control Dependency If Related Loop Related Loop Bound Loop Stride

  • Sync. Loop

Infinite Loop Unrelated Bouncy Approaching Constant

slide-14
SLIDE 14

Code Example Formula Performance Graph PerfOp(Conf) 𝑄𝑓𝑠𝑔𝑝𝑠𝑛𝑏𝑜𝑑 = 𝐷𝑝𝑜𝑔

Data Dependency

  • Configuration affects the impact of every instance
  • f PerfOp through parameters

14

int sortmb = job.getInt(“io.sort.mb”); int maxUsage = sortmb * 1024 * 1024; buffer = new Byte[maxUsage];

slide-15
SLIDE 15

How can a Conf affect performance?

15

Data Dependency Control Dependency If Related Loop Related Loop Bound Loop Stride

  • Sync. Loop

Infinite Loop Unrelated Bouncy Approaching Constant

slide-16
SLIDE 16

If Related Patterns

  • Conf affects whether the PerfOp is executed

16

Code Example Formula Performance Graph If (V <= C) { PerfOpA } else { PerfOpB } Performance = ,𝑏, 𝑊 ≤ 𝐷 𝑐, 𝑊 > 𝐷

slide-17
SLIDE 17

How can a Conf affect performance?

17

Data Dependency Control Dependency If Related Loop Related Loop Bound Loop Stride

  • Sync. Loop

Infinite Loop Unrelated Bouncy Approaching Constant

slide-18
SLIDE 18

Compared with Constant

  • The if-else decision does not change over time

18

if (maxFsObjects != 0) { lock(); }

40 80

5 10

Latency(ms) Request

slide-19
SLIDE 19

How can a Conf affect performance?

19

Data Dependency Control Dependency If Related Loop Related Loop Bound Loop Stride

  • Sync. Loop

Infinite Loop Unrelated Bouncy Approaching Constant

slide-20
SLIDE 20

Compared with Bouncy Variable

  • The if-else decision keeps changing over time

20

  • 25
  • 20
  • 15
  • 10
  • 5

5 10 200 400 600 800 1000

∆ Memory(MB) Request

Mem Flush

currentSize += put.heapSize(); writeBuffer.add(put); If (currentSize > bufferSize) { writeBuffer.clear(); currentSize = 0; }

slide-21
SLIDE 21

How can a Conf affect performance?

21

Data Dependency Control Dependency If Related Loop Related Loop Bound Loop Stride

  • Sync. Loop

Infinite Loop Unrelated Bouncy Approaching Constant

slide-22
SLIDE 22

How can a Conf affect performance?

22

Data Dependency Control Dependency If Related Loop Related Loop Bound Loop Stride

  • Sync. Loop

Infinite Loop Unrelated Bouncy Approaching Constant

slide-23
SLIDE 23

Affect Loop Stride

  • Conf used as a loop stride in the loop-exit condition

23

Code Example Formula Performance Graph for (; i < N; i+=Conf) { PerfOp(); } 𝑄𝑓𝑠𝑔𝑝𝑠𝑛𝑏𝑜𝑑𝑓 = 𝑏𝑂/𝐷𝑝𝑜𝑔 while (bytesRemaining > 0) { splits.add(makeSplit()); bytesRemaining -= splitSize; }

5 10 15 20 25 20 40 60 80 100 120 140

Job Latency(s) Configuration(splitSize)

slide-24
SLIDE 24

How can a Conf affect performance?

24

Data Dependency Control Dependency If Related Loop Related Loop Bound Loop Stride

  • Sync. Loop

Infinite Loop Unrelated Bouncy Approaching Constant

More details in the paper

slide-25
SLIDE 25

25

  • Understanding
  • Tool design
  • Evaluation
slide-26
SLIDE 26

LearnConf Overview

26

PerfConf - PerfOp Identification Pattern Analysis Pattern- specific Analysis LearnConf PerfConf- PerfOp pair Binary Performance Properties List of PerfConf

  • iosort.mb
  • io.sort.factor
  • handler.count…
  • input.buffer
  • indexcache.mb

Pattern: Data Dependency

  • Pat. Spe. Properties:
  • User request: MapTask
  • Linear: Yes
  • Slope: 1024 * 1024
  • Range effect: No
  • Related PerfConf: No
  • Monotonic: Yes
slide-27
SLIDE 27

Identify Configuration Variable

  • Identify configuration-loading API

– Add return var. to configuration variable set

  • Track data-dependence chain

– Tag more variables as configuration variables

int sortmb = job.getInt(“io.sort.mb”); int maxUsage = sortmb * 1024 * 1024; buffer = new Byte[maxUsage];

27

configuration-loading API Configuration variable

slide-28
SLIDE 28

Identify PerfOps

  • Latency related
  • Sleep(), lock(), IO, etc.
  • Memory related
  • new byte[], List.add(), etc.

28

int sortmb = job.getInt(“io.sort.mb”); int maxUsage = sortmb * 1024 * 1024; buffer = new Byte[maxUsage]; Memory Intensive Operation

slide-29
SLIDE 29

Identify PerfConf

If a PerfOp depends on the Configuration Variable, ...

29

int sortmb = job.getInt(“io.sort.mb”); int maxUsage = sortmb * 1024 * 1024; buffer = new Byte[maxUsage]; List of PerfConf

  • io.sort.mb
slide-30
SLIDE 30

Categorize PerfConf-PerfOp dependency

  • Data Dependency Pattern

– Conf used in the parameter of the PerfOp

  • If Pattern

– Conf used in an if-predicate

  • Loop Pattern

– Conf used in a loop-exit condition

30

int sortmb = job.getInt(“io.sort.mb”); int maxUsage = sortmb * 1024 * 1024; buffer = new Byte[maxUsage];

Pattern: Data Dependency

slide-31
SLIDE 31

Pattern-Specific Analysis

31

PerfConf - PerfOp Identification Pattern Analysis Pattern- specific Analysis LearnConf PerfConf- PerfOp pair Binary Performance Properties List of PerfConf

  • iosort.mb
  • io.sort.factor
  • handler.count…
  • input.buffer
  • indexcache.mb

Pattern: Data Dependency

  • Pat. Spe. Properties:
  • User request: MapTask
  • Linear: Yes
  • Slope: 1024 * 1024
  • Range effect: No
  • Related PerfConf: No
  • Monotonic: Yes

int sortmb = job.getInt(“io.sort.mb”); int maxUsage = sortmb * 1024 * 1024; buffer = new Byte[maxUsage];

slide-32
SLIDE 32

32

  • Understanding
  • Tool design
  • Evaluation
slide-33
SLIDE 33

Methodology

  • Benchmarks

– Four widely used distributed systems – Each contains around 100~150 configurations

33

slide-34
SLIDE 34

Identify Correct PerfConf

  • Correctly identify 60 out of 71 true PerfConfs
  • 9 false positives
  • 4 true PerfConfs not in previous work that can

lead to OOM or timeout failures!

Identified False Positive False Negative MapReduce 16 1 7 HBase 19 1 2 HDFS 13 5 1 Cassandra 21 2 1 Total 69 9 11

34

UNION of tutorials and papers

slide-35
SLIDE 35

Identify Correct Pattern

35

200 400 600 200 400 600

Memory(MB) Configuration(sortMB)

1 2 100 200 300 400

usage< buffer_size usage> buffer_size

Latency(ms) Request

30 60 90 120 2 4 6 8 10 12

Latency(ms) Request

2 4 6 8 10 0.1 0.2 0.3 0.4 0.5

Worst Latency(s) Configuration(lowerLimit)

5 10 15 20 25 20 40 60 80 100 120 140

Job Latency(s) Configuration(splitSize)

20 40 60 80 100 10 20 30 40 50

Latency(ms) Request

40 80

5 10

Latency(ms) Request

20 40 60 80 5 10 15 20

HeartBeat Cost(ms) Time

  • 25
  • 20
  • 15
  • 10
  • 5

5 10 200 400 600 800 1000

∆ Memory(MB) Request

Mem Flush

slide-36
SLIDE 36

More Result

  • Input Analysis
  • Slope Analysis
  • Configuration Setting Range Analysis
  • Configuration Relation Analysis
  • Monotonicity Analysis
  • Applying LearnConf for Performance Tuning

36

More results in the paper

slide-37
SLIDE 37

Conclusion

37

Chi Li lichi@uchicago.edu

Thanks Data Dependency Control Dependency If Related Loop Related Loop Bound Loop Stride

  • Sync. Loop

Infinite Loop Unrelated Bouncy Approaching Constant