[TW]
維持每天一百萬的訪問者網站需要多少費用?
我假設您是在詢問技術/託管方面的問題。因此,我們將不包括管理,營銷費用,錯誤修復和開發等費用-視網站而定可能會有很大差異。讓我們只專注於託管方面。我將向您介紹如何計算費用的方法,並且可以為您需要的網站進行計算。
為簡單起見,假設我們正在談論分類廣告網站,用戶在該網站上發布有關他們要出售的商品的廣告。其他用戶看著他們。它將託管在Azure雲平台上,因此我使用Azure定價計算器[1]。
網絡數據傳輸–入站和出站
讓我們做數學。根據HttpArchive報告[2],截至2019年,平均頁面大小為2 MB。平均而言,它分為:
CSS – 65 kB。
字體– 120 kB。
HTML – 27 kB。
圖片– 1 MB。
JavaScript – 400 kB。
此內容分為動態(專門為特定用戶生成的HTML)和靜態(如圖像,CSS,字體等)。
根據Alexa的熱門網站,排名前50位的網站平均每個訪問者的每日頁面瀏覽量為4.5,因此,假設您每個訪問者的平均每日頁面瀏覽量也為4.5。
1 Millon訪問者為您帶來1000000 * 4.5 = 4.5M的每日頁面瀏覽量,即4.5M /(24 * 60 * 60)=每秒50個頁面瀏覽量。
請記住,每個頁面都是2 MB,所以2 MB * 50 * 60 * 60 * 24 * 31 =每月流量267 TB。假設其中一半存儲在客戶的計算機上,那麼我們需要購買大約100 TB的流量。根據Azure流量計算器(來自Azure數據中心的流量),每月可獲得8000美元。
計算成本–處理數據的虛擬機
想像一下,我們有一個Azure虛擬機D2,它具有7 GB RAM和2個內核,可以很好地處理您的負載(每秒50次頁面瀏覽),而無需處理太多數據。每月費用為200美元。
數據庫成本(假設我們將使用關係數據庫)來存儲與用戶相關的數據
假設我們的網站有1000萬註冊用戶。它們每個都有1 KB的文本數據(它們的廣告,登錄信息等)。它為我們提供了1 000 * 10 000 000 / 1GB = 10 GB的數據庫數據。根據Azure數據庫的定價,具有32 GB存儲的SQL數據庫實例的每月費用為1400美元。
CDN存儲靜態數據(如字體,圖像等)的成本
假設每1000萬註冊用戶平均擁有2 MB的圖像數據(其商品的照片)。需要10000000 * 2000000/1000000000000 = 20 TB的數據存儲在CDN中。在Azure中,北美的1區CDN每月需要花費1500美元。
總結起來,每月可得到$ 8000 + $ 200 + $ 1400 + $ 1500 = $ 11K。
如您所見,這是一個非常初步的估計–根據網站的體系結構,業務模型等,您可以包括更多內容。我的目標是為您提供一種方法,以便您可以計算特定網站的維護成本。
腳註
[1]定價計算器|微軟Azure
[2]頁面重量
[US]
How much does it cost to maintain a 1 million - daily visitor website?
I assume you are asking about the technical/hosting side of things. So we won’t include management, marketing expenses, bug fixing and development etc – it may differ a lot depending on a website. Let’s just focus on hosting side of things. I’ll show you the method how to calculate the cost and you can calculate for the website you need.
For a simplicity, assume we are talking about classified ads websites where users post advertisements about goods they want to sell. Other users look at them. It’d be hosted on Azure cloud platform so I use Azure pricing calculator[1] .
Network data transfer – inbound and outbound
Let's do the math. According to HttpArchive report[2] , average page size as per 2019 is 2 MB. In average, it splits into:
CSS – 65 kB.
Fonts – 120 kB.
HTML – 27 kB.
Images – 1 MB.
JavaScript – 400 kB.
This content splits into dynamic (HTML generated specifically for a certain user) and static (like images, CSS, fonts, etc).
According to Alexa top sites , top 50 websites have in average 4.5 daily page views per visitor, so let’s assume you’d have 4.5 daily page views per visitor as well.
1 millon visitors gives you 1 000 000 * 4.5 = 4.5M in daily page views that is 4.5M/(24*60*60) = 50 page views per second.
Remember, each page is 2 MB, so 2 MB * 50 * 60 * 60 * 24 * 31 = 267 TB of traffic per month. Assume half of this is cached on clients’ computers, so roughly 100 TB of traffic we’d need to buy. This gives $8000 per month according to Azure traffic calculator (a traffic from Azure data center).
Computational costs – virtual machine to process the data
Imagine we’d have an Azure virtual machine D2, with 7 GB RAM and 2 cores that should be fine to handle your load (50 page views per second) without very much processing data. It costs $200 per month.
Database costs (assume we’d use relational database) to store user-related data
Let's say our website has 10 million registered users. Each of them has 1 KB of text data (their advertisements, login information, etc). It gives us 1 000 * 10 000 000 / 1GB=10 GB of data in the database. According to Azure database pricing, an SQL database instance with 32 GB storage costs $1400 per month.
CDN costs to store static data like fonts, images, etc
Let’s say each of 10 million registered users has in average 2 MB of image data (photos of their goods). It requires 10000000*2000000/1000000000000 = 20 TB of data to be stored in CDN. In Azure, Zone 1 CDN in North America would cost us $1500 per month.
Summing it all up, it gives us $8000 + $200 + $1400 + $1500 = $11K per month.
As you can see, this is a very preliminary estimate – you could include a lot more, depending on website architecture, business model, etc. My goal was to give you a method so you can calculate a maintenance cost for your specific website.
Footnotes
[1] Pricing Calculator | Microsoft Azure
[2] Page Weight
No comments:
Post a Comment
Note: Only a member of this blog may post a comment.