CloudFlare Now Supports WebSockets
blog.cloudflare.com
blog.cloudflare.com
After all, we are selling a technical product.
Joking aside, I really enjoy reading Cloudflare's blog posts. I know they don't just pop into existence without some serious effort. Thanks for taking them seriously.
This is a great way for him to be on top of all the technology that goes in his extremely technical company. Moreover, him understanding the details from the engineers, then writing a blog post about it, and then getting it reviewed by the engineers ensures that the blog post will be understandable for the customers, who are likely to be at (or slightly below) his level of understanding of this technology, not the engineers who actually implemented the thing.
Not that that takes anything away from the functionality, of course. CloudFlare is great and I'm excited to see that they're offering web socket support.
With "cache everything" used correctly (to ensure you're not accidentally telling us to cache something like a login form CloudFlare can easily handle 98%+ of all requests for your high traffic pages.
PageRules are extremely powerful. Using "cache everything" can also make a huge difference is setup correctly.
You would not run out of ports, as long as your clients have some IP diversity. Connections must be unique with the key being the 5-tuple: {Protocol, SourceAddr, SourcePort, DestAddr, DestPort}. If you have one server listening on one port, each client address can theoretically have 65535 connections (in practice, you're unlikely to find a client that will allocate their ports well enough to use all the ports).
Assuming your websockets are mostly idle, handling 100k connections for one server doesn't really need that big of a server either, see WhatsApp blog post about 2.2 million connections on one server in 2012: http://blog.whatsapp.com/196/1-million-is-so-2011 Caveats: dual 6-core westmere cpu, 100 G ram, normal connection count is lower per server; connections are mostly idle; some tuning required. See also 2.8 M connections documented on page 16 of Erlang Factory presentation: http://www.erlang-factory.com/upload/presentations/558/efsf2...
This problem isn't strictly related to HTTP requests - it's really anything running on your servers. If the request is able to get past firewalls, switches, routers, to your machine, it has a chance to eat up resources, and ultimately take down that server / service. WebSockets are being used more and more for event-based communications, as you mentioned, providing real-time updates instead of relying on polling, or long polling hacks. Thus, they're just as viable of an attack vector as directing an attack at port 80. This is where the intermediate layer, provided by CloudFlare, comes into play.
The caching aspect of CloudFlare is an important, but separate aspect of their service.
That's part of the answer. But also we do very high packet rate filtering using stuff like this: http://blog.cloudflare.com/bpf-the-forgotten-bytecode
I'm also hazy on the exact fail case...it may also have had something to do with a FIN message getting lost, though I would think that would also be handled by the sequence number.
I'm thinking of using something like this: https://github.com/sstur/node-websocket-tunnel to allow access to StackMonkey instances by way of an IPv4 route if the customer doesn't have IPv6 enabled on their network.