development:tps-qps
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
development:tps-qps [2024/08/21 07:39] – [Công thức] tungnt | development:tps-qps [2024/08/21 07:50] (current) – [Bài toán] tungnt | ||
---|---|---|---|
Line 30: | Line 30: | ||
* Concurrent = 10 | * Concurrent = 10 | ||
* RT = 5*60 = 300s | * RT = 5*60 = 300s | ||
- | * QPS (TPS) = 10/(5*60) | + | * QPS (TPS) = 10/300 = 0.003 lượt |
- | > QPS (TPS) = Concurrent/ | + | > **QPS (TPS) = Concurrent/ |
====== Bài toán ====== | ====== Bài toán ====== | ||
> Theo định luật 20/80 vào thời gian cao điểm hệ thống, trên một Server duy nhất có PV (page view) mỗi ngày là 2.000.000. Thì Server này cần bao nhiêu QPS? Giả sử mỗi Server chịu được 60 QPS thì cần bao nhiêu Server? | > Theo định luật 20/80 vào thời gian cao điểm hệ thống, trên một Server duy nhất có PV (page view) mỗi ngày là 2.000.000. Thì Server này cần bao nhiêu QPS? Giả sử mỗi Server chịu được 60 QPS thì cần bao nhiêu Server? | ||
+ | * PV = 2000000 | ||
+ | * CONCURENT = PV * 80% | ||
+ | * RT = 86400 * 20% | ||
+ | * QPS = CONCURENT/ | ||
+ | * SV = QPS/60 = 92.5/60 ~ 2 (Cần 2 Server) | ||
+ | **Để cải thiện QPS cần:** | ||
+ | * Tăng CONCURENT: Tăng luồng xử lý đồng thời (thread), mở rộng Backend,... | ||
+ | * Giảm RT: tối ưu giảm thời gian xử lý - sử dụng cache, tối ưu hoá CSDL, tối ưu hoá code, giảm response không cần thiết, đẩy nhanh tác vụ (sử dụng rabbitmq, kafka, |
development/tps-qps.1724225982.txt.gz · Last modified: 2024/08/21 07:39 by tungnt