Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Benchmark improvements #1996

Merged
merged 5 commits into from
Sep 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,10 @@ services:
k6:
volumes:
- ./scripts:/scripts
image: grafana/k6
image: keboolabot/stream-benchmark
build:
context: .
dockerfile: ./provisioning/stream/docker/k6/Dockerfile
network_mode: host
ulimits:
nofile:
Expand Down
4 changes: 2 additions & 2 deletions internal/pkg/service/stream/config/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ storage:
size: 50MB
# Duration from the last import to trigger the next import. Validation rules: required,minDuration=60s,maxDuration=24h
interval: 15m0s
# Number of slices in the file to trigger file import. Validation rules: required,min=1,max=50000
# Number of slices in the file to trigger file import. Validation rules: required,min=1,max=1000
slicesCount: 100
# Min remaining expiration to trigger file import. Validation rules: required,minDuration=5m,maxDuration=45m
expiration: 30m0s
Expand Down Expand Up @@ -583,7 +583,7 @@ func TestTableSinkConfigPatch_ToKVs(t *testing.T) {
"defaultValue": 100,
"overwritten": false,
"protected": true,
"validation": "required,min=1,max=50000"
"validation": "required,min=1,max=1000"
}
]
`), strings.TrimSpace(json.MustEncodeString(kvs, true)))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ type ImportTrigger struct {
Count uint64 `json:"count" configKey:"count" configUsage:"Records count to trigger file import." modAllowed:"true" validate:"required,min=1,max=10000000"`
Size datasize.ByteSize `json:"size" configKey:"size" configUsage:"Records size to trigger file import." modAllowed:"true" validate:"required,minBytes=100B,maxBytes=500MB"`
Interval duration.Duration `json:"interval" configKey:"interval" configUsage:"Duration from the last import to trigger the next import." modAllowed:"true" validate:"required,minDuration=60s,maxDuration=24h"`
SlicesCount uint64 `json:"slicesCount" configKey:"slicesCount" configUsage:"Number of slices in the file to trigger file import." validate:"required,min=1,max=50000"`
SlicesCount uint64 `json:"slicesCount" configKey:"slicesCount" configUsage:"Number of slices in the file to trigger file import." validate:"required,min=1,max=1000"`
Expiration duration.Duration `json:"expiration" configKey:"expiration" configUsage:"Min remaining expiration to trigger file import." validate:"required,minDuration=5m,maxDuration=45m"`
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ func TestConfig_Validation(t *testing.T) {
- "import.trigger.count" must be 10,000,000 or less
- "import.trigger.size" must be 500MB or less
- "import.trigger.interval" must be 24h0m0s or less
- "import.trigger.slicesCount" must be 50,000 or less
- "import.trigger.slicesCount" must be 1,000 or less
- "import.trigger.expiration" must be 45m0s or less
`,
Value: overMaximumCfg,
Expand Down
3 changes: 3 additions & 0 deletions provisioning/common/etcd/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,9 @@ extraEnvVars:
# GOMEMLIMIT to prevent OOM kill, update the value together with "resources" spec.
- name: GOMEMLIMIT
value: "256MiB"
# Increase limit of operations in transaction.
- name: ETCD_MAX_TXN_OPS
value: "1000"
Comment on lines +62 to +64
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We tried slicesCount 50000 which caused ETCD transactions to fail because they were trying to do 50k operations in one transaction while the limit was 128. So we're increasing the limit of transaction operations and lowering SlicesCount limit accordingly.


# The root password is used for authentication, the client gets a JWT token with short expiration.
auth:
Expand Down
2 changes: 1 addition & 1 deletion provisioning/stream/docker/k6/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
FROM grafana/k6:0.52.0
FROM grafana/k6:0.53.0

COPY scripts /scripts
1 change: 1 addition & 0 deletions provisioning/stream/kubernetes/benchmark.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ cd "$(dirname "$0")"

# TODO: if we want to push
#docker login --username keboolabot --password $DOCKER_REGISTRY_PASSWORD docker.io
#docker compose build k6
#docker push keboolabot/stream-benchmark:latest
#docker logout

Expand Down
5 changes: 3 additions & 2 deletions provisioning/stream/kubernetes/templates/benchmark/job.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ metadata:
labels:
app: stream-benchmark
spec:
backoffLimit: 0
template:
metadata:
labels:
Expand Down Expand Up @@ -52,7 +53,7 @@ spec:
- name: K6_STATSD_ENABLE_TAGS
value: "true"
- name: K6_PARALLEL_REQS_PER_USER
value: "10"
value: "100"
- name: K6_SCENARIO
value: "ramping"
- name: K6_CONST_VIRTUAL_USERS
Expand All @@ -62,7 +63,7 @@ spec:
- name: K6_CONST_TIMEOUT
value: "20m"
- name: K6_RAMPING_MAX_VIRTUAL_USERS
value: "1000"
value: "100"
- name: K6_RAMPING_UP_DURATION
value: "2m"
- name: K6_RAMPING_STABLE_DURATION
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ data:
size: 50MB
# Duration from the last import to trigger the next import. Validation rules: required,minDuration=60s,maxDuration=24h
interval: 15m0s
# Number of slices in the file to trigger file import. Validation rules: required,min=1,max=50000
# Number of slices in the file to trigger file import. Validation rules: required,min=1,max=1000
slicesCount: 100
# Min remaining expiration to trigger file import. Validation rules: required,minDuration=5m,maxDuration=45m
expiration: 30m0s
4 changes: 2 additions & 2 deletions scripts/k6/stream-api/common.js
Original file line number Diff line number Diff line change
Expand Up @@ -176,8 +176,8 @@ export function stripUrlHost(url) {
}

export function teardownSource(sourceId) {
console.info("waiting 50s before source deletion")
sleep(50)
console.info("waiting 12s before source deletion")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
console.info("waiting 12s before source deletion")
console.info("waiting 120s before source deletion")

sleep(120)
const res = del(`v1/branches/default/sources/${sourceId}`);
if (res.status !== 202) {
console.error(res);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@
"defaultValue": 100,
"overwritten": false,
"protected": true,
"validation": "required,min=1,max=50000"
"validation": "required,min=1,max=1000"
}
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@
"defaultValue": 100,
"overwritten": false,
"protected": true,
"validation": "required,min=1,max=50000"
"validation": "required,min=1,max=1000"
}
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@
"defaultValue": 100,
"overwritten": false,
"protected": true,
"validation": "required,min=1,max=50000"
"validation": "required,min=1,max=1000"
}
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@
"defaultValue": 100,
"overwritten": false,
"protected": true,
"validation": "required,min=1,max=50000"
"validation": "required,min=1,max=1000"
}
]
}
Loading