Add benchmark testing framework#3599
Conversation
Signed-off-by: shawnh2 <[email protected]>
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #3599 +/- ##
==========================================
+ Coverage 68.25% 68.33% +0.08%
==========================================
Files 170 170
Lines 20760 20780 +20
==========================================
+ Hits 14170 14201 +31
+ Misses 5568 5562 -6
+ Partials 1022 1017 -5 ☔ View full report in Codecov by Sentry. |
Signed-off-by: shawnh2 <[email protected]>
Signed-off-by: shawnh2 <[email protected]>
Signed-off-by: shawnh2 <[email protected]>
Signed-off-by: shawnh2 <[email protected]>
Signed-off-by: shawnh2 <[email protected]>
| @@ -0,0 +1,40 @@ | |||
| name: Benchmarking Tests at Scale | |||
There was a problem hiding this comment.
question: should we schedule this ci as a cron job or run with every PR?
There was a problem hiding this comment.
or only run this if someone comments /benchmark ?
There was a problem hiding this comment.
id vote to only make it run on push to main and release/v*
lets raise a follow up issue to support running on PRs automatically (if it doesn't increase CI time) or using /benchmark
Signed-off-by: shawnh2 <[email protected]>
Signed-off-by: shawnh2 <[email protected]>
Signed-off-by: shawnh2 <[email protected]>
|
where's the result? |
In the CI stdout, which way do we prefer to see the result ? Comments back in current thread ? |
that's an option. |
|
thanks for building out this benchmarking suite ! suggest configuring envoy proxy and envoy gateway memory and cpu limits before starting the test, and also make it a top level input arg
|
|
we are already using fortio in our repo today gateway/test/e2e/tests/utils.go Line 154 in 2c602d5 are they any benefits on using nighthawk here ?cc @guydc |
Cool! These values can be easily retrieved from CP & DP metrics. |
…cale to scale-up Signed-off-by: shawnh2 <[email protected]>
Signed-off-by: shawnh2 <[email protected]>
| @@ -0,0 +1,53 @@ | |||
| name: Benchmarking Tests at Scale | |||
| on: | |||
| pull_request: | |||
There was a problem hiding this comment.
change it to push once this PR is good to go
There was a problem hiding this comment.
Not sure if we need to run this in every push, or on schedule
There was a problem hiding this comment.
like suggested #3599 (comment), we can run this with /benchmark command.
There was a problem hiding this comment.
I think it is good to run it on pull/push. In general, I like all major testing/linting/etc. CI suites to run on every push even if there is no PR. Makes it easy to get your branches in order without having a PR that goes through a bunch of edits to get things working. I dislike the idea of only ever running it when users comment /benchmark. The general idea should be for CI to alert us when incoming changes degrade (or improve) performance.
| spec: | ||
| serviceAccountName: default | ||
| containers: | ||
| - name: nighthawk-server |
There was a problem hiding this comment.
can replace this test server with a much simpler one, like echo server in a follow-up PR.
Signed-off-by: shawnh2 <[email protected]>
Signed-off-by: shawnh2 <[email protected]>
Nighthawk:
Fortio:
Istio supports execution of their dataplane benchmark tests with either Fortio or Nighthawk, the latter being the most recent addition: istio/istio#21161. Istio load tests are currently executed with fortio. Overall, I'm +1 for using nighthawk as the data plane benchmark tool. The current use of fortio in our project is mostly for easy execution of load during e2e tests that require it (retries, shutdown, upgrade, ... ). I believe that we can implement our own simple load generator based on net/http and remove the fortio dependency in the future. |
Still not working, the error shows |
Signed-off-by: shawnh2 <[email protected]>
| parentRefs: | ||
| - name: "{REF_GATEWAY_NAME}" | ||
| hostnames: | ||
| - "www.benchmark.com" |
There was a problem hiding this comment.
can we also template out the hostname for this test so each HTTPRoute gets a unique hostname
else these routes wont reach Programmed and will bloat Status
There was a problem hiding this comment.
Maybe we can make this a bit more realistic and control num-routes-per-host? This way, we don't have one huge route table or many small ones... anyway, not criticial for this time.
There was a problem hiding this comment.
make sense, do it as a follow-up
| @@ -0,0 +1,925 @@ | |||
| # Benchmark Report | |||
There was a problem hiding this comment.
❤️ thanks for generating this !
arkodg
left a comment
There was a problem hiding this comment.
LGTM thanks for adding this framework and the report !
non blocking comment, my preference would be to run the client outside the k8s cluster, which is easier with fortio as a golang lib rather than running a containerized nighthawk client |
| @@ -0,0 +1,53 @@ | |||
| name: Benchmarking Tests at Scale | |||
| on: | |||
| pull_request: | |||
There was a problem hiding this comment.
I think it is good to run it on pull/push. In general, I like all major testing/linting/etc. CI suites to run on every push even if there is no PR. Makes it easy to get your branches in order without having a PR that goes through a bunch of edits to get things working. I dislike the idea of only ever running it when users comment /benchmark. The general idea should be for CI to alert us when incoming changes degrade (or improve) performance.
guydc
left a comment
There was a problem hiding this comment.
LGTM! Looking forward to seeing this run in CI!
| parentRefs: | ||
| - name: "{REF_GATEWAY_NAME}" | ||
| hostnames: | ||
| - "www.benchmark.com" |
There was a problem hiding this comment.
Maybe we can make this a bit more realistic and control num-routes-per-host? This way, we don't have one huge route table or many small ones... anyway, not criticial for this time.
|
there's a lint error |
Signed-off-by: shawnh2 <[email protected]>
3dc4472
Seems like a typo from nighthawk |
|
/retest |
What this PR does / why we need it:
Taking #2578 forward, but using code to implement benchmark testing framework.
Similar to
ConformanceSuiteandConformanceTest, I define aBenchmarkSuiteandBenchmarkTest, each benchmark test case will be run as a k8s Job, so that:Which issue(s) this PR fixes:
Fix #1365, Fix #2325, Close #2578