Performance Test on a page - Cloudflare VS Bare Nginx

Table Of Contents

Summary

After doing the load balancing in the last post, I pointed the domain to the CNAME record of the balancer and did some Web Speed Tests1.

Tried comparing the site speed with and without Clouflare CDN using an older version of that post. I have to say, Cloudflare makes the site slower with longer waiting time resulting in a longer TTFB. With the proxy_cache in Nginx, the site without Cloudflare CDN is generally faster. So the site is now running without Cloudflare CDN.

I ran the tests of the old version of the last post on KeyCDN1, the test results I need is shown below. The meaning of the table headers:

  • CF Dev: The page under Cloudflare Development Mode, where the CDN is used without its caching feature, thus the speed is similar to a site on the CDN visited for the first time when the caching is happening.
  • CF Cache: The page visited from cloudflare cache.
  • Nginx 1st: The page served directly by the nginx on the server without cached content.
  • Nginx Cache: The page served directly by the nginx on the server with saved caches.
  • The page: The loading time of the tested post page, in the other words, the html code of the post. This time includes the time of Blocked, DNS, Connect, SSL, Wait and Receive of the domain per request.
  • CSS: The loading time of the stylesheet all.css.
  • The images: The loading time of the image taking the longest time to load.
  • Isoo data 1: The loading time of the first data request of the isso responded with (a json).
  • Isoo data 2: The loading time of the second data request of the isso responded with (html code).
  • Total Time: The total loading time of the whole page with all the elements.
  • Total Time Without Woff2: Total Time minus the loading time of the two google font woff2 files.

Tests

Amsterdam

CF DevCF CacheNginx 1stNginx Cache
The page249.6 ms279.3 ms202.44 ms479.2 ms
CSS174.2 ms203.6 ms52.5 ms145.7 ms
The images194.956 ms227.1 ms192.2 ms590.0 ms
Isso data 134.5 ms145.7 ms46.6 ms466.9 ms
Isso data 237.3 ms143.823 ms47.2 ms486.3 ms
Total Time6.6 s942.8 ms9.6 s4.3 s
Total Time Without woff20.7 s879.7 ms0.6 s1.75 s
Original resultThe imageThe imageThe imageThe image

This region......Hmm...... Some occasional things happened in it multiple times. Long loading time for google fonts, slow response from Nginx cache.
Regardless, in this region CloudFlare won 1 score.

Score Table:

CloudFlareNginx
10

Bangalore

CF DevCF CacheNginx 1stNginx Cache
The page1.8 s1.5 s1.1 s1 s
CSS1.5 s111 ms792.0 ms227.7 ms
The images1.7 s213 ms1.5 s940.1 ms
Isso data 11.1 s594.7 ms565.4 ms561.5 ms
Isso data 2560.974 ms1.1 s565.7 ms551.7 ms
Total Time4.4 s2.8 s2.8 s2.5 s
Total Time Without woff24.4 s2.7 s2.8 s2.5 s
Original resultThe imageThe imageThe imageThe image

Clearly in this region Nginx won 1 score.

Score Table:

CloudFlareNginx
11

Dallas

CF DevCF CacheNginx 1stNginx Cache
The page1.2 s900.8 ms797.4 ms610.9 ms
CSS912.2 ms72.9 ms510.3 ms79.4 ms
The images1.1 s89.5 ms953.0 ms327.8 ms
Isso data 1469.2 ms594.2 ms414.2 ms424.6 ms
Isso data 2602.2 ms429.0 ms417.4 ms417.5 ms
Total Time2.9 s1.7 s2 s1.4 s
Total Time Without woff22.9 s1.67 s2 s1.4 s
Original resultThe imageThe imageThe imageThe image

In this region Nginx won 1 score.

Score Table:

CloudFlareNginx
12

Frankfurt

CF DevCF CacheNginx 1stNginx Cache
The page283.1 ms278.9 ms309.5 ms257.3 ms
CSS124.4 ms12.6 ms39.0 ms35.2 ms
The images156.7 s12.5 ms154.5 ms137.7 ms
Isso data 195.3 ms98.0 ms34.1 ms34.2 ms
Isso data 2101.1 ms31.5 ms36.0 ms34.3 ms
Total Time709.1ms623.0 ms684.0 ms704.3 ms
Total Time Without Woff2644 ms579.7 ms628 ms557 ms
Original resultThe imageThe imageThe imageThe image

Nginx won 1 score.

Score Table:

CloudFlareNginx
13

London

CF DevCF CacheNginx 1stNginx Cache
The page405.2 ms390.2 ms250.8 ms229.0 ms
CSS200.2 ms11.1 ms52.1 ms47.3 ms
The images227.5 ms38.4 ms198.6 ms194.7 ms
Isso data 139.5 ms152.2 ms48.6 ms46.5 ms
Isso data 2145.9 ms156.5 ms49.5 ms47.0 ms
Total Time1 s879.5 ms749.5 ms641.0 ms
Total Time Without Woff2960 ms829.5 ms723.5 ms594.0 ms
Original resultThe imageThe imageThe imageThe image

Nginx won 1 score.

Score Table:

CloudFlareNginx
14

Miami

CF DevCF CacheNginx 1stNginx Cache
The page1.2 s959.0 ms638.3 ms554.8 ms
CSS951.1 ms8.8 ms527.0 ms70.71 ms
The images1.1 s16.0 ms937.4 ms300.1 ms
Isso data 1427.7 ms600.9 ms461.6 ms408.8 ms
Isso data 2415.8 ms614.4 ms458.0 ms413.2 ms
Total Time2.7 s1.8 s1.9 s1.4 s
Total Time Without Woff22.7 s1.8 s1.9 s1.4 s
Original resultThe imageThe imageThe imageThe image

That awfully long waiting time to receive the page can't be saved by the fast speed of static cache...... Clearly Nginx won 1 score.

Score Table:

CloudFlareNginx
15

New York

CF DevCF CacheNginx 1stNginx Cache
The page1 s1 s699 ms225.6 ms
CSS943.3 ms12.0 ms399.2 ms67.6 ms
The images1.2 s18.3 ms945.5 ms274.1 ms
Isso data 1426.3 ms418.4 ms403.2 ms394.8 ms
Isso data 2421.9 ms613.1 ms395.2 ms411.9 ms
Total Time2.4 s1.8 s1.7 s1 s
Total Time Without Woff22.4 s1.8 s1.7 s1 s
Original resultThe imageThe imageThe imageThe image

CloudFlare behaved like a shit on the initial waiting time again which the impressive caching speed can't save...... Nginx won 1 score.

Score Table:

CloudFlareNginx
16

Paris

CF DevCF CacheNginx 1stNginx Cache
The page319.8 ms284.9 ms187.5 ms501.5 ms
CSS244.0 ms10.6 ms46.9 ms148.0 ms
The images305.9 ms38.7 ms174.1 ms611.7 ms
Isso data 147.4 ms174.9 ms43.9 ms478.6 ms
Isso data 2185.11 ms189.7 ms44.3 ms490.5 ms
Total Time1.1 s810.66 ms635.29 ms1.7 s
Total Time Without Woff21.1 s755.46 ms569.5 ms1.7 s
Original resultThe imageThe imageThe imageThe image

Considering something occasional happened to the Nginx Cache, CloudFlare won this round.

Score Table:

CloudFlareNginx
26

San Francisco

CF DevCF CacheNginx 1stNginx Cache
The page1.2 s892.2 ms741.0 ms414.5 ms
CSS741.2 ms752.9 ms349.8 ms13.0 ms
The images920.4 ms988.4 ms892.0 ms58.4 ms
Isso data 1350.1 ms392.6 ms362.0 ms357.6 ms
Isso data 2370.1 ms386.9 ms355.6 ms345.1 ms
Total Time2.4 s2.2 s1.8 s1.1 s
Total Time Without Woff22.4 s2.2 s1.8 s1.093 s
Original resultThe imageThe imageThe imageThe image

This round something occasional happened to CloudFlare. Nginx hit Cloudflare so hard and won 1 score.

Score Table:

CloudFlareNginx
27

Seattle

CF DevCF CacheNginx 1stNginx Cache
The page918.3 ms902.7 ms741.0 ms469.6 ms
CSS852.1 ms13.6 ms349.8 ms48.3 ms
The images1.1 s38.5 ms892.0 ms199.0 ms
Isso data 1513.8 ms522.9 ms362.0 ms393.0 ms
Isso data 2398.3 ms395.5 ms355.6 ms384.4 ms
Total Time2.4 s1.6 s1.8 s1.2 s
Total Time Without Woff22.4 s1.6 s1.8 s1.18 s
Original resultThe imageThe imageThe imageThe image

Nginx won 1 score in a similar way as usual.

Score Table:

CloudFlareNginx
28

Singapore

CF DevCF CacheNginx 1stNginx Cache
The page1.7 s1.7 s1.2 s1.2 s
CSS1.4 s13.2 ms530.5 ms189.3 ms
The images1.6 s23.4 ms1.3 s777.1 ms
Isso data 1529.6 ms1.1 s520.2 ms515.6 ms
Isso data 21 s532.8 ms511.5 ms525.3 ms
Total Time4.4 s3 s2.8 s2.5 s
Total Time Without Woff24.4 s2.97 s2.8 s2.5 s
Original resultThe imageThe imageThe imageThe image

When it comes to the global speed, CloudFlare slows down it even more...... Nginx won 1 score.

Score Table:

CloudFlareNginx
29

Sydney

CF DevCF CacheNginx 1stNginx Cache
The page1.4 s1.4 s1.1 s1 s
CSS1.4 s9.6 ms730.6 ms176.6 ms
The images1.5 s17.6 ms1.2 s738.7 ms
Isso data 1509.6 ms1.1 s498.9 ms497.6 ms
Isso data 2491.7 ms1 s517.4 ms507.7 ms
Total Time3.5 s4.1 s2.6 s2.3 s
Total Time Without Woff23.5 s4.0 s2.6 s2.3 s
Original resultThe imageThe imageThe imageThe image

Something occasional happened to Cloudflare again. Nginx won 1 score.

Score Table:

CloudFlareNginx
210

Tokyo

CF DevCF CacheNginx 1stNginx Cache
The page1.2 s1.2 s1.2 s800.5 ms
CSS1.1 s1.1 s585.8 ms129.0 ms
The images1.3 s1.3 s1 s529.3 ms
Isso data 1456.0 ms468.4 ms459.8 ms461.0 ms
Isso data 2781.7 ms794.8 ms473.7 ms451.9 ms
Total Time3.2 s3.2 s2.4 s1.8 s
Total Time Without Woff23.2 s3.2 s2.4 s1.8 s
Original resultThe imageThe imageThe imageThe image

CloudFlare cache seems not working in Tokyo? Nginx won 1 score.

Score Table:

CloudFlareNginx
211

Toronto

CF DevCF CacheNginx 1stNginx Cache
The page918.3 ms1.1 s703.6 ms494.2 ms
CSS852.1 ms10.0 ms401.6 ms71.8 ms
The images1.1 s25.2 ms924.8 ms279.0 ms
Isso data 1513.8 ms619.7 ms412.5 ms412.4 ms
Isso data 2398.3 ms629.4 ms395.4 ms404.9 ms
Total Time2.4 s1.9 s1.8 s1.2 s
Total Time Without Woff22.4 s1.83 s1.8 s1.2 s
Original resultThe imageThe imageThe imageThe image

Nginx won 1 score again in a usual way.

Score Table:

CloudFlareNginx
212

Result

Score Table:

CloudFlareNginx
212

CloudFlare only won two rounds, when something occasional happened. So that result is, almost a total win for bare Nginx. I believe with only one server behind the CloudFlare, Cloudflare will behave worse since there will be some longer paths for CloudFlare to receive responses from thus resulting in a longer waiting time. But CloudFlare is okay as a free service, while I can't expect too much from it with so many users on it. I'm still a user of their DNS. Their DNS is famous for its fast speed.