Benchmarking Firebase Hosting vs Cloudflare

I’ll preface by saying this is a hobby site and the benchmarking is a bit academic. But the results did discourage me from migrating.

I could use feedback on the benchmark methods and results

METHODS

I tested using Chrome Network panel + Apache bench (ab) . The ab results are below. Chrome Network panel results were similar.

The ab command does 100 requests with 10 concurrency.

# Firebase Hosting
$ ab -n100 -c 10  https://tonym.us/
# Cloudflare Pages
 ab -n100 -c 10  https://tonym-us.pages.dev/

Results Summary

:1st_place_medal:Firebase was the winner at median 112ms (sd = 13.7) vs :wastebasket:Cloudflare 254 ms (sd=62.1)

Adhoc testing also showed more variance.

FIREBASE HOSTING
              min  mean[+/-sd] median   max
Total:         93  114  13.7    112     155

CLOUDFLARE PAGES
              min  mean[+/-sd] median   max
Total:        173  254  62.1    254     412
 

Full Results

FIREBASE

              min  mean[+/-sd] median   max
Total:         93  114  13.7    112     155

Server Software:
Server Hostname:        tonym.us
Server Port:            443
SSL/TLS Protocol:       TLSv1.3,TLS_AES_256_GCM_SHA384,2048,256
Server Temp Key:        X25519 253 bits
TLS Server Name:        tonym.us

Document Path:          /
Document Length:        70099 bytes

Concurrency Level:      10
Time taken for tests:   1.322 seconds
Complete requests:      100
Failed requests:        0
Total transferred:      7067074 bytes
HTML transferred:       7009900 bytes
Requests per second:    75.66 [#/sec] (mean)
Time per request:       132.177 [ms] (mean)
Time per request:       13.218 [ms] (mean, across all concurrent requests)
Transfer rate:          5221.35 [Kbytes/sec] received

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:       33   49   7.7     48      68
Processing:    48   65   9.6     64      90
Waiting:       28   41   7.1     40      68
Total:         93  114  13.7    112     155

Percentage of the requests served within a certain time (ms)
  50%    112
  66%    117
  75%    124
  80%    127
  90%    133
  95%    143
  98%    152
  99%    155
 100%    155 (longest request)
 

CLOUDFLARE Pages

              min  mean[+/-sd] median   max
Total:        173  254  62.1    254     412
 
Server Software:        cloudflare
Server Hostname:        tonym-us.pages.dev
Server Port:            443
SSL/TLS Protocol:       TLSv1.3,TLS_AES_256_GCM_SHA384,256,256
Server Temp Key:        X25519 253 bits
TLS Server Name:        tonym-us.pages.dev

Document Path:          /
Document Length:        70099 bytes

Concurrency Level:      10
Time taken for tests:   2.839 seconds
Complete requests:      100
Failed requests:        0
Total transferred:      7085650 bytes
HTML transferred:       7009900 bytes
Requests per second:    35.22 [#/sec] (mean)
Time per request:       283.948 [ms] (mean)
Time per request:       28.395 [ms] (mean, across all concurrent requests)
Transfer rate:          2436.92 [Kbytes/sec] received

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:       42   76  28.5     60     142
Processing:   127  178  43.7    164     299
Waiting:       70  144  31.3    140     272
Total:        173  254  62.1    254     412

Percentage of the requests served within a certain time (ms)
  50%    254
  66%    276
  75%    291
  80%    303
  90%    339
  95%    406
  98%    409
  99%    412
 100%    412 (longest request)

Corroborations

This benchmark review site also shows similar performance comparison

[Firebase vs Cloudflare Pages - Bejamas](https://bejamas.io/compare/cloudflare-pages-vs-firebase/)

Questions

  • Do the .dev URLs have throttling?
  • Are there other throttles / budget restrictions in place (e.g. this site was just set up).

I confirmed with HTTP response headers that both hosts were serving requests from the PDX datacenter.