|
1 | 1 | # Distributed DataFusion Benchmarks |
2 | 2 |
|
3 | | -### Generating tpch data |
| 3 | +### Generating TPCH data |
4 | 4 |
|
5 | 5 | Generate TPCH data into the `data/` dir |
6 | 6 |
|
7 | 7 | ```shell |
8 | 8 | ./gen-tpch.sh |
9 | 9 | ``` |
10 | 10 |
|
11 | | -### Running tpch benchmarks |
| 11 | +### Running TPCH benchmarks in single-node mode |
12 | 12 |
|
13 | | -After generating the data with the command above: |
| 13 | +After generating the data with the command above, the benchmarks can be run with |
14 | 14 |
|
15 | 15 | ```shell |
16 | | -cargo run -p datafusion-distributed-benchmarks --release -- tpch --path benchmarks/data/tpch_sf1 |
| 16 | +cargo run -p datafusion-distributed-benchmarks --release -- tpch |
| 17 | +``` |
| 18 | + |
| 19 | +For preloading the TPCH data in-memory, the `-m` flag can be passed |
| 20 | + |
| 21 | +```shell |
| 22 | +cargo run -p datafusion-distributed-benchmarks --release -- tpch -m |
| 23 | +``` |
| 24 | + |
| 25 | +For running the benchmarks with using just a specific amount of physical threads: |
| 26 | + |
| 27 | +```shell |
| 28 | +cargo run -p datafusion-distributed-benchmarks --release -- tpch -m --threads 3 |
| 29 | +``` |
| 30 | + |
| 31 | +### Running TPCH benchmarks in distributed mode |
| 32 | + |
| 33 | +Running the benchmarks in distributed mode implies: |
| 34 | + |
| 35 | +- running 1 or more workers in separate terminals |
| 36 | +- running the benchmarks in an additional terminal |
| 37 | + |
| 38 | +The workers can be spawned by passing the `--spawn <port>` flag, for example, for spawning 3 workers: |
| 39 | + |
| 40 | +```shell |
| 41 | +cargo run -p datafusion-distributed-benchmarks --release -- tpch --spawn 8000 |
| 42 | +``` |
| 43 | + |
| 44 | +```shell |
| 45 | +cargo run -p datafusion-distributed-benchmarks --release -- tpch --spawn 8001 |
| 46 | +``` |
| 47 | + |
| 48 | +```shell |
| 49 | +cargo run -p datafusion-distributed-benchmarks --release -- tpch --spawn 8002 |
| 50 | +``` |
| 51 | + |
| 52 | +With the three workers running in separate terminals, the TPCH benchmarks can be run in distributed mode with: |
| 53 | + |
| 54 | +```shell |
| 55 | +cargo run -p datafusion-distributed-benchmarks --release -- tpch --workers 8000,8001,8002 |
| 56 | +``` |
| 57 | + |
| 58 | +A good way of measuring the impact of distribution is to limit the physical threads each worker can use. For example, |
| 59 | +it's expected that running 8 workers with 2 physical threads each one (8 * 2 = 16 total) is faster than running in |
| 60 | +single-node with just 2 threads (1 * 3 = 2 total). |
| 61 | + |
| 62 | +```shell |
| 63 | +cargo run -p datafusion-distributed-benchmarks --release -- tpch -m --threads 2 --spawn 8000 & |
| 64 | +cargo run -p datafusion-distributed-benchmarks --release -- tpch -m --threads 2 --spawn 8001 & |
| 65 | +cargo run -p datafusion-distributed-benchmarks --release -- tpch -m --threads 2 --spawn 8002 & |
| 66 | +cargo run -p datafusion-distributed-benchmarks --release -- tpch -m --threads 2 --spawn 8003 & |
| 67 | +cargo run -p datafusion-distributed-benchmarks --release -- tpch -m --threads 2 --spawn 8004 & |
| 68 | +cargo run -p datafusion-distributed-benchmarks --release -- tpch -m --threads 2 --spawn 8005 & |
| 69 | +cargo run -p datafusion-distributed-benchmarks --release -- tpch -m --threads 2 --spawn 8006 & |
| 70 | +cargo run -p datafusion-distributed-benchmarks --release -- tpch -m --threads 2 --spawn 8007 & |
| 71 | +``` |
| 72 | + |
| 73 | +```shell |
| 74 | +cargo run -p datafusion-distributed-benchmarks --release -- tpch -m --threads 2 --workers 8000,8001,8002,8003,8004,8005,8006,8007 |
| 75 | +``` |
| 76 | + |
| 77 | +The `run.sh` script already does this for you in a more ergonomic way: |
| 78 | + |
| 79 | +```shell |
| 80 | +WORKERS=8 run.sh --threads 2 -m |
17 | 81 | ``` |
0 commit comments