-
Notifications
You must be signed in to change notification settings - Fork 29
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
google-cloud/profiler failing to install on MacOS with Node v13.8.0 #637
Comments
Breaking this answer up a bit, because there are a couple disparate things to note. Using the module on MacOSThis module depends on a module with a native component (pprof). While this native module has pre-built binaries available for Linux and Linux Alpine, we do not have pre-built binaries available for Windows or MacOS, so additional dependencies are required on those operating systems. We use node-gyp to build the native portion of the module. Instructions for using node-gyp on MacOS are available here. Following those instructions to ensure the necessary dependencies are available would be a first step for install on MacOS, but we don't have any unit or integration testing on MacOS right now, so there might be more issues after that -- please do post here if there are. I think Cloud Functions is run on Linux VMs -- so adding profiler as a dependency there shouldn't be an issue. Should this module be used with Cloud Functions? (Maybe, but with some caveats)But, since you're using cloud functions, there are a few other things I should note. First, Cloud Profiler collects one profile (of each type) per minute per deployment (defined here). These leads to a few problems when using it with Cloud profiler: unless the function is pretty long-lived (a few minutes), profiles may not be collected at all; and the profiler will need to be re-initialized on each call to the function, so profiling will be higher overhead than it would be otherwise (the shorter the function, the higher the overhead). Because of this, Profiler is not supported for Cloud Functions. Still, there may be value in using Profiler with Cloud Functions (if an application's performance has not been measured in production, there's often a lot of low-hanging fruit to be found for performance optimizations) -- a shorter experiment, rather than enabling profiler indefinitely is probably better in this case. |
Thanks for the details, and I hope this OS dependency will be removed sooner for the better build experience. Also, I was able to install everything and set up profiling for cloud functions, but it didn't track anything useful, and 98% of the events belong to internal NodeJs APIs and some system related. Ideally, I was expecting that it would track app-specific functions against CPU, Memory, I/O, Network, etc., but it didn't and it is hardly useful. I hope the Firebase team considers this request and build an easy tool to evaluate cloud functions. |
Unfortunately, the OS-dependency cannot be removed at this time. There is an open feature request for pre-built binaries for Mac OS (google/pprof-nodejs#33); but because profiling requires depending on a module with a native component, the OS dependency cannot be removed completely.
Our team is continuing to work on improving this produce, and so we hope to add support for new platforms soon. This documentation page introduces Cloud Profiler, including what profile types are collected for each language and what platforms are supported. It might details that would allow one to decide whether or not Cloud Profiler could be helpful for a specific use case. In some cases filtering can be used to view only sections of the profile currently of interest, though, depending on the use case, filtering may or may not be helpful.
I'd recommend you reach out to the Firebase team for any Firebase feature requests. |
I'm going to mark this issue as closed. Please feel free to re-open this issue or file another issue if additional follow-up is necessary. |
Hi.
Unable to install "@google-cloud/profiler" for cloud functions. I tried to reinstall, clean cache and other trials, but nothing seems to be working. Initially, it was failing with " node-pre-gyp", but later got it installed with the version "0.14.0", but the issue remain same.
I really appreciate your help to move forward.
Environment details
@google-cloud/profiler
version: 4.0.0ERRORS
Steps to reproduce
$npm install @google-cloud/profiler
Thanks!
The text was updated successfully, but these errors were encountered: