###### tags: `Linux`, `SRE` # SRE 讀書會 Round 4 #16 - 線上讀書會共筆 [TOC] ## 活動資訊 * Date: [%DATETIME%] (四) 20:00 - 21:30 * [導讀進度表](https://docs.google.com/spreadsheets/d/1Lgti3mILkvwxyzklX1vvLraaGD-7ePK9rkmlulfOknE/edit#gid=0) * [導讀 Guideline](https://study-area.sre.tw/GuideLine/) * Github: [study-area-docs](https://github.com/cross-community/study-area-docs) --- # 現場共筆 ## 49 | 案例篇:內核線程 CPU 利用率太高,我該怎麼辦? * 特殊ps: * 0 ps: idle ps * 1 ps: init ps * systemd process * user space - parents * 2 ps: kthreadd process * kernel ps: * ksoftirqd * kthreadd * kswaod0 * kworker * migration * jbd2/sda1-8 * pdflush >* [brendangregg/FlameGraph](https://github.com/brendangregg/FlameGraph) > 沒有 > Q1. 火焰圖(FlameGraph)工作案場是否有使用過? > A1. 追CPU/IO卡住的時候可以使用,也可以用perf > 可以用APM # 參考資料 [How to generate PHP Flamegraphs](https://daniellockyer.com/php-flame-graphs/) --- ## 50/51 | 案例篇:動態追蹤怎麼用? 效能調整方法: 1. GDB設置應用程式斷點 2. 程式碼debugger Prode(探針):靜態/動態/硬體事件 perf跟著核心released linux常用動態追蹤fteace/perf/eBPF > * perf > > Q1. perf/火焰圖/ftrace有什麼不同? > A1. 網通產品比較容易使用,Web App.比較少用 > Q2. prod環境是否有人會開APM, > A2. use case: 被反應很慢的時候 > > * (JAVA)VisialVM > JMS EXPORTER:收集效能數據 > jconsole > > * .NET:IIS runtime data > application insight > > * Python http://pramodkumbhar.com/2019/05/summary-of-python-profiling-tools-part-i/ > > *https://zipkin.io/ 現在features我們要求塞入tracing,也是採樣整條function > > * 標準做法: 先水平擴展,再用LOG復現環境,再觀察問題 > gafana 有釋出相關的dashboard > https://grafana.com/blog/2020/05/22/new-in-grafana-7.0-trace-viewer-and-integrations-with-jaeger-and-zipkin/ > --- # 參考資料 * [lua script](https://www.youtube.com/watch?v=lNsESiTcgGY&ab_channel=CloudNativeTaiwan) * [Python Profiling Tools](http://pramodkumbhar.com/2019/05/summary-of-python-profiling-tools-part-i/) * [Grafana 7.0: Trace viewer and integrations with Jaeger and Zipkin](https://grafana.com/blog/2020/05/22/new-in-grafana-7.0-trace-viewer-and-integrations-with-jaeger-and-zipkin/) * [社群FB活動貼文 : Round 4 #16](https://www.facebook.com/groups/sre.taiwan/permalink/1878976158934946/)