歡迎來到 https://hackmd.io/@coscup/2023 共筆

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More →

點擊本頁上方的 開始用 Markdown 一起寫筆記!
手機版請點選上方 按鈕展開議程列表。

請從這裡開始

傳統監控工具的挑戰:維運

Application <-> Cache <-> Database


系統上線之後的問題:

  1. 如何監控複雜的 APP
  2. 可視化的挑戰 (Dashboards)
  3. 大規模用戶負載的挑戰

大流量時會發生什麼事?

Load Balancer <-> App x N <-> Cache (2nd Dead) <-> DB (1st Dead)

在沒有測試的情況下,假設東西是壞的

If you haven't tried it, assume it's broken.

大規模用戶負載的挑戰:性能評估

  • 預防性的性能評估

    • 使用壓測工具模擬大量的併發使用者,並進行不同負載條件下的測試。
  • 故障排除和問題解決

    • 壓力測試可以重現間題,監控則可以提供實時敷摄以及性能損標的健化情況,從市更好地進行故障排除和商題解決。
  • 持續監控和迭代優化

    • 壓力測試可以定期執行,以確保素統在不同負載下的性能穩定性
    • 監控則可以提供實時數振,餵你能夠隨時了解素統的運作狀態

Load Testing

  • Smoke Testing:基本的功能測試
  • Load Testing:在一定負載的情況下,系統的支撐情況
  • Stress Testing:超出預期的負載,測試突然的極限可以支撐到哪邊 (e.g. 搶票系統)
  • Soak Testing:長時間的穩定性

吃飯類比:

  • Smoke Testing:慢慢吃
  • Load Testing:食量上限
  • Stress Testing:超過食量+塞
  • Soak Testing:80% 長時間

壓力測試要有目標

SLA
SLO

測試計畫,測試策略

VU Virtual User

極端情況看 90% 95%

其他的實作 demo slide

import http from 'k6/http';
import { sleep } from 'k6';
export const options = {
  vus: 10,
  duration: '30s',
};
export default function () {
  http.get('http://test.k6.io');
  sleep(1);
}

js <-> Go 的關鍵 GOJA
https://github.com/dop251/goja

官方資源有限

  • source code 建議可以挑這幾隻看:
    • K6.go
    • Executor.go
    • Http.go
    • Metrics.go
Select a repo