Skip to content

Add cron job to trigger Java JMH micro-benchmarks weekly #23388

Merged
lukecwik merged 2 commits intoapache:masterfrom
mosche:22238_Java_Jmh_Cron
Sep 30, 2022
Merged

Add cron job to trigger Java JMH micro-benchmarks weekly #23388
lukecwik merged 2 commits intoapache:masterfrom
mosche:22238_Java_Jmh_Cron

Conversation

@mosche
Copy link
Copy Markdown
Member

@mosche mosche commented Sep 27, 2022

Add cron job to trigger Java JMH micro-benchmarks weekly on Sundays (addresses #22238).


Thank you for your contribution! Follow this checklist to help us incorporate your contribution quickly and easily:

  • Choose reviewer(s) and mention them in a comment (R: @username).
  • Mention the appropriate issue in your description (for example: addresses #123), if applicable. This will automatically add a link to the pull request in the issue. If you would like the issue to automatically close on merging the pull request, comment fixes #<ISSUE NUMBER> instead.
  • Update CHANGES.md with noteworthy changes.
  • If this contribution is large, please file an Apache Individual Contributor License Agreement.

See the Contributor Guide for more tips on how to make review process smoother.

To check the build health, please visit https://github.com/apache/beam/blob/master/.test-infra/BUILD_STATUS.md

GitHub Actions Tests Status (on master branch)

Build python source distribution and wheels
Python tests
Java tests
Go tests

See CI.md for more information about GitHub Actions CI.

@mosche mosche changed the title Add cron job to trigger Java JMH micro-benchmarks weekly [WIP] Add cron job to trigger Java JMH micro-benchmarks weekly Sep 27, 2022
@apilloud
Copy link
Copy Markdown
Member

Our default is to run jobs like this every 6 hours. What are the constraints that limit this to weekly?

(Also you need to run the seed job to get your Jenkins changes to load. I believe Run Seed Job worked in the past, but you might need to invoke it via the Jenkins UI.)

@mosche
Copy link
Copy Markdown
Member Author

mosche commented Sep 30, 2022

Run Seed Job

@mosche
Copy link
Copy Markdown
Member Author

mosche commented Sep 30, 2022

Run Java Jmh benchmarks

@mosche mosche force-pushed the 22238_Java_Jmh_Cron branch from c2118d0 to 95d9516 Compare September 30, 2022 05:17
@mosche
Copy link
Copy Markdown
Member Author

mosche commented Sep 30, 2022

@apilloud Thanks a lot! The "problem" with JMH benchmarks is that they take a massive amount of time. They are running a large number of iterations including various forks and warmups to produce a more stable and accurate number.

With the current (default) JMH settings these would run for ~ 14 hours:

~100 benchmarks * 5 forks * (5 warmup iterations + 5 measurement iterations) * 10 seconds

If using just 3 forks it's running for ~ 8.5 hours, which seems more reasonable.
Later, once we have some numbers, we might be able to reduce the number of iterations slightly and see how that impacts (stability of) results.
cc @lukecwik

@codecov
Copy link
Copy Markdown

codecov Bot commented Sep 30, 2022

Codecov Report

Merging #23388 (d02611e) into master (7dd1c6b) will increase coverage by 0.02%.
The diff coverage is 0.00%.

@@            Coverage Diff             @@
##           master   #23388      +/-   ##
==========================================
+ Coverage   73.40%   73.43%   +0.02%     
==========================================
  Files         718      718              
  Lines       95652    95680      +28     
==========================================
+ Hits        70215    70263      +48     
+ Misses      24126    24106      -20     
  Partials     1311     1311              
Flag Coverage Δ
python 83.20% <0.00%> (+0.03%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
sdks/python/apache_beam/metrics/cells.py 82.11% <0.00%> (ø)
...beam/testing/load_tests/load_test_metrics_utils.py 34.07% <0.00%> (ø)
.../python/apache_beam/testing/test_stream_service.py 88.09% <0.00%> (-4.77%) ⬇️
.../python/apache_beam/transforms/periodicsequence.py 98.38% <0.00%> (-1.62%) ⬇️
...che_beam/runners/interactive/interactive_runner.py 90.50% <0.00%> (-1.27%) ⬇️
sdks/python/apache_beam/runners/direct/executor.py 96.46% <0.00%> (-0.55%) ⬇️
...ks/python/apache_beam/runners/worker/sdk_worker.py 88.94% <0.00%> (-0.16%) ⬇️
sdks/python/apache_beam/metrics/execution.py 87.96% <0.00%> (ø)
sdks/python/apache_beam/io/gcp/bigquery_tools.py 85.73% <0.00%> (ø)
...thon/apache_beam/runners/worker/sdk_worker_main.py 78.48% <0.00%> (ø)
... and 6 more

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@mosche
Copy link
Copy Markdown
Member Author

mosche commented Sep 30, 2022

Run Seed Job

@mosche mosche force-pushed the 22238_Java_Jmh_Cron branch from 95d9516 to 1104ea5 Compare September 30, 2022 07:06
@mosche mosche changed the title [WIP] Add cron job to trigger Java JMH micro-benchmarks weekly Add cron job to trigger Java JMH micro-benchmarks weekly Sep 30, 2022
@lukecwik lukecwik merged commit 30dbe09 into apache:master Sep 30, 2022
@lukecwik
Copy link
Copy Markdown
Member

It would be great to run this daily or every 2 days. @mosche or @apilloud, do you know how busy or perf machine is already?

@apilloud
Copy link
Copy Markdown
Member

Run length of over ~3 hours is going to be disruptive to existing tests regardless of run length. I think the behavior of Jenkins is to just run tests less frequently? Daily would be a good start. Our current tests run every 6 hours and it looks like we are busy ~25% of the time: https://ci-beam.apache.org/label/beam-perf/load-statistics?type=hour

@lukecwik
Copy link
Copy Markdown
Member

lukecwik commented Oct 3, 2022

We could easily split the job into two JMH runs since there are two JMH projects currently. We can also split it very finely if we utilize -Pbenchmark=... and run one suite at a time.

@mosche
Copy link
Copy Markdown
Member Author

mosche commented Oct 5, 2022

Sorry @lukecwik, I was off for a couple of days. Thanks for merging 👍

We could easily split the job into two JMH runs since there are two JMH projects currently.

The benchmarks of core take ~ 7h, compared to ~ 1,5h for the fn harness. That won't be enough yet.

We can also split it very finely if we utilize -Pbenchmark=... and run one suite at a time.

For parametrized benchmarks runtimes vary a lot, but it would certainly be possible to split the benchmarks into equal sized chunks this way. Though, I'm a bit worried that this isn't maintainable long term. Of course it doesn't have to be perfect, but every new benchmark has to be added manually and scheduled appropriately...

I'll think a bit further about it.

@mosche mosche deleted the 22238_Java_Jmh_Cron branch October 5, 2022 14:44
@lukecwik
Copy link
Copy Markdown
Member

I agree that -Pbenchmark= isn't a great solution because of how much maintenance it would take.

@mosche
Copy link
Copy Markdown
Member Author

mosche commented Nov 9, 2022

Screenshot 2022-11-08 at 14 54 26

@lukecwik looking at the benchmark runtimes, we could split the benchmarks into 3 groups and run them 2/3 times weekly

  • ByteStringOutputStreamBenchmark: Tue, Sat
  • GetterBasedSchemaProviderBenchmark: Thu, Sun
  • Everything else: Mon, Wed, Fri

I was briefly looking at implementing this, but without a plugin to conditionally run steps (conditionalStep) this would have to be implemented as 3 jobs (or use a shell step to trigger gradle tasks, but loosing all the default switches). Thoughts?

@lukecwik
Copy link
Copy Markdown
Member

@mosche
Copy link
Copy Markdown
Member Author

mosche commented Nov 23, 2022

Do you think we can get it listed on the getting started page http://metrics.beam.apache.org/d/1/getting-started?orgId=1 ?

Absolutely, wasn't aware of the the necessary tag 👍 See #24335

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.

3 participants