Randomly very high response time


#1

I’ve noticed a strange problem since enabling cloudflare, every few refreshes there will be one that is inexplicably much slower.

Connecting directly to the origin ip, every request looks good in chrome:

Connecting through cloudflare, most of the requests are fine:

However, every 5th refresh or so (not consistent, seems random) the latency will be extremely high:

Since this doesn’t ever happen when connecting to the origin directly, it must be a problem with cloudflare. Did I configure something wrong? Or is that just how it works on the free plan?


#2

Is this a cached asset? I’d check the headers for cf-cache-status to see if there’s a difference. And other cf headers as well, though cache-status is my first choice.

Is it ~every fifth “forever”? i.e. ~5th, ~10th, ~15th, etc. So after the 5th, you keep going and it’s a semi-repeating pattern?

The Free Plan shouldn’t matter. Performance should be consistent for any plan.

And out of curiosity, is it proportionally slower, or does it always tack on an extra ~300ms regardless of the size?


#3

No, it isn’t cached (the origin sends a cache-control: no-cache max-age=0 header).
Cached files always load crazy fast, something like 20ms.

There doesn’t seem to be any pattern, but on average about every 5th request is slow. For example, I measured 50 requests:

371
376
103
360
101
101
372
100
109
109
105
364
105
103
362
100
385
115
117
104
385
148
124
106
110
109
111
106
106
104
109
115
103
101
108
109
107
368
102
374
108
107
109
382
366
106
107
108
367
105

12 of them were slow for… some reason. Connecting to the origin directly, all 50 requests were ~100ms.

The size doesn’t seem to matter, only the latency until the download starts is increased.


#4

At least it’s reproducible. I suggest you open a Support ticket and see what they say. I’d love to hear an explanation for this.


#5

Maybe this could have something to do with cloudflare having to start a TLS connection with the origin from different edge servers, and the ones that already have one are then fast?

I didn’t realize there were support tickets for the free plan, I’ll do that right away.