Adds option to set memory and cpu constraint#671
Conversation
713abdd to
f7c8735
Compare
|
Hey @kyteinsky @oleksandr-nc, |
31bee10 to
c78d2a3
Compare
Hello! You can use |
|
P.S.: But we usually do this after the PR is approved, before merging - the only exceptions are those PRs where the author is confident there won't be any changes to not remove commits of bots from git history. The developers are building JS locally for review. I will try to check this PR - is it ready for review or not? |
|
I see, that makes sense. Thank you. |
|
@Hephi2 When I edit the daemon deploy page and fill the Memory limit and then start changing the CPU limit, the Memory limit gets reset. |
cpu-limit.mp4 |
Tests were performed on HaRP, results:Without memory limit: Result: 🆗 With 8GB memory limit: Result: 🆗 Without CPU limit:
Result: 🆗 With CPU limit=
Result: 🆗 @Hephi2 Second question, if you don't mind, does |
|
@oleksandr-nc Regarding your second question: |
|
Are you using Vue2 and not building this with Vue3? |
I can't reproduce this. Which browser do you use and does any other browser have this issue too? |
|
@Hephi2 Also, see https://www.corsair.com/us/en/explorer/diy-builder/storage/mebibyte-vs-megabyte-whats-the-difference/ |
Firefox. But reactivity in Vue2 should work the same among all browsers? |
|
Description what happens on video: On mount, when editing a daemon whose |
|
@Hephi2 would you be up for giving it one more go to see if you can reproduce it with the additional hints? |
|
Yes, sure. |
So I was able to reproduce this issue. The steps were:
the fields should be empty now. |
Actually, this was covered if both were not set. However, in the edge case described by @kyteinsky, the corresponding other key was not initialised. |
|
With latest changes editing Deploy Config works fine for me. @kyteinsky can you check on your side as well? |
|
confirmed, that is fixed. |
|
/compile |
|
@Hephi2 please squash three first commits and after that we can merge this |
- Adds fields in admin UI
- Sets HostConfig.Memory and HostConfig.NanoCPUs fields for Docker Socket Proxy
- Passes memory and nanoCPU values to HaRP Proxy (requires changes in HaRP repo)
Signed-off-by: Hephi2 <Philipp.Hempel1@web.de>
Update built assets after source changes
Signed-off-by: Hephi2 <Philipp.Hempel1@web.de>
Fixes resetting memory limit bug, MB -> MiB
Signed-off-by: Hephi2 <Philipp.Hempel1@web.de>
8c6c85d to
40ecdd0
Compare
|
/compile |
Signed-off-by: nextcloud-command <nextcloud-command@users.noreply.github.com>
|
Hello there, We hope that the review process is going smooth and is helpful for you. We want to ensure your pull request is reviewed to your satisfaction. If you have a moment, our community management team would very much appreciate your feedback on your experience with this PR review process. Your feedback is valuable to us as we continuously strive to improve our community developer experience. Please take a moment to complete our short survey by clicking on the following link: https://cloud.nextcloud.com/apps/forms/s/i9Ago4EQRZ7TWxjfmeEpPkf6 Thank you for contributing to Nextcloud and we hope to hear from you soon! (If you believe you should not receive this message, you can add yourself to the blocklist.) |


Solves #547
- Adds fields in admin UI
- Sets HostConfig.Memory and HostConfig.NanoCPUs fields for Docker Socket Proxy
- Passes memory and nanoCPU values to HaRP Proxy (requires changes in HaRP repo)
Requires changes in HaRP to work. See nextcloud/HaRP#46
To validate the effect of the resource constraints run e.g. the following commands:
docker exec -it <container_id> bashyes > /dev/nulldocker stats <container_id>that the container stays around the configured CPU cappython3 -c "a = ' ' * (1024 * 1024 * 1024); input()"docker stats <container_id>that the limit is equal to to set memory value and if the needed memory is too high, the process will be killed