Skip to content

Instantly share code, notes, and snippets.

@wholly
Created November 15, 2009 16:59
Show Gist options
  • Save wholly/235331 to your computer and use it in GitHub Desktop.
Save wholly/235331 to your computer and use it in GitHub Desktop.
Deployment Architecture of Wholly
=================================
Front-End Webserver (NginX)
|
Load Balancer (HA Proxy)
|
|------------------------|--------------------------|
App Server1 App server2 App server3 (20 Thin Instances each)
|------------------------|--------------------------|
|
|
Object Cache Server (Memcached)
|
Database
& Search Indexes (MySql & Sphinx)
@parolkar
Copy link

========================================Infrastructure Cost Estimation======================================
Assumptions :
- 1 page view takes approx 16 hits to the server
- 1 page view has approx 700KB of download
- 1 page view requires 1.18KB of upload (http://gist.github.com/201946)

Stable Production Environment:
 - 2 Servers(each with 1.6G ram) running 16 thin processes each, (Total 32 thin processes)
 - Total of (1.6 + 1.6) 3.2 GB ram for application
 - 1 Database Server (MySQL)
 - 1 low-end machine running Front-end Server(Nginx) & Load balancer (HA Proxy) and Memchached 
 - Capacity of this entire scheme: 47.43 hits per second  (benchmark done with ApacheBench)



The Stable Production Environment cost

Capacity: 47.43 hits per second    
Which is,  47.43 * (60 * 60 * 24 * 30) = 122,938,560 hits/month  
which is, 122,938,560.00 / 16 = 7,683,660 page views / month


Compute Units 
    4 servers ($72/month each)  = $288

Bandwidth Out    
    7,683,660 pageviews of 700KB each [ (7,683,660 * 700) / 1 024 = 5,252,501 MB =   5,129 GB =  5TB ] 
                                     => $0.170 * 5,129 = $871.930

Bandwidth In    
    7,683,660  pageviews of 1.18KB each  [( 7,683,660  *1.18)/1024 = 8854.217 MB = 8.647 GB]   
                                     =  $0.100 per GB * 8.647 = $0.8647


Total Costs per month =   $288 + $871.930 + $0.8647 = $1160.8

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment