效能最佳化

監控與疑難排解 Azure 解決方案

Ebadur Osib

Senior Cloud Consulting Engineer

效能也是功能

慢速應用程式

 

  • 效能影響使用者信任。
  • 應用程式變慢會提高失敗率。
  • Azure 協助開發者最佳化:
    • 低延遲
    • 高流量
監控與疑難排解 Azure 解決方案

效能問題從哪裡來

效能問題來源

監控與疑難排解 Azure 解決方案

延遲 vs. 吞吐量

ThroughputvsLatency.jpg

監控與疑難排解 Azure 解決方案

優先最佳化關鍵路徑

最慢相依項

  • 最佳化從找出並縮短最慢路徑開始。
  • 不必對所有部分一視同仁地調校。
監控與疑難排解 Azure 解決方案

降低相依延遲

 

  • 相依服務是最常見的延遲來源。
  • 降低方法:
    • 查詢最佳化
    • 連線池化
    • 批次送出請求
    • 減少頻繁的小呼叫
  • 往往比擴增運算資源更有效。

降低延遲

監控與疑難排解 Azure 解決方案

快取

快取

監控與疑難排解 Azure 解決方案

Azure Cache for Redis

快取架構

1 https://learn.microsoft.com/en-us/azure/redis/architecture
監控與疑難排解 Azure 解決方案

Azure Managed Redis

受控 Redis 架構

1 https://learn.microsoft.com/en-us/azure/redis/architecture
監控與疑難排解 Azure 解決方案

快取設計考量

 

  • 快取會帶來重要的設計抉擇

  • 你必須為快取資料定義到期策略

  • 一致性新鮮度之間需要取捨。

  • 常見模式是旁路快取(cache-aside),僅在需要時載入快取。

快取雲端

  • 快取失效(cache invalidation)可確保過期資料被更新或移除。
監控與疑難排解 Azure 解決方案

節流與回壓

 

  • 請求過多會導致失敗。
  • 節流與回壓可保護系統。
  • 放慢或拒絕超量流量。

節流

監控與疑難排解 Azure 解決方案

非同步與佇列式模式

佇列

監控與疑難排解 Azure 解決方案

商業問題

商業問題

監控與疑難排解 Azure 解決方案

找出瓶頸

瓶頸

監控與疑難排解 Azure 解決方案

為規模與速度最佳化

最佳化

監控與疑難排解 Azure 解決方案

一起來練習吧!

監控與疑難排解 Azure 解決方案

Preparing Video For Download...