Bỗng dưng 1 hôm bạn nhận được request rằng đám istiod nó Peak CPU kinh vậy

Tiền đâu thì links tham khảo:
https://github.com/istio/istio/issues/23031
https://github.com/istio/istio/wiki/Analyzing-Istio-Performance
https://jvns.ca/blog/2017/09/24/profiling-go-with-pprof/
Để có thể Analyzing Istio Performance thì chúng ta cần tool là pprof và kubectl trên máy tính và browser.
Mình thích chạy trên windows vì:
– thứ nhất là mình hay làm việc workspace: windows.
– thứ 2 cài mấy cái này trên windows với khó chứ MAC hày Linux nó dễ lắm
Giờ thì làm sao để chạy được pprof.
Bước 1 cài golang lên máy tính:

Bạn cần cài kubectl trên máy
https://kubernetes.io/vi/docs/tasks/tools/install-kubectl/
links tải file exe dành cho windows:
https://storage.googleapis.com/kubernetes-release/release/v1.22.0/bin/windows/amd64/kubectl.exe

Vì khi bạn mở CMD lên nay ở vị trí này đỡ cd ra chỗ khác.

PS C:\Users\mrnim> .\kubectl.exe get ns
>>> lệnh trên windows thì là chút

.\kubectl.exe -n istio-system port-forward deployment.apps/istiod 8080:8080
Lúc này chúng ta cần truy cập port 8080 dùng cách trên he.

go tool pprof -http=:8888 localhost:8080/debug/pprof/profile
Lúc này nó auto mở browser ở laptop của mình.
và bạn sẽ thấy dòng chữ trên Browser.
could not execute dot may need to install graphviz
Giờ chúng ta cần cài graphviz
http://www.graphviz.org/download/
https://bobswift.atlassian.net/wiki/spaces/GVIZ/pages/20971549/How+to+install+Graphviz+software

https://bobswift.atlassian.net/wiki/spaces/GVIZ/pages/20971549/How+to+install+Graphviz+software
Chúng ta sẽ cần hỉnh lại path:





C:\Program Files\Graphviz\bin

go tool pprof -http=:8888 localhost:8080/debug/pprof/profile
Sau khi gõ lại chúng ta, nó âuto mở browser.

To be Continue…