あなたの会社は、Pub/Sub、App Engine スタンダード環境、GO で書かれたアプリケーションを使用して、IoT データを大規模に処理しています。ピーク負荷時にパフォーマンスが一貫して低下していることに気づきました。ワークステーションではこの問題を再現できませんでした。コード内の遅いパスを特定するには、運用環境のアプリケーションを継続的に監視する必要があります。パフォーマンスへの影響と管理オーバーヘッドを最小限に抑えたいと考えています。
あなたは何をするべきか?
継続的プロファイリング ツールを Compute Engine にインストールします。プロファイリング データをツールに送信するようにアプリケーションを構成します。
正解:C
Explanation
The correct answer is C. Configure Cloud Profiler, and initialize the cloud.google.com/go/profiler library in the application.
According to the Google Cloud documentation, Cloud Profiler is a statistical, low-overhead profiler that continuously gathers CPU usage and memory-allocation information from your production applications1.
Cloud Profiler can help you identify slow paths in your code and optimize the performance of your applications. Cloud Profiler supports applications written in Go that run on App Engine standard environment2. To use Cloud Profiler, you need to configure it in your Google Cloud project and initialize the cloud.google.com/go/profiler library in your application code3. You can then use the Cloud Profiler interface to analyze the profiling data and visualize the results by using flame graphs4. Cloud Profiler has minimal performance impact and management overhead, as it only samples a small fraction of the application activity and does not require any additional infrastructure or agents.
The other options are incorrect because they do not meet the requirements of minimizing performance impact and management overhead. Option A is incorrect because it requires installing a continuous profiling tool into Compute Engine, which is an additional infrastructure that needs to be managed and maintained. Option B is incorrect because it requires periodically running the go tool pprof command against the application instance, which is a manual and disruptive process that can affect the application performance. Option D is incorrect because it only uses Cloud Monitoring to assess the App Engine CPU utilization metric, which is not enough to identify slow paths in the code or optimize the application performance.