Home > Paid Traffic Sources > POP / PPV / Redirect

CDN was Slower than Direct to Server (1.67s versus 716ms). Help Please! (19)


01-04-2019 02:04 AM #1 grofit (AMC Alumnus)
CDN was Slower than Direct to Server (1.67s versus 716ms). Help Please!

Hi,
I've been running landers using the following configuration

Server - Amazon S3
CDN - Amazon CloudFront
DNS - Amazon Route 53
Domain Registrar - NameCheap

To test load time, I'm
i). Opening a New Incognito Chrome Window on my Desktop computer
ii). Opening Developer Tools (Contol-Shift-i) and looking at the network tab
iii). Entering the URL


The Issue is that I've run this Lander before (for months) on another geo and it currently has
* 336ms load time through CDN (cloudfront).
* 1.03s load time direct from the server (going direct to S3 bucket)

Click image for larger version. 

Name:	OldLander_20190104.jpg 
Views:	43 
Size:	29.8 KB 
ID:	20282

Click image for larger version. 

Name:	OldLander-Direct_20190104.jpg 
Views:	24 
Size:	28.4 KB 
ID:	20283

BUT, I just setup the SAME lander on a new Domain in a New Geo yesterday using the same configuration (so new Domain, Amazon S3, Cloudfront, Route53) and am getting
* 1.67s load time through CDN (cloudfront).
* 716ms load time direct from the server (going direct to S3 bucket)

The CDN is slower than going Direct!!!

I've also checked, and yes the CDN (cloudfront) is setup and getting traffic (see usage report below)


Click image for larger version. 

Name:	NewLander_20190104.jpg 
Views:	25 
Size:	27.8 KB 
ID:	20284

Click image for larger version. 

Name:	NewLander-DirectToS3_20190104.jpg 
Views:	24 
Size:	29.6 KB 
ID:	20285

Click image for larger version. 

Name:	CDN-Usage_20190104.jpg 
Views:	17 
Size:	207.5 KB 
ID:	20286


Anyone know what is happening?

Is it that the Amazon Cloudfront and Route53 DNS combo taking time to deploy since I bought and setup the domain less than 12 hours ago?
OR something else

Any ideas on how to fix it?

Any help would really be appreciated!!!

thanks!


01-04-2019 04:32 AM #2 thedudeabides (Moderator)

Looks like the CDN hasn't built up its cache yet? As far I understand it, the first request(s) to each region the CDN is in bypass it and go directly to the origin server to grab its contents, before subsequent requests all go through the CDN.

If you look at the first and second screenshots for the CDN load time, the only difference is that in the second example the response time grew from 45ms to 1.3seconds, which doesn't make sense for a CDN to take that long to respond if it's pulling from cache.

I prefer Cloudflare + Netlify for hosting all my stuff. Much easier to setup, their DNS is already super fast (see https://www.dnsperf.com/), and Netlify uses amazon cloudfront to host assets + global load balancing to digital ocean servers for html files (last I read). And it's all free.


01-04-2019 07:11 AM #3 grofit (AMC Alumnus)

Hi thedudeabides - I've actually been calling that page a lot this afternoon (maybe 20 to 30 times while testing) ... so it should have cached to the local region.

At the moment I'm planning to give it a few more hours and then delete and redo the Route53 and Cloudfront Settings - maybe something went wrong setting it up.

BTW - have you done a test to see if Amazon S3/Cloudfront is faster or slower than your Cloudflare/Netlify?


01-04-2019 07:39 AM #4 grofit (AMC Alumnus)

UPDATE: About 24 Hours After I Setup CDN

Time For Page to Load Now Is
Domain 1 - now about 600ms
Domain 2 - now about 600ms
Domain 3 - now about 300ms
Domain 4 - now about 600ms

NB: I setup 4 domains at the same time to have some backups just in case :-)

So From Hour 0 to 24 - Domain 1 was 1.67s to load
And Now at Hour 24 - Domain 1 is now at 600ms to load the page
And Now at Hour 24 - Domain 3 is now at 300ms to load the page

NB: The Older Domains are loading that page at about 300ms so might need to wait a few more hours for the other Domains (1,2,4) to catchup.

So it looks like there maybe a delay of 24+hours from the time you actually setup on Amazon Cloudfront with Route53 until it becomes fully functional.

Which I think is a big deal since:
1). Running a test in the first 24 hours and not realizing the load times are so bad will mean you'll probably get bad results even if the campaign had potential
2). If a domain goes down and needs to be replaced, you NEED to have one ready to replace it and not just set one up then and there (otherwise the first day performance is going to suck)

My to do:
1). Going to put checking performance onto the checklist of any backup domains I setup - before I clear them as ready to use.

QUESTIONS FOR EVERYONE
1). Has anyone else using Amazon Cloudfront/Route53 have this happen to them?
2). Has anyone else using other CDNs seen this happen (i.e. delay from setup to actual deployment)?

Thanks - Suneel


01-07-2019 12:32 AM #5 vortex (Senior Moderator)

So it looks like there maybe a delay of 24+hours from the time you actually setup on Amazon Cloudfront with Route53 until it becomes fully functional.

Which I think is a big deal since:
1). Running a test in the first 24 hours and not realizing the load times are so bad will mean you'll probably get bad results even if the campaign had potential
2). If a domain goes down and needs to be replaced, you NEED to have one ready to replace it and not just set one up then and there (otherwise the first day performance is going to suck)

My to do:
1). Going to put checking performance onto the checklist of any backup domains I setup - before I clear them as ready to use.
Wow Suneel - that's a BIG tip! Thanks for sharing. I'll link to your post from the 40-day tutorial.




Amy


01-07-2019 04:19 AM #6 zeno (Administrator)

The large wait times in the CDN network timing breakdown suggests it is doing something it shouldn't be doing, e.g. contacting your origin (S3) to check content, fetch a resource, compare expiry dates, etc. If that is happening it points to inappropriate config somewhere.

The resource loading from the CDN should almost always show lower initial connect, wait and content download times, as the servers are going to be closer to you (and virtually every other requester) than your origin.


01-07-2019 12:05 PM #7 grofit (AMC Alumnus)

Hi Zeno,
That was what stumped me since 12 hours after I setup I was loading and reloading the pages on those domains and load times did not go down.

I did not change the config but 24 hours after setup it started working.

Don't know if it was a one off - or something that will happen again ... so I'm just going to be double checking before I launch more new domains on AmazonWS.

Of course it is getting expensive on a Brazilian Campaign (doing about 250k pops a day) so I'm looking to test other other methods which cost less with comparable performance.

At the moment thinking of testing
* Free CDNs
-- Cloudflare/Netlify - (except TOS limits it to 100GB bandwidth on free account I assume per month which is a little low)
-- looking at other options.
* Cheap Fast Server running in Brazil (e.g. Vultr, except the closest server vultr has to South America is in Miami :-( )

Has anyone tried either or have advice on cheaper options than AmazonWS?


01-07-2019 12:12 PM #8 grofit (AMC Alumnus)

Hi Amy,
Yeah - not sure if it was a once off, but I'm now double checking performance and load times before launching anything on new domains :-)


01-07-2019 10:07 PM #9 matuloo (Legendary Moderator)

Quote Originally Posted by grofit View Post
Don't know if it was a one off - or something that will happen again ... so I'm just going to be double checking before I launch more new domains on AmazonWS.
Would be great if you could do a similar test again when you are setting something up in the future, to see if it's a standard thing to happen or it was some kind of a problem.


01-08-2019 01:12 AM #10 grofit (AMC Alumnus)

Quote Originally Posted by matuloo View Post
Would be great if you could do a similar test again when you are setting something up in the future, to see if it's a standard thing to happen or it was some kind of a problem.
I'm setting up some more domains this week so will check and get back to you.


01-08-2019 04:34 AM #11 zeno (Administrator)

I think the most pragmatic option here is to just switch CDNs and keep the same origin, which will allow you to test a major change quickly.

I'd recommend using Cloudflare DNS > pointing it to your S3 bucket, orange cloud mode (i.e. so its actually caching) and using the default settings.

Just create a free account, add the domain and let it import records, change your NS at your registrar and you'll be virtually good to go.


01-08-2019 05:14 PM #12 theboss (Member)

Testing speed only from your own browser is really not a good practice. Too many variables.

Take a look at a load testing tool. I like this one: https://loader.io/


01-09-2019 12:31 PM #13 grofit (AMC Alumnus)

Retested on a new set of domains and could not repeat the issue.
It was working about 1 hours after setting up Amazon S3, Cloudfront, Route53 & Namecheap.

I don't know why is was an issue before.
I'll just add it to my checklist of things to check before launch, but may not happen again (or very often)


01-09-2019 02:45 PM #14 matuloo (Legendary Moderator)

Quote Originally Posted by grofit View Post
Retested on a new set of domains and could not repeat the issue.
It was working about 1 hours after setting up Amazon S3, Cloudfront, Route53 & Namecheap.

I don't know why is was an issue before.
I'll just add it to my checklist of things to check before launch, but may not happen again (or very often)
There was probably some issue or something simply went wrong from whatever reason ... your ISP could have had some problems too, sometimes they screw things up and it affects loading times / caching.

Still thanks for bringing this up, it's always good to double check everything before launching live campaigns

Matej.


01-10-2019 05:31 AM #15 vortex (Senior Moderator)

it's always good to double check everything before launching live campaigns
For this reason, I'm leaving that reference to this thread in the 40-day tutorial.



Amy


05-17-2019 06:18 AM #16 peweb2005 (Member)

Quote Originally Posted by zeno View Post
I think the most pragmatic option here is to just switch CDNs and keep the same origin, which will allow you to test a major change quickly.

I'd recommend using Cloudflare DNS > pointing it to your S3 bucket, orange cloud mode (i.e. so its actually caching) and using the default settings.

Just create a free account, add the domain and let it import records, change your NS at your registrar and you'll be virtually good to go.
What's the benefits of using Cloudflare DNS over Amazon CloudFront when using S3? Is it because, in fact, Cloudflare don't operate like a traditional Content Delivery Network? When you use ClaudFlare, as opposite to traditional CDN, when someone visits your site, it intercepts all incoming requests and acts as an intermediary server between the client and your host. With CDN the first request is made from the client to your hosting provider, and then to the CDN to fetch all of the assets. And, maybe, this is what gives CF an advantage.

I had mixed results using ClaudFlafe with WordPress - yes, it can speed up the website but their WAF did not help when a hacker put the website down for 3 hours asking for 10 BTC and the CF support did not help either (we were on business plan). I have no experience hosting stating landers, though, but I know they dont have Push like Amazon CF but they do have more server locations, especially in Asia.

I am not tech savvy but this comparison and an interactive map on https://www.codeinwp.com/blog/maxcdn...dge-vs-fastly/ could help.

Another option is to use classic CDN + ClaudFlare - https://www.keycdn.com/support/cloudflare-cdn - I am not sure if this setup would help with simple static landers but it will in case you use a sort of CMS.


05-22-2019 02:52 AM #17 zeno (Administrator)

Cloudflare acts as a reverse proxy for traffic itself, rather than just static assets like JS, CSS, etc. so its basically a "more thorough" CDN.

You are right that Cloudflare intercepts all incoming requests, but this is also the case with a normal CDN. At the DNS level some sub.domain.com can either point to your server or to the CDN hostname. When using a normal CDN the request goes to the CDN's edge servers, always. If that server has the asset cached it delivers it immediately, else it looks for the asset on your server (origin). The client never connects directly to your server as there is no pathway to that.

Cloudflare generally is a lot more powerful than any traditional CDN and doubles as your DNS platform as well. Its important to note Cloudflare will also provide SSL, avoiding the hassle of dealing with SSL certificates, and obscure your server IP, providing security by obfuscation.

As for the hacker issue... I doubt this has anything to do with Cloudflare and more to do with Wordpress itself and your specific setup. Likewise you couldn't blame Cloudflare for not preventing me physically walking up to your server in a rack and beating it with a baseball bat.

I wouldn't try to combine Cloudflare with another CDN. This is a bit pointless.

For the average affiliate and non tech-savvy person, Cloudflare is the best option. It's free, has an extremely large edge network, doubles as the DNS management centre, provides extra security and makes SSL trivial. It's a no brainer unless you have some specific reason that its not appropriate for your situation (e.g. you are doing mass video delivery in an obscure country where there is no Cloudflare edge server).


05-27-2019 08:30 AM #18 peweb2005 (Member)

Quote Originally Posted by zeno View Post
For the average affiliate and non tech-savvy person, Cloudflare is the best option. It's free, has an extremely large edge network, doubles as the DNS management centre, provides extra security and makes SSL trivial.
What is the best setup for S3 + CloudFlare + Voluum + SSL for PUSH traffic? Is there a guse here on STM (I can't find it)? I have just read @erikgyepes post suggesting to disable CF caching because of "Potential risk could be for example if you are sending ton of pop traffic to your domain and CloudFlare will detect this as DDOS attack, which wouldn't be a nice thing." so I am a bit confused.


07-04-2019 02:14 PM #19 osmiumman (Member)

Quote Originally Posted by zeno View Post
I'd recommend using Cloudflare DNS > pointing it to your S3 bucket, orange cloud mode (i.e. so its actually caching) and using the default settings.

Just create a free account, add the domain and let it import records, change your NS at your registrar and you'll be virtually good to go.
Thank you Zeno, I've now switched to this setup for my backup domain and for future LP domains.

Just in case anyone has the same problem:

I had some of my domains hosted on AWS S3 + Cloudfront.
I used one bucket per traffic source to make bucket management easier. But it seems since April 2019 you need to have certificates for domains that you want to add to a bucket, it's not possible anymore to just add alternate domains in the distribution settings at Cloudflare. I spent about 4 hours trying to make the certificates work (Amazon has own certificates) with no success.

So I ended up with your solution: S3 + Cloudflare.

One thing that I dislike is that you have to generate one bucket per domain, because otherwise it won't work (the bucket name must match your domain name (e.g. www.mydomain.com) and in properties you must enable "static website hosting" and from there you get the endpoint that you enter as DNS records (alias) at Cloudflare (e.g. http://www.mydomain.com.s3-website-u....amazonaws.com). At least now it works


Home > Paid Traffic Sources > POP / PPV / Redirect