8000 Handling of 500 profiles is slow · Issue #3810 · cobbler/cobbler · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Handling of 500 profiles is slow #3810

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

Closed
nadvornik opened this issue Aug 14, 2024 · 3 comments · Fixed by #3814
Closed

Handling of 500 profiles is slow #3810

nadvornik opened this issue Aug 14, 2024 · 3 comments · Fixed by #3814
Labels
enhancement New feature or request
Milestone

Comments

@nadvornik
Copy link
Contributor

Is your feature request related to a problem?

As an xmlrpc API user
I want to create/modify large number of profiles (500)
so that I can setup and maintain large installation environment.

Provide a detailed description of the proposed feature

I am testing Cobbler with SUMA with this PR: uyuni-project/uyuni#9134
Creating/modifying of large number of profiles is slow because Cobbler calls sync when each profile is saved. Sync rewrites complete configuration, so it leads to quadratic time. With 500 profiles it takes more than 1 hour, then it ends up with API token timeout.
The same problem is with deleting profiles or deleting a distribution with linked profiles.

The goal is to support up to 500 proxy servers and the particular proxy will be specified in kernel options in corresponding profile.

Alternatives you've considered

I haven't found any way to fix it with current xmlrpc API.

Additional information

The internal function Collection.add already has the option "with_sync". Exposing this option in "save" method in xmlrpc API would fix this issue.

Profiler output:
profiler

@nadvornik nadvornik added the enhancement New feature or request label Aug 14, 2024
@SchoolGuy
Copy link
Member

So the issue is that when a sync is not executed then the TFTP directory and the Cobbler database are diverging. While this is technically not an issue it may lead to unexpected behaviour by the user as this means that an edit is not instantaneous.

I think to properly implement this, the concept of transactions should be introduced and then after the full transaction, a single save & sync is executed for all items. This however is a drastic change to the design of the API.

Since I am currently developing the new CLI Golang-based and we need to ensure version stability for Golang even the implicitly mentioned low-effort solution of exposing the parameters directly would mean countless new API endpoints (even though the old ones would just be wrapper calls). Of course, we could hide the fact that we added the two new parameters in the Golang client but that is implementation-wise the same effort.

@nadvornik
Copy link
Contributor Author

I think the transactions can be added without much changes to the current API:
Add begin_transaction(token) and commit_transaction(token).
All modification after begin_transaction, with the same token, will be stored in memory only. Then they will be saved in commit_transaction.
Without calling begin_transaction, it can work as now, without changes.

This is already partially implemented via unsaved_items. This should be extended to copy, move and delete operations.

I can work on it. Would you accept such patch?

@SchoolGuy
Copy link
Member

@nadvornik Sure. This is a good idea. When looking at the CI you can ignore the Performance testsuite and integration tests as our dedicated GH runners are not setup yet. I will review (and most probably merge) #3721 which will introduce quite some changes, so I suggest waiting to start implementing this patch after that is done. If you think it is possible (and you have the time) I would love if this could be implemented on an api.py-level, rather than a remote.py-level. This however will require many more changes then you want to do as many of the wrapper code around api.py would need to be moved into api.py (XML-RPC API specific code needs of course to remain in remote.py).

@nadvornik nadvornik mentioned this issue Aug 30, 2024
12 tasks
@github-project-automation github-project-automation bot moved this from Todo to Done in Cobbler Server May 13, 2025
@SchoolGuy SchoolGuy added this to the v3.4.0 milestone May 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

2 participants
0