Professional Cloud DevOps Engineer free question 9 / 10 · Domain 5: Optimizing performance and cost
A team hesitates to run Cloud Profiler continuously on its production services, for fear of slowing them down. What does the documentation say about the overhead?
- The overhead grows with the number of replicas, as instances are profiled continuously
- Profiling adds about 20 percent while data is collected, as it is meant for a staging copy
- The agent leaves the application untouched, as it reads metrics that Cloud Monitoring already collects
- Under 5 percent while collecting, and commonly under 0.5 percent amortized, which suits production use
Show the answer and explanation
Answer: D
Why this is correct
Cloud Profiler is a statistical, low-overhead profiler that continuously gathers CPU usage and memory-allocation information from production applications and attributes it to the source code. The overhead of CPU and heap allocation profiling at the time of data collection is less than 5 percent. Because a profile is collected for a single instance at a time, usually for 10 seconds every 1 minute, the overhead amortized over execution time and across replicas is commonly less than 0.5 percent. That makes always-on profiling in production affordable, which matters because test environments and microbenchmarks usually fail to replicate production load.
Why the other options are wrong
"Profiling adds about 20 percent while data is collected, as it is meant for a staging copy" … The overhead at collection time is less than 5 percent. Test environments usually fail to replicate the pressures of production, which is why profiling production is the goal.
"The overhead grows with the number of replicas, as instances are profiled continuously" … A single profile is created by collecting data, usually for 10 seconds, every 1 minute for a single instance of the service. Across replicas, the amortized overhead is commonly less than 0.5 percent.
"The agent leaves the application untouched, as it reads metrics that Cloud Monitoring already collects" … The profiling agent runs inside the application and collects profiling data as the app runs. The overhead is small but not zero.
Key points
Profiler overhead: under 5% while collecting, commonly under 0.5% amortized.