Debian Codegraph @

docs/benchmark.md

raw symbols SCIP
1 # Benchmarking SOCI snapshotter
2
3 This document walks through how to run the SOCI snapshotter benchmarks, including running the benchmarks on default and custom workloads.
4
5 There are two types of benchmarks:
6
7 ```Performance benchmarks```: The performance benchmark focuses on measuring various metrics using the soci snapshotter.
8
9 ```Comparison benchmarks```: Runs benchmark tests with soci snapshotter and then the same tests with overlayFS snapshotter. We can use these results to compare the difference in performance between the two.
10
11 - [Prerequisites](#prerequisites)
12 - [Running benchmarks on default workloads](#running-benchmarks-on-default-workloads)
13 - [Running benchmarks on custom workloads](#running-benchmarks-on-custom-workloads)
14 - [Benchmark binaries cli flags](#benchmark-binaries-have-different-cli-flags)
15 - [Csv file format for custom workloads](#csv-file-format-for-custom-workloads)
16 - [Default workloads](#default-workloads)
17 - [Benchmark results format](#benchmark-results)
18
19 ## Prerequisites
20
21 Follow the [Getting started guide](/docs/getting-started.md) and complete setting up the project.
22
23
24 ## Running benchmarks on default workloads
25
26 There a set of [8 workloads](#default-custom-workloads) that are included in the benchmark binaries that can readily be benchmarked without any additional setup.
27 These workloads are hosted on a public ECR repository and hence do not need any credentials.
28
29 ```make benchmarks``` - Runs both the Performance and Comparison benchmark tests on the workloads 5 times
30
31 ```make benchmarks-perf-test``` - Runs only the Performance benchmark tests on the workloads 5 times
32
33 ## Running benchmarks on custom workloads
34
35 Custom workloads can also be benchmarked with SOCI.
36
37 In order to run the benchmarks on custom workloads the custom container image needs to have its soci indices generated and pushed to a contianer registry as described in the [Getting started docs](/docs/getting-started.md)
38
39 Generate benchmark binaries:
40 ``` make build-benchmarks``` will generate benchmark binaries for performance testing and comparison testing against overlayFS. The binaries will be available in the ```/benchmark/bin``` folder.
41
42 ### Benchmark binaries have different cli flags:
43
44 | Flag | Description | Required / Optional |
45 |----------|----------|----------|
46 | ```-f``` | File path to a csv file containing details of multiple images to be tested | Optional
47 | ```-count``` | Specify number of times the benchmarker needs to run | Optional
48 | ```-show-commit``` | Tag the latest commit hash to the benchmark results | Optional
49
50 We can now run benchmarks on custom workloads using the ```-f``` flag to specify the file path to a csv file containing details of the workloads.
51
52 ### Csv file format for custom workloads
53
54 Ensure that the file being used with the ```-f``` flag follows the following format
55
56 ```shell
57 <Test_name>, <Container_Image_ref>, <Ready_line>, <Soci_Index_Manifest_Digest>
58 ```
59
60 Example :
61
62 ```shell
63 ffmpeg, public.ecr.aws/soci-workshop-examples/ffmpeg:latest, "Hello World",ef63578971ebd8fc700c74c96f81dafab4f3875e9117ef3c5eb7446e169d91cb
64 ```
65
66 ### Default workloads
67
68 | Name | ECR Repository/Tag | Description | Size |
69 |------------------|----------------------|---------------------------|------------|
70 | ffmpeg | public.ecr.aws/soci-workshop-examples/ffmpeg:latest | A minimalist Docker image converting a video file format using ffmpeg. | Medium(~600MB) |
71 | tensor_flow_gpu | public.ecr.aws/soci-workshop-examples/tensorflow_gpu:latest | Software library for machine learning and artificial intelligence with nvidia CUDA drivers installed | Large (> 1GB) |
72 | tensor_flow | public.ecr.aws/soci-workshop-examples/tensorflow:latest | Software library for machine learning and artificial intelligence | Medium (~600MB) |
73 | NodeJs | public.ecr.aws/soci-workshop-examples/node:latest | Back-end JavaScript runtime environment | Large (~1GB) |
74 | busybox | public.ecr.aws/soci-workshop-examples/busybox:latest | Unix utilities suite. | Small (~2MB) |
75 | MongoDb | public.ecr.aws/soci-workshop-examples/mongo:latest | MongoDB is a source-available cross-platform document-oriented database program. | Medium (~700MB) |
76 | RabbitMQ | public.ecr.aws/soci-workshop-examples/rabbitmq:latest | RabbitMQ is an open-source message-broker software | Small (~100MB) |
77 | Redis | public.ecr.aws/soci-workshop-examples/redis:latest | Redis is an in-memory data structure store, used as a distributed, in-memory key–value database, cache and message broker, with optional durability. | Small (~50MB) |
78
79 ### Benchmark results
80 The benchmark tests generate results of various metrics, the results also provide statistics like mean, standard deviation, p25,p50, p75 and p90 (90th percentile) alongside the min and max value calculated. All measured times are in seconds.
81
82 Results are available in the ```/benchmark/<test_type>/output ```folder in the following format
83 ```shell
84 {
85 "commit": "commit_hash",
86 "benchmarkTests": [
87 {
88 "testName": "Image-name",
89 "numberOfTests": 1,
90 "fullRunStats": {
91 "BenchmarkTimes": [
92 39.098384883
93 ],
94 "stdDev": 0,
95 "mean": 39.098384883,
96 "min": 39.098384883,
97 "pct25": 39.098384883,
98 "pct50": 39.098384883,
99 "pct75": 39.098384883,
100 "pct90": 39.098384883,
101 "max": 39.098384883
102 },
103 "pullStats": {
104 "BenchmarkTimes": [
105 38.801
106 ],
107 "stdDev": 0,
108 "mean": 38.801,
109 "min": 38.801,
110 "pct25": 38.801,
111 "pct50": 38.801,
112 "pct75": 38.801,
113 "pct90": 38.801,
114 "max": 38.801
115 },
116 "lazyTaskStats": {
117 "BenchmarkTimes": [
118 0.009
119 ],
120 "stdDev": 0,
121 "mean": 0.009,
122 "min": 0.009,
123 "pct25": 0.009,
124 "pct50": 0.009,
125 "pct75": 0.009,
126 "pct90": 0.009,
127 "max": 0.009
128 },
129 "localTaskStats": {
130 "BenchmarkTimes": [
131 0.009
132 ],
133 "stdDev": 0,
134 "mean": 0.009,
135 "min": 0.009,
136 "pct25": 0.009,
137 "pct50": 0.009,
138 "pct75": 0.009,
139 "pct90": 0.009,
140 "max": 0.009
141 }
142 }
143 ]
144 }
145 ```