-
Notifications
You must be signed in to change notification settings - Fork 906
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
Running lxc profile list on a system with lots of profiles results in table: context deadline exceeded #13401
Comments
This is probably due to inefficient queries. Lets look into making fewer queries that return the info needed. |
How many profiles is "lots" in this case? |
Thanks for the quick reply. I actually don't know as I can't list them - maybe I could get a count from the dump - but I'd say we are in the hundreds if not 1K+ |
Try doing |
Count gives me 616 just doing the select and dumping the table is pretty quick:
|
Cool thanks. Suspect its doing a separate query to get each profile's config, rather than a single query with multiple profile IDs and then separating the results in LXD. |
@tomponline This was fixed with a fairly significant db refactor (see #10463 and #10183) that landed in LXD 5.5. This fun one-liner works great with LXD 5.21.1:
It doesn't look to me like it's feasible to backport that set of fixes to 5.0.3; I'm guessing it won't be straightforward to come up with a separate patch for 5.0.3 either, although I haven't done much spelunking to confirm that. Let me know what you think the most reasonable course of action is here. |
We upgraded our system to 5.21.1 and get this:
Sooo... Not fixed @MggMuggins or am I missing something? |
Ubuntu Jammy
LXD v5.0.3 and LXD 5.21.1
Running
lxc profile list
on a system with lots of profiles results in the following:Running
lxd sql global .dump
returns almost immediately and lists all data in the databaseWe have a real use case for supporting a lot of profiles in a remote (we allow our customers to build their own)
Adding and deleting individual profiles seems to work, although it's hard to confirm deletion when we can't list them with lxd.
Is there any way to increase the timeout in lxd to allow for listing of our (large, and will only grow larger) profiles list? We could start hacking away at sql queries, but I'd much rather be able to do an lxc profile list
(this use case came up as we actually wanted to make sure the list was cleaned up so any unused profiles were removed)
The text was updated successfully, but these errors were encountered: