SRE Taiwan
      • Sharing URL Link copied
      • /edit
      • View mode
        • Edit mode
        • View mode
        • Book mode
        • Slide mode
        Edit mode View mode Book mode Slide mode
      • Customize slides
      • Note Permission
      • Read
        • Owners
        • Signed-in users
        • Everyone
        Owners Signed-in users Everyone
      • Write
        • Owners
        • Signed-in users
        • Everyone
        Owners Signed-in users Everyone
      • Engagement control Commenting, Suggest edit, Emoji Reply
    • Invite by email
      Invitee
    • Publish Note

      Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

      Your note will be visible on your profile and discoverable by anyone.
      Your note is now live.
      This note is visible on your profile and discoverable online.
      Everyone on the web can find and read all notes of this public team.
      See published notes
      Unpublish note
      Please check the box to agree to the Community Guidelines.
      View profile
    • Commenting
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
      • Everyone
    • Suggest edit
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
    • Emoji Reply
    • Enable
    • Versions and GitHub Sync
    • Note settings
    • Engagement control
    • Transfer ownership
    • Delete this note
    • Insert from template
    • Import from
      • Dropbox
      • Google Drive
      • Gist
      • Clipboard
    • Export to
      • Dropbox
      • Google Drive
      • Gist
    • Download
      • Markdown
      • HTML
      • Raw HTML
Menu Note settings Versions and GitHub Sync Sharing URL Help
Menu
Options
Engagement control Transfer ownership Delete this note
Import from
Dropbox Google Drive Gist Clipboard
Export to
Dropbox Google Drive Gist
Download
Markdown HTML Raw HTML
Back
Sharing URL Link copied
/edit
View mode
  • Edit mode
  • View mode
  • Book mode
  • Slide mode
Edit mode View mode Book mode Slide mode
Customize slides
Note Permission
Read
Owners
  • Owners
  • Signed-in users
  • Everyone
Owners Signed-in users Everyone
Write
Owners
  • Owners
  • Signed-in users
  • Everyone
Owners Signed-in users Everyone
Engagement control Commenting, Suggest edit, Emoji Reply
  • Invite by email
    Invitee
  • Publish Note

    Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

    Your note will be visible on your profile and discoverable by anyone.
    Your note is now live.
    This note is visible on your profile and discoverable online.
    Everyone on the web can find and read all notes of this public team.
    See published notes
    Unpublish note
    Please check the box to agree to the Community Guidelines.
    View profile
    Engagement control
    Commenting
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    • Everyone
    Suggest edit
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    Emoji Reply
    Enable
    Import from Dropbox Google Drive Gist Clipboard
       owned this note    owned this note      
    Published Linked with GitHub
    Subscribed
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    Subscribe
    ###### tags: `Linux`, `SRE` # SRE 讀書會 Round 4 #04 - 線上讀書會共筆 ## 活動資訊 * Date: 2020/06/03 (四) 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) --- # 11 | 套路篇:如何迅速分析出系統CPU的瓶頸在哪裡? - 分享者:Winnie ## 問題 * 大家常用的工具? * 分析的步驟 1. top 2. vmstat 3. pidstat 4. process 分析工具 * 思考題 * valgrind * gprof * 分享: * 分散式儲存的研究經驗 - 邱牛 * 以商業角度出發,利用效能工具評估, 選擇效能較好的 Open Source * perf - 以 function 為單位 -- # 12 | 套路篇:CPU 性能優化的幾個思路 - 分享者:陳龍星 & 曾義格 #### 回顧 CPU 性能指標 * 三個問題 * 如何判斷現在做的優化是否有效?優化後能提升多少性能? * 確認性能的量化指標 * 找出影響最大的點 * 找出因果關係 * CPU loading 最容易觀測 * * 多個性能問題同時發生時,要先優化哪個? * **最先達到上限的資源指標** * 多種優化方法,先選哪種? * 優化不代表沒成本 e.g. Data Plane Developement Kit - 時空背景 2010 年開源 / 為了解決 10G 網卡問題 * 補充:DPDK 最大的成本就是要重新撰寫既有應用程式,因為原本使用的 Library 都不能使用 * 切莫因小優化而損失更大項 * 勿想一步登天 * 不是所有問題都要優化 * **先做沒副作用的** * **做最簡單快速並且其他指標副作用不會達到上限的** * 補充:量化指標 * 系統資源 * 漸進式優化 * ~~系統~~系統環境 * 命令 / 腳本 * 環境參數 (為何劃掉前三項?不患寡,患不均) * ~~CPU綁定~~ * ~~CPU獨占~~ * ~~NUMA~~: L3 cache for multi cpu core * irqbalance: 比樓上 3 個重要 * renice: 很常用 * cgroups * FC 2010: 200 lines code, but performed well * 當時解決影片, FPS 等問題 * ~~當時不能調度IO~~,即調度的功能較少V * 到 k8s? (docker?) 後才紅起來 <-- 有誰能幫忙更正 : 容器時代夯起來,200 line事件也夯一次(LongSing) * swappiness - Server: game server, swappiness = 0,因需要超低延遲,[補充資料](https://askubuntu.com/questions/943165/is-a-swappiness-value-of-0-safe-how-about-1-what-is-the-minimum) - android: swappiness = 100% ,因為記憶體太小,Android 使用了 zram 的技術:LRE 只壓縮零 - JAVA_OPTS - G1GC: JAVA 8 以後支援 - XSS: 256k 建議採用 - UseAVX , UseSSE:可以優化運行速度 - Compile Threshold=8000 (8192) - XX Background Compliation:背景編譯 - G1GCPauseMillis=200 (ms) 建議採用 * 定時腳本 * 執行參數 * 最常加的是 Nice * 編譯參數 * Kernal 優化 * 不用寫程式,進入 menu config 就可以設定參數優化系統 * 程式碼 * 服務架構 * 程式碼可能要換個寫法增進服務效能 * * 問題 * SWAP 要如何設定比較好? * 看服務應用類型選擇(LongSing) * 重編(優化) kernel 的場景多嗎? * 我每天都在看是否有核心更新,當刷核心已成習慣XD(LongSing) # 13 | 答疑(一):無法模擬出 RES 中斷的問題,怎麼辦? - 分享者:Hans Hsu # 現場共筆 - 為什麼殭屍程序要存在? - smp_affinity:用來控制 IRQ 分配的方式,某些情況會希望近可能讓特定 CPU 來處理中斷 - 中斷: - 上半部:不應該睡眠或 lock (spin lock、busy lock 除外) - 下半部:可以不用馬上處理,比方說進 work queue 慢慢處理 - 硬中斷、軟中斷如何判斷:誰是中斷的源頭 - 硬碟要求(網卡、memory 等等) - 軟體作為源頭(除以 0、指到空指標),有 user 在做驅動 - ApacheBench 做測試 - 類似工具(http):hey, wrk, [siege](https://github.com/JoeDog/siege) - tcp: iperf3, pktgen --- # 參考資料

    Import from clipboard

    Paste your markdown or webpage here...

    Advanced permission required

    Your current role can only read. Ask the system administrator to acquire write and comment permission.

    This team is disabled

    Sorry, this team is disabled. You can't edit this note.

    This note is locked

    Sorry, only owner can edit this note.

    Reach the limit

    Sorry, you've reached the max length this note can be.
    Please reduce the content or divide it to more notes, thank you!

    Import from Gist

    Import from Snippet

    or

    Export to Snippet

    Are you sure?

    Do you really want to delete this note?
    All users will lose their connection.

    Create a note from template

    Create a note from template

    Oops...
    This template has been removed or transferred.
    Upgrade
    All
    • All
    • Team
    No template.

    Create a template

    Upgrade

    Delete template

    Do you really want to delete this template?
    Turn this template into a regular note and keep its content, versions, and comments.

    This page need refresh

    You have an incompatible client version.
    Refresh to update.
    New version available!
    See releases notes here
    Refresh to enjoy new features.
    Your user state has changed.
    Refresh to load new user state.

    Sign in

    Forgot password

    or

    By clicking below, you agree to our terms of service.

    Sign in via Facebook Sign in via Twitter Sign in via GitHub Sign in via Dropbox Sign in with Wallet
    Wallet ( )
    Connect another wallet

    New to HackMD? Sign up

    Help

    • English
    • 中文
    • Français
    • Deutsch
    • 日本語
    • Español
    • Català
    • Ελληνικά
    • Português
    • italiano
    • Türkçe
    • Русский
    • Nederlands
    • hrvatski jezik
    • język polski
    • Українська
    • हिन्दी
    • svenska
    • Esperanto
    • dansk

    Documents

    Help & Tutorial

    How to use Book mode

    Slide Example

    API Docs

    Edit in VSCode

    Install browser extension

    Contacts

    Feedback

    Discord

    Send us email

    Resources

    Releases

    Pricing

    Blog

    Policy

    Terms

    Privacy

    Cheatsheet

    Syntax Example Reference
    # Header Header 基本排版
    - Unordered List
    • Unordered List
    1. Ordered List
    1. Ordered List
    - [ ] Todo List
    • Todo List
    > Blockquote
    Blockquote
    **Bold font** Bold font
    *Italics font* Italics font
    ~~Strikethrough~~ Strikethrough
    19^th^ 19th
    H~2~O H2O
    ++Inserted text++ Inserted text
    ==Marked text== Marked text
    [link text](https:// "title") Link
    ![image alt](https:// "title") Image
    `Code` Code 在筆記中貼入程式碼
    ```javascript
    var i = 0;
    ```
    var i = 0;
    :smile: :smile: Emoji list
    {%youtube youtube_id %} Externals
    $L^aT_eX$ LaTeX
    :::info
    This is a alert area.
    :::

    This is a alert area.

    Versions and GitHub Sync
    Get Full History Access

    • Edit version name
    • Delete

    revision author avatar     named on  

    More Less

    Note content is identical to the latest version.
    Compare
      Choose a version
      No search result
      Version not found
    Sign in to link this note to GitHub
    Learn more
    This note is not linked with GitHub
     

    Feedback

    Submission failed, please try again

    Thanks for your support.

    On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?

    Please give us some advice and help us improve HackMD.

     

    Thanks for your feedback

    Remove version name

    Do you want to remove this version name and description?

    Transfer ownership

    Transfer to
      Warning: is a public team. If you transfer note to this team, everyone on the web can find and read this note.

        Link with GitHub

        Please authorize HackMD on GitHub
        • Please sign in to GitHub and install the HackMD app on your GitHub repo.
        • HackMD links with GitHub through a GitHub App. You can choose which repo to install our App.
        Learn more  Sign in to GitHub

        Push the note to GitHub Push to GitHub Pull a file from GitHub

          Authorize again
         

        Choose which file to push to

        Select repo
        Refresh Authorize more repos
        Select branch
        Select file
        Select branch
        Choose version(s) to push
        • Save a new version and push
        • Choose from existing versions
        Include title and tags
        Available push count

        Pull from GitHub

         
        File from GitHub
        File from HackMD

        GitHub Link Settings

        File linked

        Linked by
        File path
        Last synced branch
        Available push count

        Danger Zone

        Unlink
        You will no longer receive notification when GitHub file changes after unlink.

        Syncing

        Push failed

        Push successfully