TungNT (Blue)

tungnt.blue@gmail.com

User Tools

Site Tools


development:tps-qps

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
development:tps-qps [2024/08/21 07:40] – [Công thức] tungntdevelopment: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/300 = 0.03 lượt+  * QPS (TPS) = 10/300 = 0.003 lượt
  
 > **QPS (TPS) = Concurrent/RT** > **QPS (TPS) = Concurrent/RT**
Line 37: Line 37:
 > 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/RT = 92.5
 +  * 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.1724226022.txt.gz · Last modified: 2024/08/21 07:40 by tungnt

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki