QuestionQ102

Building and testing applications

You recently deployed a Go application to Google Kubernetes Engine (GKE). The operations team has observed that the application's CPU usage remains high even with low production traffic. They have asked you to optimize the application's CPU resource consumption. You want to identify which Go functions use the greatest amount of CPU. What should you do?

  • A Deploy a Fluent Bit daemonset on the GKE cluster to log data in Cloud Logging. Analyze the logs to get insights into your application code’s performance.
  • B Create a custom dashboard in Cloud Monitoring to evaluate the CPU performance metrics of your application.
  • C Connect to your GKE nodes using SSH. Run the top command on the shell to extract the CPU utilization of your application.
  • D Modify your Go application to capture profiling data. Analyze the CPU metrics of your application in flame graphs in Profiler.
Explanation

Cloud Profiler supports CPU-time profiling for Go applications running on GKE. Adding the profiling agent to the application collects function-level CPU data, and Profiler flame graphs show each function’s relative CPU consumption, enabling identification of the CPU-intensive functions to optimize.

Learn more

Community Discussion

No comments yet. Be the first to start the discussion!