ShareThis’ Experience Building Meteor Apps at Scale

由維傑·安娜·普萊迪

ShareThis 使用 Meteor 構建 Web 應用程式。Meteor 是一個用於在純 JavaScript 中建置 Web 和行動應用程式的完整堆疊平臺。Meteor 應用包括將在用戶端(瀏覽器)上運行的用戶端元件,它允許 Meteor 執行它所調用的資料庫。Meteor 將接受資料庫的子集並複製到用戶端。Meteor 應用程式將發送實際的原始資料,讓客戶端處理它,而不是將 HTML 代碼發送到用戶端。

因為 65% ShareThis '基礎架構在 Kubernetes 上運行,為了有效地使用 Meteor,我們需要大規模構建 Meteor 應用程式,並且能夠每月處理數百萬個請求。為此,我們首先載入測試了 Meteor 應用程式,並在存在大量併發請求時根據秒請求數觀察性能。為了從 MongoDB 的 UI 的後端呈現數據,Meteor 伺服器發布了一組記錄。我們的應用程式在流星上運行的回應時間,加上MongoDB,是不能令人滿意的。流星在以 125 的併發級別 125 的以 185 個請求/秒測試時,花了 1.5 秒更新 5,000 個 Mongo 文檔。理想的回應時間應低於 1 秒。

我們在庫伯奈斯大規模運行流星觀察到的重要事情是:
Meteor 的預設發表伺服器和訂閱無法即時呈現大量 MongoDB 更新
當負載均衡器後面並行運行多個 Meteor 實體時,Meteor 的 sock.js 和黏性工作階段要求使 UI 變得片狀

在此處閱讀更多有關我們擴展流星的方法以及我們對流星體系結構所做的更改:

About ShareThis

ShareThis has unlocked the power of global digital behavior by synthesizing social share, interest, and intent data since 2007. Powered by consumer behavior on over three million global domains, ShareThis observes real-time actions from real people on real digital destinations.

Subscribe to our Newsletter

Get the latest news, tips, and updates

Subscribe

Related Content