-
Notifications
You must be signed in to change notification settings - Fork 23
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
add sleeping and spinning benchmark #846
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @HermioneKT,
first of all thank you very much for contributing new benchmarks. Overall it looks already quite good but there are a couple of things to address.
First, both functions are almost the same. How about if you combine both, make one function and make it configurable with a input argument.
function = flag.String("functionality", "sleep", "Define the functionality of the function. Possible values: [sleep, spin]")
This way less files need to be maintained. Also, one can easily add a memory-intense version that randomly reads and writes from and to a large memory region (Btw. would be nice if you can add that already ;))
You can keep two yaml files. One with - --functionality=sleep
and another one with spin
.
Second, I think you should make the spinning as a delay as well. I don't know how much time it takes for the 30000 loop iterations. Is it long or short? Having a parameter that lets you spin for 20 ms is more intuitive.
Then we need to integrate it into the CI. Just copy the .github/workflows/e2e-gptj.yml file and replace all gptj references with your new image. I.e.
vSwarm/.github/workflows/e2e-gptj.yml
Line 38 in c5ae2f2
gptj-python |
No worries I'll help you with that :)
Small changes see my other comments.
Finally, before we merge you need to squash all commits into one commit and you also need to sign-off the commit. Refer to: https://github.com/vhive-serverless/vHive/blob/main/docs/contributing_to_vhive.md#commit-sign-off
Thanks, again and let me know if something is unclear or you need help
benchmarks/sleeping/yamls/docker-compose/dc-sleeping-go-tracing.yaml
Outdated
Show resolved
Hide resolved
I also added a CI workflow and tested it in #852. |
2657986
to
87ddb8e
Compare
Signed-off-by: HermioneKT <hermionegrangerkt@gmail.com>
87ddb8e
to
f030521
Compare
Hi @dhschall, I have fixed the end-to-end test, thank you! I would like to request review from you again if possible. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you @HermioneKT for the update. It looks all very great!
Great you made the CI work. Sometimes that is a bit annoying ;)
Can you now just add the second benchmark into the same file. Otherwise the second benchmark will never be build and tested.
benchmarks/sleeping/go/server.go
Outdated
var ( | ||
zipkin = flag.String("zipkin", "http://localhost:9411/api/v2/spans", "zipkin url") | ||
address = flag.String("addr", "0.0.0.0:50051", "Address:Port the grpc server is listening to") | ||
delay = flag.Int("sleep-delay", 50, "Delay the function sleeps before sending the response (in milliseconds)") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for adding the delay parameter. Can you make it the same indentation level as the others
You can also run the go linter.
benchmarks/spinning/README.md
Outdated
|
||
The spinning benchmark simulates a simple cpu bounded bounded task by allowing multiplication for 30000000 iterations. | ||
|
||
This benchmark can be used to verify that increasing in cpu frequency significantly decrease the latency of CPU-bounded workload. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggestion:
This benchmark can be used to investigate the effects of cpu scaling on the latency of CPU-bound workloads.
spec: | ||
template: | ||
spec: | ||
nodeSelector: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a question what is the nodeSelector for?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it is to control which node the benchmark should be invoked on. This is because one of my experiments requires spinning benchmark to be invoked on a high frequency node, sleeping benchmark on a low frequency node (which is why we need them in two different knative service with different knative yaml file to specify different nodeSelector) It did not pass the CI previously, because we need to run a command to enable this feature in Knative Serving that allows us to specify a NodeSelector in the pod spec of our Knative service first before deploying the service.
.github/workflows/e2e-spin-sleep.yml
Outdated
matrix: | ||
service: | ||
[ | ||
sleeping-go |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sleeping-go | |
sleeping-go, | |
spinning-go |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add the spinning benchmark otherwise it will never be tested
You also need a second parameter for the docker file:
Similar to:
matrix:
include:
- service: sleeping-go
file: benchmarks/sleeping/docker/Dockerfile
.github/workflows/e2e-spin-sleep.yml
Outdated
push: true | ||
file: benchmarks/sleeping/docker/Dockerfile | ||
platforms: ${{ env.PLATFORMS }} | ||
target: ${{ matrix.target }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
target: ${{ matrix.target }} |
The target is not needed since you only have one function per docker file
.github/workflows/e2e-spin-sleep.yml
Outdated
uses: docker/build-push-action@v5 | ||
with: | ||
push: true | ||
file: benchmarks/sleeping/docker/Dockerfile |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
file: benchmarks/sleeping/docker/Dockerfile | |
file: ${{ matrix.file }} |
Since you have different docker files you have to make this as a parameter.
Similar as you did for knative
Signed-off-by: HermioneKT <hermionegrangerkt@gmail.com>
Signed-off-by: HermioneKT <hermionegrangerkt@gmail.com>
Signed-off-by: HermioneKT <hermionegrangerkt@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice, thank you for your contribution.
It looks good to me.
No worries about the linters. They seem to be broken.
This PR add 2 new benchmarks sleeping (to simulate I/O bounded task) and spinning (to simulate CPU bounded task) such that i can investigate how dynamically configure cpu frequency affects latency of such tasks