AdRoll / hologram

Easy, painless AWS credentials on developer laptops.
Apache License 2.0
803 stars 42 forks source link

hologram-boot process uses 60%+ CPU on macOS Sierra #88

Closed dansteeves68 closed 3 years ago

dansteeves68 commented 7 years ago

I'm just a user of hologram me, not a developer. My colleagues have been distributing hologram and it works pretty well. However as a Mac user I've had some issues that don't get any attention. This seems to be the only place to ask some questions...

Thanks. Sorry for polluting the "issues" log like this.

screenshot 2017-03-18 06 56 35
walterking commented 7 years ago

No need to apologize, this is the right place for this.

Occasionally I will find my laptop fan running and when I check Activity Monitor I find hologram-boot is using a ton of CPU. Is that a known bug? I've never seen this before, and most users i know are mac users. Hologram-boot just logs you in automatically on startup, but if hologram-agent isnt working it looks like it never quits. I wouldnt expect it to take this much CPU. There should be logs in /var/log/system.log, and /var/log/hologram.log. If you could share them or errors in them it might be helpful. Specifically, I think hologram-agent isn't starting correctly, which logs to hologram.log, and if we can figure out why then it should solve the cpu.

Why is hologram-anything running when I've not used hologram me or anything else since a reboot? Can I make that stop? Generally, we access hologram frequently enough that its easier for us to default to running and logged in than have to turn it on every boot. Also, the agent that gives the actual credentials out needs superuser privileges to open a http port, and alias network devices, and it's easier to start that at boot than asking a user to sudo sometimes. Theres not a great way to stop it. You can remove /Library/LaunchDaemons/com.adroll.hologram-me.plist, which will prevent hologram-boot from running, at startup, requiring you to hologram me before it functions, but preventing the agent to start would lead to a bad experience whenever you did need to use it.

How do I uninstall everything hologram? My colleagues have only distributed an installer package. There isnt an uninstaller if i understand pkg correctly, you'd have to delete files manually.
rm /usr/local/bin/hologram* rm /Library/Launch{Agent,Daemon}/com.adroll.hologram* should remove the files. But this is untested so please verify them yourself before running the commands

dansteeves68 commented 7 years ago

I took a look at the logs and I'll give you a bit of background before you look at them. (I sent the system.log file I think is relevant for the CPU race I had on the morning of 03-18.)

system.log.1.gz hologram.log.gz

walterking commented 7 years ago

The VPN is similar to our setups, though not that particular software. It shouldn't interfere unless you run hologram commands or try to pull credentials from the metadata service, in which case you get timeouts/errors, but not this behavior.

The port it binds to is 169.254.169.254:80, so only on that IP address, so its extremely unlikely any other service will interfere.

The port in use error is the unix socket, so the only other thing it would interfere with is another hologram agent.

I see errors failing to connect to your hologram server, but that should be ok.

runtime stack:
runtime.MSpanList_Insert(0x5a5b08, 0x622dd0)
        /usr/src/go/src/runtime/mheap.c:692 +0x8f
runtime.MHeap_AllocStack(0x5a5960, 0x4, 0x1)
        /usr/src/go/src/runtime/mheap.c:267 +0x71

https://github.com/golang/go/issues/17335 seems to suggest this is a go issue, and building with a newer golang will prevent that. Maybe see if you can get a new pkg built with a newer version of golang?

dansteeves68 commented 7 years ago

Thanks. I've asked for a newer golang build.

I did not try to remove anything yet, but in searching for some of those files you mentioned I came across some diagnostic reports for my CPU events. :-).

$ sudo find /Library -name "*hologram*"
/Library/LaunchDaemons/com.adroll.hologram-ip.plist
/Library/LaunchDaemons/com.adroll.hologram-me.plist
/Library/LaunchDaemons/com.adroll.hologram.plist
/Library/Logs/DiagnosticReports/hologram-boot_2017-02-20-173428_glycerine.cpu_resource.diag
/Library/Logs/DiagnosticReports/hologram-boot_2017-02-21-161840_glycerine.cpu_resource.diag
/Library/Logs/DiagnosticReports/hologram-boot_2017-02-27-083252_glycerine.cpu_resource.diag
/Library/Logs/DiagnosticReports/hologram-boot_2017-02-28-073224_glycerine.cpu_resource.diag
/Library/Logs/DiagnosticReports/hologram-boot_2017-03-02-155947_glycerine.cpu_resource.diag
/Library/Logs/DiagnosticReports/hologram-boot_2017-03-17-201908_glycerine.cpu_resource.diag
dansteeves68 commented 7 years ago

Well, since I got a new build I have now found one more report. hologram-boot_2017-04-06-212019_glycerine.cpu_resource.diag.txt

dansteeves68 commented 3 years ago

No longer important.