Search code examples
drupalcdnamazon-cloudfront

Is CDN helping server in terms of performance and RAM?


I'm planning to move my website files into a CDN system, i'm running 4 drupal websites and 1 wordpress. I was thinking to use Amazon Cloud Front. I have a some questions:

Is the CDN system helping my server in terms of performance and RAM? I'm using http://www.webpagetest.org to see the performance of the website, and the 83% of the requests comes from the images. The rest is between html, css, js and other. this is the other result

F = First Byte Time
A = Keep-alive Enabled
F = Compress Text
C = Compress Images
A = Cache static content
X = CDN detected

Is it possible, using amazon CloudFront, to put on cloud a website inside a sub-folder? Basically I want to test it in a non-production site.

My server is a r310 quad core xeon 2.66 with 4gb of ram.

Thanks in advance


Solution

  • The answer should be much long to describe this I think, but in simple terms, a well-manaed CDN can help you to make your site faster. 4GB of RAM is not bad for a normal web site.

    There are 3 main reasons to use a CDN that i can think about. 1. To deliver static content faster using nearby servers. 2. To avoid the browser from sending cookies to each GET request. 3. To take off some of the Apache load.

    1 - I haven't used cloudfront but some akamai servers and they do make a difference. They simple gives content in a different and nearby server so file loading is relatively fast. But don't forget that this adds additional ip lookups if the user is loading site for the first time after a dns cache clean up.

    2 - I think you know the cookie-less domain problem. If you host your site in example.com and images are in example.com/image.png like structure, browser should send the cookie info on each page request. They are usually ~100 bytes of data but when it comes to many assets, this is something worth considering. If you take off them to example-data.com domain, browser will not send the cookies to assets in this location. Faster pages.

    3 - Your web server load is the other benefit. Your server will get less requests (mainly html requests) and images and other assets will be served from another server.