Skip to content
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

Dbus linking function is quite expensive #189

Closed
hectorj2f opened this issue Aug 6, 2016 · 5 comments
Closed

Dbus linking function is quite expensive #189

hectorj2f opened this issue Aug 6, 2016 · 5 comments

Comments

@hectorj2f
Copy link

Hello there,

I am trying to improve the performance of dbus methods and I realized that the linking operation is quite expensive. This operation becomes a bottleneck whenever you need to link-start many systemd units. In fact, the response time increases over the time whenever you want to link multiple units.
As a result of my investigation, I found that the force (force=true) property of the dbus function doesn't bring any benefit (when using the latest version of dbus). It is true that the force property set to true could bring some consistency in case of race condition. However, I think it should be configured to be false to offer a better performance.

func (c *Conn) LinkUnitFiles(files []string, runtime bool, force bool) ([]LinkUnitFileChange, error) {
    result := make([][]interface{}, 0)
    err := c.sysobj.Call("org.freedesktop.systemd1.Manager.LinkUnitFiles", 0, files, runtime, force).Store(&result)
    if err != nil {
        return nil, err
    }

What is it your impression ? The improvements in terms of performance are in the order of seconds and could change the complexity of this operation.

Why did you decide to define force=true as default ?

Thanks.

@jonboulle
Copy link
Contributor

Should this be filed against fleet? There's no default set here..

@hectorj2f
Copy link
Author

I thought anyone using it could benefit from it. But, yeah, I'll file it against fleet. Thanks @jonboulle for your quick reply.

@jonboulle
Copy link
Contributor

@hectorj2f I just don't really get what you're proposing here in go-systemd - that we have another helper function that sets it to false by default?

@hectorj2f
Copy link
Author

@jonboulle My intention is detailed in the following points:

  1. Warn the people about the performance and scalability penalties of this function.
  2. Learn from the developers of this module when the value of force should be set to true|false. Which are the drawbacks/advantages?.
  3. This module is certainly used by fleet but I believe others components|systems might also use it as well.

I just wanted to discuss these aspects with the developers of this library.

@hectorj2f
Copy link
Author

@jonboulle I see no interest here so we can close this issue ;). I'd think about adding this change to fleet in https://github.com/coreos/fleet/blob/master/systemd/manager.go#L268.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants