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

Slow Supervisor Boot Time #81

Open
lswith opened this issue Jun 26, 2018 · 9 comments
Open

Slow Supervisor Boot Time #81

lswith opened this issue Jun 26, 2018 · 9 comments

Comments

@lswith
Copy link

lswith commented Jun 26, 2018

Context:
I've added the prometheus_ex library to my phoenix application. When I do this, my mix tasks and overall boot time for the whole application has gone up by a minute. I've started trying to determine where this occurs, and it's definitely happening the moment this application is added to the supervision tree.

Any thoughts on how I can improve runtime boot time?

@deadtrickster
Copy link
Owner

This might happen because of collectors autodiscovery. To check that you can configure collectors list manually (note default alias) https://github.com/deadtrickster/prometheus.erl#configuration

@lswith
Copy link
Author

lswith commented Jun 26, 2018

I love the quick response!

I've actually set the default_collectors to an empty list to test the boot time performance and its still very similar.

@lswith
Copy link
Author

lswith commented Jun 26, 2018

So, setting the instrumenters to an empty list as well as the collectors solved the boot time issue. Any ideas what might be the reason for this?

@deadtrickster
Copy link
Owner

Not sure, what you mean by instrumenters?

@lswith
Copy link
Author

lswith commented Jun 26, 2018

you can configure config :prometheus, instrumenters: [].

@lswith
Copy link
Author

lswith commented Jun 26, 2018

I think the issue might be in this module: https://github.com/deadtrickster/prometheus.erl/blob/master/src/prometheus_misc.erl

Getting the default instrumenters seems very slow.

@lswith
Copy link
Author

lswith commented Jun 26, 2018

I'm just curious what the default instrumenters are? if I wanted to set this configuration to the default, what would it be?

@deadtrickster
Copy link
Owner

hmm looks like this is a leftover from the past, I was trying to automate instrumenters set up like declaring metrics, but due interactive/embedded mode differences it's not possible to do that reliably. As a temporary fix please add instrumenters: [] to the prometheus config. I'll remove it entirely I think.

@dylan-chong
Copy link

Any progress on optimising this? The module_info spam is still causing 9 seconds of startup time for me, a bit annoying for a fast TDD cycle when tests take so long to start

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

3 participants