Search This Blog

Case Study: Slow static websites & it's solution using CDN

Problem Statement: 

There is too many static data on server and loading complete page with lots of static content takes around 6 seconds to load the site. In case of video and heavy images load time is even higher. Pages like photo gallery video content are too slow if user is requesting the content from different location than hosted server. Server is also not able to take the load of concurrent requests coming in. 

Possible Solutions & their cost effectiveness: 

Add additional servers: 

Add additional server and introduce the load balancer in-order to share the load. 

Cost: Incur extra code to add additional server. 

Risks: 
  • In case when server get down. 
  • Even after adding additional servers site will still be slow if user will access the site from different zone than the hosting environment. 
Effectiveness: Not seems like a robust solution, as there is a high risk in case of server failure.

 Procure CDN services: 

Risks: In case of high usage from different location cost may shoot up. Cost: In general CDN cost you based on usages (pay per use). 

Cost: depends on the data downloaded from CDN server. So in case of static content cost should not be too high. We can setup different alert with CDN vendor to keep an eye on cost. 

Effectiveness: Highly effective solution in term of performance, availability. 

Why CDN Solution: CDN is a large distributed system of servers deployed in multiple data centers across the Internet and serve the content with high availability and high performance. Pushing data to CDN will solve the problem with minimum risk and maximum performance considering risk, cost and effectiveness. 

Still we need to consider some solution for dynamic pages.