CloudFlare

We encourage users to post events happening in the community to the community events group on https://www.drupal.org.
jolly guy's picture

Hello,
what Do you think about CloudFlare, is there any one have experience with them?

Comments

I've been trying them for a

cashwilliams's picture

I've been trying them for a few days, on my personal site. I can't tell if there is much speed improvement, but it has cut down on spammers and other like activity. http://cashwilliams.com if you want to test speed.

I was monitoring my site with

greggles's picture

I was monitoring my site with pingdom and found that it actually slowed down the page load time (at least according to pingdom) from about 800ms to about 1.5s.

Security?

Eidolon Night's picture

greggles, you're on the security team. Not sure this falls into your domain since it's not really a Drupal thing, but have you tried disabling the "performance" features and only using Cloudflare for the additional security? Do you still get the slowdown?

Granted, their security features can only block so much, but it is another tool in the bag.

Offtopic

PlayfulWolf's picture

Which base theme you are using for your blog? Omega, Twitter bootstrap or other?
It looks light and adapts nice to screen size change.

drupal+me: jeweler portfolio

It depends...

Eidolon Night's picture

We use CloudFlare as an additional layer of caching on top of Varnish, memcached, and APC.

Speed depends largely on your site and where your server is. Remember that your resources will be distributed to their data centers, so if your web server is next door you will see an increase in server response time for certain resources.

CloudFlare has the biggest benefit on image-heavy sites and sites that are visited globally. We've noticed a huge speed increase for most of our clients and major decreases in bandwidth. Unless you're using a TON of sprites, every image means another server request. Cloudflare mitigates this by handling most the image, CSS, and JS requests. The end result is that your server can spend more time serving the actual pages.

Be carefull with the Rocket Loader (asynchronous loading of JS). It does funny things to javascript sometimes. WYSIWYG editors in particular seem to not like it. It does however speed up the loading of those pesky social widgets (Twitter, Facebook, etc.). We enable it and then use page rules to not cache admin pages and such.

Here are the 30-day analytics for one of our clients: http://www.diigo.com/item/image/3bcmu/ea5g

A mixed bag of tricks?

Andy_Read's picture

I haven't used CloudFlare, but it looks as though it's a mixed bag of performance tricks that might improve any site, regardless of which CMS or technology the server uses, but it does nothing to take into account the specifics of Drupal or your specific site.

It does caching and similar reverse proxy tricks to varnish, so it might be a good alternative, but I'd be surprised if it was any better than varnish and surprised if it was as configurable and controllable. I imagine it's like varnish with a safe vanilla config and no integration with Drupal - so not as tunable to the specifics of a given application. You might get some advantage if the CloudFlare network is more distributed like a CDN than you would otherwise set up your varnish server(s).

CloudFlare also does aggregation and minification of CSS & JS files, but Drupal does this in core (if enabled) so there a danger CloudFlare is duplicating functionality.

In general, I'd just be concerned that it's doing other tricks without you knowing about it, which makes it hard to monitor and control.

CloudFlare is not a Varnish

Eidolon Night's picture

CloudFlare is not a Varnish replacement. It doesn't cache the entire page. It only caches images, JS, and CSS. As for JS and CSS, if you're using core aggregation then the aggregated files have unique strings appended to them so CloudFlare serves the new files immediately. Even with aggregation on, we've never experienced problems with CloudFlare compression on as well.

We deploy CloudFlare for all of our live clients. Sites are all Drupal and WordPress. For the most part, CloudFlare is "set and forget". For larger sites we tweak the settings with page rules (eg. through page rules you can tell CloudFlare to fully cache certain pages like rss feeds).

Our stack is as follows:

LAMP: has the usual optimizations
APC: opcode cache
memcached: with the memcached module
Varnish: anon caching (http://support.cloudflare.com/kb/why-do-i-see-cloudflares-ips-in-my-serv...)
CloudFlare: CDN for images, CSS, and JS

The end result is that the server spends its time processing and delivering pages (think document load), and everything else is served by a CloudFlare data center close to the visitor. We don't have to do anything special for each Drupal install, and it works just fine for WordPress too. When you start looking at this layer the application that you're using becomes less relevant.

Cloudflare can cache entire pages

lklimek's picture

Hello,

CloudFlare is not a Varnish replacement. It doesn't cache the entire page.

Yep, it can cache entrie pages. We did it in one deployment, described here:

https://www.softinn.eu/en/blog/how-we-improved-drupal-site-performance-c...

To summarize: using Cloudflare cache for full pages can be tricky (you must carefully define your caching expiration mechanisms), but is possible. Of course Varnish would be much better as you have full control over it - but sometimes it's simply not needed. Remember that Varnish will add another layer to your system, which needs to be updated/maintained etc.

How does google analytic s

Elifas's picture

How does google analytic s handle accuracy of the uniquie visitors? is at cloudfare level or still with in the site?

.::hacker101::.

I have noted that google

DocRPP's picture

I have noted that google analytics at cloudflare level provide numbers higher than the one at server level set up through drupal. Some websites don't even recognize the fact that I am using google analytics when enabled at the server level.

This is a great thread!

drupalfan81's picture

This is a great thread! Definitely agree with Eidolin..."set it and forget it". I actually forgot I even set my websites up with it. And I had not gotten around to setting up my main sites. Doing that right now! ;)

Mixed feelings about

Kristina Katalinic's picture

Mixed feelings about Cloudflare...
I have tried it and found out my website speed was better without it.
Here is my setup:
I use Boost module in combination with cache expire module and boost crawler. Now don't be mislead into thinking that Boost Crawler will actually crawl all the pages on your site on its own, it will only regenerate pages that have expired. Better solution is to use a wget like wget --quiet http://www.webmar.com.au/sitemap.xml --output-document - | egrep -o "http://www.webmar.com.au[^<]+" | wget -i - to generate static versions of your site's pages included in your sitemap.
Of course this only works for anonymous traffic but performance improvement is significant.
I always try to improve on things so I decided to step it up a notch and see how much performance gain I can get using Cloudflare on top of Boost and results were disappointing. My site actually has better performance without using Cloudflare testing from Australia, Europe and USA. I use a2hosting and so far server performance I am experinicing is best I've seen on shared hosting so that may very well be the reason why Cloudflare didn't really work out for me, seems my host is faster as it is.
Most notable was the decline in speed for logged in users and that is something I definitely did not expect since logged in users were the main reason why I gave Cloudflare a go (Boost takes care of my anonymous visitors just fine)
So, my conclusion is: Perhaps Cloudflare would give better results when used in combination with some hosting companies but, if you are hosting on well tuned servers it may very well not give you much in performance gains.
To be completely fair I used FREE Cloudflare service, and my website doesn't have a huge amount of images so maybe PAID services perform better, or maybe more images on my site would result in different review but, I can only share what I tried....
One thing I can say with absolute certainty is that Boost module absolutely rocks and deserves more TLC on drupal.org

Drupal web developer and Search Engine Optimisation consultant at Webmar Design & Development Brisbane, Australia
Google+