Home

Geeklog: What I Learnt Today / Adam

Trying out cloudflare

> This site is hosted on Dreamhost which is pretty neat hosting with just a minor problem for me. They are based in America, on the west coast this can make my ping times to server quite slow. I'm in Norfolk in the UK. It varies a bit but sometimes (on bad days when and when Americans are online) its been up to 1000 ms . Usually its better than that, at the moment its 175ms. Previously I added the pictures on my other site adamwilson.info to amazon S3 to bring them closer to the users. Each page on the site features quite a few images so using amazon to bring the images to a server near by speeded up the page load times quite a bit.
Note: Since I wrote this I had some issues with this cloudflare losing their dns connection to dreamhost and the original site. So I've shifted it off cloudflare for a bit whilst I figure that out.
So when I saw cloudflare I was quite interested to see how much difference it would make to the loading time of this site. I ran some simples tests before and after to see what difference it made along with a test of the same site on my local machine for comparison. I've bunged them in here if they are of any use to you.

------------------------------------------------------------------------
online at Dreamhost pre cloudfare
------------------------------------------------------------------------
Benchmarking geeklog.adamwilson.info (be patient).....done
Server Software: Apache Server Hostname: geeklog.adamwilson.info Server Port: 80
Document Path: / Document Length: 12018 bytes
Concurrency Level: 10 Time taken for tests: 8.023 seconds Complete requests: 100 Failed requests: 0 Write errors: 0 Total transferred: 1242420 bytes HTML transferred: 1218627 bytes Requests per second: 12.46 [#/sec] (mean) Time per request: 802.320 [ms] (mean) Time per request: 80.232 [ms] (mean, across all concurrent requests) Transfer rate: 151.22 [Kbytes/sec] received
Connection Times (ms) min mean[+/-sd] median max Connect: 174 182 4.7 181 202 Processing: 403 590 284.8 501 1608 Waiting: 216 346 289.9 263 1414 Total: 580 772 286.3 692 1792
Percentage of the requests served within a certain time (ms) 50% 692 66% 779 75% 792 80% 799 90% 848 95% 1748 98% 1779 99% 1792 100% 1792 (longest request)

this is the site on my testing server on localhost

-----------------------------------------------------------------------
On my mac Toby
-----------------------------------------------------------------------
Macintosh:~ Toby$ ab -n 100 -c 10 http://geeklog.adamwilson.info.toby/
This is ApacheBench, Version 2.3 
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/
Benchmarking geeklog.adamwilson.info.toby (be patient).....done
Server Software: Apache/2.2.21 Server Hostname: geeklog.adamwilson.info.toby Server Port: 80
Document Path: / Document Length: 8655 bytes
Concurrency Level: 10 Time taken for tests: 1.633 seconds Complete requests: 100 Failed requests: 0 Write errors: 0 Total transferred: 895700 bytes HTML transferred: 865500 bytes Requests per second: 61.23 [#/sec] (mean) Time per request: 163.327 [ms] (mean) Time per request: 16.333 [ms] (mean, across all concurrent requests) Transfer rate: 535.55 [Kbytes/sec] received
Connection Times (ms) min mean[+/-sd] median max Connect: 0 0 1.8 0 13 Processing: 64 159 33.2 160 253 Waiting: 64 153 30.6 154 241 Total: 65 159 33.0 160 254
Percentage of the requests served within a certain time (ms) 50% 160 66% 167 75% 172 80% 177 90% 204 95% 229 98% 242 99% 254 100% 254 (longest request)
This the site once it was on cloudflare

-----------------------------------------------------------------------------
On cloudflare
-----------------------------------------------------------------------------
Last login: Sun Apr  8 11:17:09 on console
Macintosh:~ Toby$ ab -n 100 -c 10 http://geeklog.adamwilson.info/
This is ApacheBench, Version 2.3 
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/
Benchmarking geeklog.adamwilson.info (be patient).....done
Server Software: cloudflare-nginx Server Hostname: geeklog.adamwilson.info Server Port: 80
Document Path: / Document Length: 12020 bytes
Concurrency Level: 10 Time taken for tests: 6.619 seconds Complete requests: 100 Failed requests: 0 Write errors: 0 Total transferred: 1265229 bytes HTML transferred: 1214025 bytes Requests per second: 15.11 [#/sec] (mean) Time per request: 661.933 [ms] (mean) Time per request: 66.193 [ms] (mean, across all concurrent requests) Transfer rate: 186.66 [Kbytes/sec] received
Connection Times (ms) min mean[+/-sd] median max Connect: 34 39 3.3 38 54 Processing: 255 604 519.0 349 2091 Waiting: 210 493 508.0 228 1973 Total: 293 643 520.2 390 2139
Percentage of the requests served within a certain time (ms) 50% 390 66% 456 75% 892 80% 1019 90% 1542 95% 2075 98% 2120 99% 2139 100% 2139 (longest request)
I also ran some ping tests

another site on same dreamhost hosting account no cloudflare
-----------------------------------------------------------
round-trip min/avg/max/stddev = 173.442/173.796/174.234/0.329 ms
this site with cloudflare ------------------------------------------------------------ round-trip min/avg/max/stddev = 31.984/33.248/34.279/0.721 ms
Conclusion: So my ping time is better because its coming off a server in the UK now. The site generally doesn't seem that much faster but it was pretty fast to start with. Sue it will affect other sites more dramatically.
To be honest this is really excessive for this site, its really simple and I don't pay for bandwidth anyway but it seems better to try stuff out on your own site rather than on a clients. Its free though so no bother to try out and if your on dreamhost you don't even have to mess with dns, only tick a box and let them do it.
Some cloudflare oddities : if you add a subdomain they say they have added the root domain so you do add geeklog.adamwilson.info, they say thankyou for adding adamwilson.info. Ignore this. Also they see themselves as a security layer for your site. I wasn't particularly interested in that, there aren't comments on this site and its not really something i'm worried about hackers on. By default they block certain ip's with a captcha challenge. That seemed a bit unfriendly to me so I turned it off you can tweak this how you want. You can turn it for your admin area or some other bit. They also do email obfuscation If your not already doing that. There are a lot of different features including analytics. Its quite neat.

/ Adam