Skip to content

Commit fb7b8c5

Browse files
authored
Update benchmarks in README.md and make ballista work (#557)
Makes ballista work for tpch sf100 and updates the charts in the benchmarks
1 parent 0f5cf3b commit fb7b8c5

9 files changed

Lines changed: 60 additions & 22 deletions

File tree

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -49,12 +49,12 @@ relative to DataFusion Distributed
4949
<details>
5050
<summary>Per-dataset totals</summary>
5151

52-
| Dataset | df-dist | Ballista | Spark | Trino | Queries compared |
53-
|-------------|--------:|----------------------------------------------------------------------------------------:|------:|------:|-----------------:|
54-
| TPC-H SF1 | **7s** | 11s | 30s | 18s | 22 |
55-
| TPC-H SF10 | **10s** | 57s | 51s | 33s | 22 |
56-
| TPC-H SF100 | **42s** | N/A ([#1836](https://github.com/datafusion-contrib/datafusion-distributed/issues/1836)) | 261s | 93s | 19 |
57-
| TPC-DS SF1 | **29s** | 72s | 101s | 85s | 67 |
52+
| Dataset | df-dist | Ballista | Spark | Trino | Queries compared |
53+
|-------------|--------:|---------:|------:|------:|-----------------:|
54+
| TPC-H SF1 | **7s** | 11s | 30s | 18s | 22 |
55+
| TPC-H SF10 | **10s** | 42s | 51s | 33s | 22 |
56+
| TPC-H SF100 | **42s** | 237s | 261s | 93s | 19 |
57+
| TPC-DS SF1 | **29s** | 72s | 101s | 85s | 67 |
5858

5959
![TPC-H SF1](./docs/source/_static/images/tpch_sf1.png)
6060
![TPC-H SF10](./docs/source/_static/images/tpch_sf10.png)

benchmarks/cdk/ballista/src/ballista_http.rs

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,10 @@ struct Cmd {
3131
/// The bucket name.
3232
#[structopt(long, default_value = "datafusion-distributed-benchmarks")]
3333
bucket: String,
34+
35+
/// Number of partitions used for scans and distributed shuffle stages.
36+
#[structopt(long, default_value = "96")]
37+
target_partitions: usize,
3438
}
3539

3640
#[tokio::main]
@@ -59,7 +63,13 @@ async fn main() -> Result<(), Box<dyn Error>> {
5963
let runtime_env = Arc::new(RuntimeEnv::default());
6064
runtime_env.register_object_store(&s3_url, s3);
6165

62-
let config = SessionConfig::new_with_ballista().with_ballista_job_name("Benchmarks");
66+
info!(
67+
"Configuring Ballista with {} target partitions",
68+
cmd.target_partitions
69+
);
70+
let config = SessionConfig::new_with_ballista()
71+
.with_ballista_job_name("Benchmarks")
72+
.with_target_partitions(cmd.target_partitions);
6373

6474
let state = SessionStateBuilder::new()
6575
.with_config(config)

benchmarks/cdk/lib/ballista.ts

Lines changed: 31 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@ let ballistaExecutorBinary: s3assets.Asset
1616

1717
// Ballista is built as a standalone project, separate from the main workspace
1818
const BALLISTA_DIR = path.join(ROOT, 'benchmarks/cdk/ballista')
19+
const BALLISTA_TARGET_PARTITIONS = 96 // 12 c5n.2xlarge instances * 8 vCPUs
20+
const BALLISTA_EXECUTOR_MEMORY_POOL = '16GiB' // leave ~4 GiB for the OS and untracked allocations
21+
const BALLISTA_JOB_DATA_CLEAN_UP_INTERVAL_SECONDS = 300
22+
const BALLISTA_JOB_DATA_TTL_SECONDS = 3600
1923

2024
export const BALLISTA_ENGINE: QueryEngine = {
2125
beforeEc2Machines(ctx: BeforeEc2MachinesContext): void {
@@ -95,7 +99,10 @@ ExecStart=/usr/local/bin/ballista-executor \\
9599
--bind-port 50051 \\
96100
--work-dir /var/ballista/executor \\
97101
--scheduler-host localhost \\
98-
--scheduler-port 50050
102+
--scheduler-port 50050 \\
103+
--memory-pool-size ${BALLISTA_EXECUTOR_MEMORY_POOL} \\
104+
--job-data-clean-up-interval-seconds ${BALLISTA_JOB_DATA_CLEAN_UP_INTERVAL_SECONDS} \\
105+
--job-data-ttl-seconds ${BALLISTA_JOB_DATA_TTL_SECONDS}
99106
Restart=on-failure
100107
RestartSec=5
101108
User=root
@@ -118,7 +125,9 @@ After=network.target ballista-scheduler.service
118125
Requires=ballista-scheduler.service
119126
[Service]
120127
Type=simple
121-
ExecStart=/usr/local/bin/ballista-http --bucket ${ctx.bucketName}
128+
ExecStart=/usr/local/bin/ballista-http \\
129+
--bucket ${ctx.bucketName} \\
130+
--target-partitions ${BALLISTA_TARGET_PARTITIONS}
122131
Restart=on-failure
123132
RestartSec=5
124133
User=root
@@ -159,11 +168,13 @@ BALLISTA_EOF`
159168

160169
// Reconfigure executors on worker nodes to point to scheduler. The executor in the machine holding the scheduler
161170
// communicates to it using localhost, so no need to update it with scheduler.instancePrivateIp.
162-
sendCommandsUnconditionally(
171+
const updateExecutors = sendCommandsUnconditionally(
163172
ctx.scope,
164173
"ConfigureBallistaExecutors",
165174
[scheduler, ...executors],
166175
[
176+
`aws s3 cp s3://${ballistaExecutorBinary.s3BucketName}/${ballistaExecutorBinary.s3ObjectKey} /usr/local/bin/ballista-executor`,
177+
'chmod +x /usr/local/bin/ballista-executor',
167178
`cat > /etc/systemd/system/ballista-executor.service << 'BALLISTA_EOF'
168179
[Unit]
169180
Description=Ballista Executor
@@ -175,7 +186,10 @@ ExecStart=/usr/local/bin/ballista-executor \\
175186
--bind-port 50051 \\
176187
--work-dir /var/ballista/executor \\
177188
--scheduler-host ${scheduler.instancePrivateIp} \\
178-
--scheduler-port 50050
189+
--scheduler-port 50050 \\
190+
--memory-pool-size ${BALLISTA_EXECUTOR_MEMORY_POOL} \\
191+
--job-data-clean-up-interval-seconds ${BALLISTA_JOB_DATA_CLEAN_UP_INTERVAL_SECONDS} \\
192+
--job-data-ttl-seconds ${BALLISTA_JOB_DATA_TTL_SECONDS}
179193
Restart=on-failure
180194
RestartSec=5
181195
User=root
@@ -187,8 +201,21 @@ StandardError=append:/var/ballista/logs/executor.log
187201
WantedBy=multi-user.target
188202
BALLISTA_EOF`,
189203
'systemctl daemon-reload',
204+
'systemctl enable --now ballista-executor',
190205
'systemctl restart ballista-executor',
191206
]
192207
)
208+
209+
const updateHttp = sendCommandsUnconditionally(
210+
ctx.scope,
211+
"UpdateBallistaHttp",
212+
[scheduler],
213+
[
214+
`aws s3 cp s3://${ballistaServerBinary.s3BucketName}/${ballistaServerBinary.s3ObjectKey} /usr/local/bin/ballista-http`,
215+
'chmod +x /usr/local/bin/ballista-http',
216+
'systemctl restart ballista-http',
217+
]
218+
)
219+
updateHttp.node.addDependency(updateExecutors)
193220
}
194221
}

benchmarks/cdk/lib/cdk-stack.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ export function sendCommandsUnconditionally(
219219
name: string,
220220
instances: ec2.Instance[],
221221
commands: string[]
222-
) {
222+
): cr.AwsCustomResource {
223223
const cmd = new cr.AwsCustomResource(construct, name, {
224224
onUpdate: {
225225
service: 'SSM',
@@ -247,4 +247,5 @@ export function sendCommandsUnconditionally(
247247

248248
// Ensure instances are created before restarting
249249
cmd.node.addDependency(...instances)
250+
return cmd
250251
}
Lines changed: 2 additions & 2 deletions
Loading
Lines changed: 2 additions & 2 deletions
Loading
Lines changed: 2 additions & 2 deletions
Loading
Lines changed: 2 additions & 2 deletions
Loading
Lines changed: 2 additions & 2 deletions
Loading

0 commit comments

Comments
 (0)