You recently deployed a Go application on Google Kubernetes Engine (GKE). The operations team has noticed that the application’s CPU usage is high even when there is low production traffic. The operations team has asked you to optimize your application’s CPU resource consumption. You want to determine which Go functions consume the largest 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.
Disclaimer
This is a practice question. There is no guarantee of coming this question in the certification exam.
Answer
D
Explanation
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.
(Ruled out.)
B. Create a custom dashboard in Cloud Monitoring to evaluate the CPU performance metrics of your application.
(Ruled out.)
C. Connect to your GKE nodes using SSH. Run the top command on the shell to extract the CPU utilization of your application.
(Ruled out.)
D. Modify your Go application to capture profiling data. Analyze the CPU metrics of your application in flame graphs in Profiler.
(Key here is flame graphs from the profiler. So using cloud profiler is the right choice.
Cloud Profiler is a statistical, low-overhead profiler that continuously gathers CPU usage and memory-allocation information from your production applications. It attributes that information to the application’s source code, helping you identify the parts of the application consuming the most resources, and otherwise illuminating the performance characteristics of the code.)