-
Notifications
You must be signed in to change notification settings - Fork 151
[Bug] Slow startup outside of public clouds #417
Comments
@networkop Thanks for noticing and debugging this.
Yeah, I've seen this before; this option looks good to me. This doesn't seem to require root privileges though. I gave it a try: [ec2-user@ip-172-31-34-75 ~]$ cat /sys/hypervisor/uuid |
Interesting, maybe it's OS-specific. I've got Debian10 and I don't have
|
Ah, that complicates the things. Apparently we can disable retries in the Available method: We can use 0 or some other small number of retries. |
yeah, setting it to a 0 is an easy win. I'll be much happier with 5 seconds instead of 20. |
so are you ok for me to submit a PR for this? |
Sure. Sounds good to me. Let's reduce retries for AWS regardless, or we can do that separately. I think it makes sense to optimize the default behavior as well. |
closed in #427 |
What happened: Whenever running cloudprober outside of GCP or AWS, it will exhibit a slot startup time of at least 20 seconds.
What you expected to happen: cloudprober should be able to start in under a second.
How to reproduce it (as minimally and precisely as possible): build the cloudprober binary and run it on a laptop
Anything else we need to know?: this is caused by the
md.Available()
function call insysvars_ec2.go
which tries to contact EC2's metadata service. GCP check returns faster, when DNS lookup ofmetadata.google.internal
fails. Perhaps EC2 code can be refactored to check forec2
string in product_uuid as documented here? <- this would require sudo privilegesThe text was updated successfully, but these errors were encountered: