-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
core: Filter by unit name behind the D-Bus, instead on the client side #3142
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
core: Filter by unit name behind the D-Bus, instead on the client side #3142
Conversation
|
Please include the full description of the patch in the commit message, i.e. move the text from the PR to the commit. This is something that I've thought about doing for a long time. It's reasonable to filter on the "server" side, because we double the work by doing it on client side. Two high level changes will be needed to the patch though:
The patch looks nice though, it's much less code than I thought. |
|
Yeah, looks conceptually OK. But this needs to be a new bus call, for compat reasons, we cannot simply alter the signature of existing bus calls. Call it ListUnitsWildcarded() or so... |
779e45b to
3119707
Compare
|
@keszybz @poettering updated PR |
src/core/dbus-manager.c
Outdated
| SD_BUS_METHOD("ResetFailed", NULL, NULL, method_reset_failed, SD_BUS_VTABLE_UNPRIVILEGED), | ||
| SD_BUS_METHOD("ListUnits", NULL, "a(ssssssouso)", method_list_units, SD_BUS_VTABLE_UNPRIVILEGED), | ||
| SD_BUS_METHOD("ListUnitsFiltered", "as", "a(ssssssouso)", method_list_units_filtered, SD_BUS_VTABLE_UNPRIVILEGED), | ||
| SD_BUS_METHOD("ListUnitsByStatesAndPatterns", "asas", "a(ssssssouso)", method_list_units_filtered_by_states_and_patterns, SD_BUS_VTABLE_UNPRIVILEGED), |
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.
The name sounds a bit cumbersome. Please just call this "ListUnitsByPatterns" or so...
|
ok, looks better, but still found some issues. |
This commit improves systemd performance on the systems which have thousands of units.
3119707 to
feec56f
Compare
|
@poettering fixed |
This PR improves systemd performance on the systems which have thousands of units. Resolves coreos/fleet#478 and partly obsoletes coreos/fleet#1418 (will create new patch with the new systemd dbus method soon)
Benchmarking:
test unit file:
Tests without the patch:
Tests with the patch:
P.S. Not sure about the existing method modification, most probably you'll suggest to create new dbus method.
P.P.S. I've also noticed performance degradation in systemd (between v225 and master branch) when compared:
Something takes extra
0m0.007sin systemd v225 had similar time comparing tobusctl callSimilar tests as above but on systemd v225 (5 seconds in v225 vs 10 seconds in master branch):