GithubHelp home page GithubHelp logo

Comments (6)

thecodeassassin avatar thecodeassassin commented on July 2, 2024

does anybody know anything about this? The high cpu usage causes this to be unable in production.

from cloud-sql-proxy.

Carrotman42 avatar Carrotman42 commented on July 2, 2024

from cloud-sql-proxy.

Carrotman42 avatar Carrotman42 commented on July 2, 2024

If you're willing to do the legwork to identify the hotspots of your code, you can read through this post about adding pprof to any Go program to automatically profile CPU (and memory) usage. The post is relatively long, but the part you're interested in are adding these lines to func main:

    f, err := os.Create("some-path-to-a-file-you-own.prof")
    if err != nil {
        log.Fatal(err)
    }
    pprof.StartCPUProfile(f)
    defer pprof.StopCPUProfile()

After recompiling the proxy and running it in a scenario where it has encountered the high CPU, kill the proxy process and look through data given by the pprof tool:

go tool pprof the-locally-compiled-proxy-executable some-path-to-a-file-you-own.prof

There's a few simple commands to look through the data (top10 or web for example), but if you don't have time to look through the data, feel free to email the profile output (some-path-to-a-file-you-own.prof) to [email protected] and I'll try to interpret what's going on.

from cloud-sql-proxy.

Carrotman42 avatar Carrotman42 commented on July 2, 2024

Please let me know if there's anything you've found related to this problem. I've not heard about this being a problem so I'm going to optimistically close this. Please reopen it if you are still having a problem.

from cloud-sql-proxy.

iftachsc avatar iftachsc commented on July 2, 2024

+1 we have high cpu in GKE and most of the usage is from cloud sql proxy from no reason that make sense

from cloud-sql-proxy.

Carrotman42 avatar Carrotman42 commented on July 2, 2024

from cloud-sql-proxy.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.