Skip to content

perf: add configurable benchmarks - #681

Open
kamenkremen wants to merge 2 commits into
masterfrom
gh-587-perf-test
Open

kamenkremen wants to merge 2 commits into
masterfrom
gh-587-perf-test

Conversation

@kamenkremen

@kamenkremen kamenkremen commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

Comment thread perf/lib/cluster.lua
end
-- Tarantool 2.11's popen:wait() ignores timeout options.
-- Give all children one grace period; close() kills those still alive.
local deadline = clock.monotonic() + 3

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Tarantool only waits 3 seconds for on_shutdown callbacks by default, so this 3-second grace period can use up the whole budget. I reproduced this with SIGTERM: the callback timed out before saving Interrupted, leaving Connection closed in the report. Could we set box.ctl.set_on_shutdown_timeout(10) before registering the callback? That fixed the repro for me.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done

@Serpentian Serpentian left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Great stuff

Comment thread .github/workflows/performance.yml Outdated
types: [opened, reopened, synchronize, labeled]
workflow_dispatch:
schedule:
- cron: '0 1 * * *'

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Comment please, not everyone can parse the cron syntax that easy

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done

with:
path: /home/runner/tnt-release
key: cache-tnt-${{ inputs.tarantool_version }}${{ env.VERSION_POSTFIX }}
key: cache-tnt-${{ runner.environment }}-${{ inputs.tarantool_version }}${{ env.VERSION_POSTFIX }}

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This change is not related to perf test, let's put it in separate commit: we're trying to distinguish github-hosted from self-hosted

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done

tarantool perf/export.lua \
--input-dir perf/output/ci \
--output perf/output/summary.txt
- name: Send results to InfluxDB

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I didn't manage to find the dashboard on grafana, let's add the link to PR description

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done

@@ -0,0 +1,128 @@
name: performance

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This workflow is great, but I don't think it's enough, since we won't be able to see the perf degradation compared to master: it runs after merge or with performance tag in PR, which won't be used that often. So, we'll notice, that perf degraded only after merging to master, not good.

Can we also introduce the workflow, which will run on github runners: take master, run several times, take the mean, take branch, run several times, take the mean, compare them, if master has at least 5% more rps than branch, fail the workflow, again: router overload + storage overload.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done

Comment thread perf/run.lua
local util = require('perf.lib.util')

local help = [[
Usage: tarantool perf/run.lua [options]

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Unfortunately, the desktop computers (or github runners) are not as stable as perfomance machine. So, please, let's introduce the option to run it several times and get the mean perf after that

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done

Comment thread perf/export.lua Outdated

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Let's avoid introducing newly generated tools, when we already have well-written and tested one in tarantool. In this case we can take the aggregate.lua from there. It'll also force us to have the similar output layout to tarantool

And let's also put it inside tools dir. And let's try to be as consistent with tarantool's perf testing as possible, in CI too

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done

name: performance-${{ matrix.scenario }}
retention-days: 21
path: perf/output/
if-no-files-found: ignore

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Here're the differences with tarantool's CI, which I don't really like:

Host preparation Runs setup_env.sh: checks isolation/SMT and adjusts CPU frequency, turbo, ASLR, and huge-page settings No equivalent preparation step
CPU placement Fixed CPU mask for CPUs 1–24, with chrt 50 Reads isolated CPUs from sysfs, with chrt 50
Concurrency Cancels superseded developer-branch runs; preserves master/release/tag runs Preserves running jobs, groups by workflow/ref, serializes matrix scenarios
Export Uses perf/tools/aggregate.lua; generates InfluxDB data and analysis configuration Uses its own perf/export.lua; generates InfluxDB data
Analysis Downloads historical results and runs Otava No historical comparison or regression analysis

If we're going to use the setup_env.sh and aggregate.lua from Tarantool, maybe it's better to clone the repo in CI and use them explciitly without copy-pasting, they're not needed locally anyway

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done

Comment thread .github/workflows/performance.yml Outdated
- name: Setup Tarantool
uses: ./.github/actions/setup-tarantool
with:
tarantool_version: release-master

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

No way, we must use the pinned version, otherwise perf of tarantool's master will affect vshard's perf tests. Let's use the 3.9 release

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done

Comment thread perf/lib/workload.lua Outdated
local args, opts = {}, {timeout = cfg.rpc_timeout_seconds}
local buckets = cfg.bucket_count
local request = {0, 'perf.noop', args, opts}
if case == 'callrw_noop' then

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I don't think it has much sense in testing 2 rw requests. We should test callrw and callro, that's it

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done

Comment thread .github/workflows/performance.yml Outdated
max-parallel: 1
matrix:
include:
- scenario: baseline

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I'd stop on router/storage pressure to see the max possible perf of storage/router on that machine. Baseline seems useless

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done

@Serpentian Serpentian assigned kamenkremen and unassigned Serpentian Nov 20, 2026
Use separate cache keys for GitHub-hosted and self-hosted runners
to avoid restoring a build made for a different environment.

NO_DOC=ci
NO_TEST=ci
@kamenkremen
kamenkremen force-pushed the gh-587-perf-test branch 3 times, most recently from b654de3 to 3d6f9cf Compare November 21, 2026 23:50
Add callro_get and callrw_replace benchmarks with configurable storage,
router and load generator processes on a single host. Warm up each bucket
through every router before a shared 20-second measurement window.
Support repeated measurements and report their mean RPS.

Run router-pressure and storage-pressure configurations on the performance
runner with Tarantool 3.9.0. Run daily for commits without a previous
successful scheduled or manual run, on request, and for pull requests
with the performance label.

Use Tarantool's environment setup and result aggregation tools. Save JSON
results and logs as artifacts and send results to InfluxDB, except for
fork pull requests. Analyze performance history with Apache Otava.

Compare each pull request with its base revision on GitHub-hosted runners
using the same benchmarks and Tarantool version. Run three repetitions
per configuration and fail if base RPS is at least 5% higher.

Closes #587

NO_DOC=ci
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Setup performance tests in CI and report results to grafana

4 participants