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

Performance test for large state and stable performance #13121

Merged
merged 8 commits into from
Jun 14, 2023

Conversation

Zelldon
Copy link
Member

@Zelldon Zelldon commented Jun 14, 2023

Description

@oleschoenburg I created this PR in order to get the first increment merged and to not overwhelm you with more changes. Most of the changes here are refactorings and preparation for the JMH test, plus of course the JMH test itself.

I applied already several things we have discussed, like creation of large state in setup phase, keeping the test in engine module etc. In an upcoming PR I will execute the JMH benchmark inside a unit test, which is executed in a separate CI job, please see related comment.

Related issues

related to #12241

@Zelldon Zelldon force-pushed the zell-performance-test-engine branch 2 times, most recently from 270a515 to 0ffbbe4 Compare June 14, 2023 09:48
In order to be able to easily exchange or replace the StreamProcessorRule a new interface is introduced, which abstracts the writing
of commands away. The implementation can be completelty separated and change without breaking the test clients.
Extract class ProcessingExporterTransistor from EngineRule in order to be used by Performance Test
Create TestInterPartitionCommandSender.java in util package, in order to be used
by both EngineRule and performance tests.
@Zelldon Zelldon force-pushed the zell-performance-test-engine branch from 0ffbbe4 to 50f23ca Compare June 14, 2023 11:37
@Zelldon
Copy link
Member Author

Zelldon commented Jun 14, 2023

Example execution with main

 [] INFO  io.camunda.zeebe.engine.perf.EngineLargeStatePerformanceTest - Started 250443 process instances

Result "io.camunda.zeebe.engine.perf.EngineLargeStatePerformanceTest.measureProcessExecutionTime":
  824.767 ±(99.9%) 43.550 ops/s [Average]
  (min, avg, max) = (527.173, 824.767, 948.155), stdev = 87.973
  CI (99.9%): [781.217, 868.317] (assumes normal distribution)


# Run complete. Total time: 00:03:42

Benchmark                                                     Mode  Cnt    Score    Error  Units
EngineLargeStatePerformanceTest.measureProcessExecutionTime  thrpt   50  824.767 ± 43.550  ops/s

@Zelldon Zelldon marked this pull request as ready for review June 14, 2023 11:43
@Zelldon
Copy link
Member Author

Zelldon commented Jun 14, 2023

Example with SST partitioning disabled

[] INFO  io.camunda.zeebe.engine.perf.EngineLargeStatePerformanceTest - Started 209132 process instances

Result "io.camunda.zeebe.engine.perf.EngineLargeStatePerformanceTest.measureProcessExecutionTime":
  150.361 ±(99.9%) 2.380 ops/s [Average]
  (min, avg, max) = (139.649, 150.361, 157.587), stdev = 4.809
  CI (99.9%): [147.980, 152.741] (assumes normal distribution)


Benchmark                                                     Mode  Cnt    Score   Error  Units
EngineLargeStatePerformanceTest.measureProcessExecutionTime  thrpt   50  150.361 ± 2.380  ops/s

* use separated ProcessingExporterTransistor
* use separated TestInterPartitionCommandSender.java
* remove unused ReprocessingCompletedListener
Create new JMH test in order to verify stable performance on large state.

 * Create helper class TestEngine.java in order to simplify and encapsulate the engine setup.
 * Create record TestContext.java which contains infrastructure related dependencies, which might be shared by multiple engines.
 * Add JMH benchmark which allows to measure how the throughput looks like of process instance creation.
 * Use Seconds as output unit, for better representation and understandability
 * Use measure timeunit seconds this means the creation of PI is tried as often as possible in one second
 * Increase warm up and measure iterations
 * Reset the RecordingExporter in between, in order to avoid slowing down the benchmark
 * State is created on setup, to make sure we always create the same amount of data
@Zelldon Zelldon force-pushed the zell-performance-test-engine branch from 50f23ca to a53aa52 Compare June 14, 2023 12:01
@lenaschoenburg lenaschoenburg self-requested a review June 14, 2023 14:40
Copy link
Member

@lenaschoenburg lenaschoenburg left a comment

Choose a reason for hiding this comment

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

Great job @Zelldon 🚀

Most of my comments are a bit nit-picky and actually unrelated to the JMH benchmark.

❓ I was only able to run these once through IntelliJ, every run after the first is seemingly stuck in the warmup phase. I guess that's not the case for you?

@Zelldon
Copy link
Member Author

Zelldon commented Jun 14, 2023

bors r+

/**
* Containing infrastructure related dependencies which might be shared between TestEngines.
*
* @param actorScheduler the scheduler which is used during tests

Check notice

Code scanning / CodeQL

Spurious Javadoc @param tags Note

@param tag "actorScheduler" does not match any actual type parameter of type "TestContext".
* Containing infrastructure related dependencies which might be shared between TestEngines.
*
* @param actorScheduler the scheduler which is used during tests
* @param temporaryFolder the temporary folder where the log and runtime is written to

Check notice

Code scanning / CodeQL

Spurious Javadoc @param tags Note

@param tag "temporaryFolder" does not match any actual type parameter of type "TestContext".
*
* @param actorScheduler the scheduler which is used during tests
* @param temporaryFolder the temporary folder where the log and runtime is written to
* @param autoCloseableRule a collector of all to managed resources, which should be cleaned up

Check notice

Code scanning / CodeQL

Spurious Javadoc @param tags Note

@param tag "autoCloseableRule" does not match any actual type parameter of type "TestContext".
@zeebe-bors-camunda
Copy link
Contributor

Build succeeded:

@zeebe-bors-camunda zeebe-bors-camunda bot merged commit 6051e2c into main Jun 14, 2023
28 of 30 checks passed
@zeebe-bors-camunda zeebe-bors-camunda bot deleted the zell-performance-test-engine branch June 14, 2023 18:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants