Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
133 views
in Technique[技术] by (71.8m points)

node.js - Google Cloud CPU profiling not showing useful data

After my application was running @ 400%+ CPU usage in a dockerised app, I decided to try using @google-cloud/profiler. The setup was easy enough but I am disappointed with what I see in the UI:

enter image description here

As you can see, what is consuming the most resources, I can't seem to look into as there's no info about it. It's labelled as "(external)" & no file. I am very new to Google Cloud CPU Profiler but it seems quite out of the box. My application is a multi-process one & it is the child process' that are causing the high CPU load so I invoke the CPU profiler on the entry of these child process'

src/cluster/worker/index.js

module.exports = async function() {
    try {
        await require('@google-cloud/profiler').start({
            projectId: process.env.GOOGLE_PROJECT_ID,
            serviceContext: {
                service: process.env.GOOGLE_SERVICE || 'app',
                version: process.env.GOOGLE_VERSION || '1.0.0'
            },
            // want to disable logging to the console
            logLevel: 0
        })

        ...
    } catch(err) {
        ...
    }
}

There are many child process' running (5 ish) so could this be the issue? Also, when I select to view the history of the profile, I get this:

enter image description here

As mentioned, I am new to Google Cloud & CPU profiling in general so any help would be appreciated. Sadly, I cannot find any help in Google forums & no one has raised any similar issues on the NPM package itself.

question from:https://stackoverflow.com/questions/66055116/google-cloud-cpu-profiling-not-showing-useful-data

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...