9 ms·
Rust at CloudFlare
- tormeh 9y agoCan anyone offer some context? Redox is great, but why is it a pro for cloudflare?
- jontro 9y agoIt's listed under the Why rust (for me) slide. I.e. it's the authors own reasons/pros.
- weavie 9y agoDoes that mean it is actually being used in production, or is it just a potential? If so, I hadn't realised it had come on that far!
- steven_pack 9y agoRust is being used in production at Cloudflare. Redox is not used here in any capacity.
- steven_pack 9y agoThat was purely on the list of reasons why I personally got interested in Rust and I support redox on patreon. I love the idea of an OS built on Rust from the ground up as a way to eliminate a category of security bugs. The second slide is about when Cloudflare chooses Rust as a language.
- buro9 9y agoI'm the Engineering Manager @ Cloudflare for the "Wireshark but at the Edge" thing. Happy to answer any questions, though I'll be clear... this isn't something you can play with yet and we're in early days with this feature. The goal is "customers should be able to create filters that target traffic passing through our system and then do things" so this is definitely a thing we wish to give to customers rather than an internal toy.
- wyldfire 9y agoDo you have NICs/FPGAs that this code could target or would those filters run on a CPU?
- buro9 9y agoCPU presently. The filter expressions are based on the Wireshark Display Filters https://www.wireshark.org/docs/wsug_html_chunked/ChWorkBuildDisplayFilterSection.html https://www.wireshark.org/docs/wsug_html_chunked/ChWorkBuild... and we support everything except the slice operator. Rust handles the parsing, validation, AST creation, etc. That AST can then be applied to a trait table similar to the Wireshark implementation but without the necessity of a pcap step. I hope that the filter becomes an invariant form of filter against traffic and that once we've got the AST we can apply that filter to different places. Initially just to itself within a Rust matching engine at the edge, but if you have columns on a DB why not ask for a SQL expression derived from the filter expression and then filter a ClickHouse store using the same filter, and likewise as per your suggestion if we can take some of the expressions that aren't L7 why can't we have these run in the network card, etc. Right now... just CPU as it is early days. But eventually we can look at all places we match traffic and consider that a contender for the same filter to be applied there.
- Rapzid 9y agoI wouldn't mind hearing some details on perf. I would imagine a lot of filtering can happen at the true edge via BPF, kernel mods, or otherwise zerocopy mechanisms. Looks like Linux added in kernel tls termination; sounds like even layer 7 inspection could all happen in kernel space as well...
- buro9 9y agoAh, for this I'll defer until we have more data. At the moment we have a simple(ish) implementation running at the edge purely within Nginx and a project underway to see how it behaves, gather metrics. That environment gives us a good place in which to control testing, and we can easily compare it to other parts of our code where we already do more trivial request matching (our Page Rules feature). It'll be a couple of months before we're satisfied we know enough to say whether we'll keep it simple or will seek to make it more specialised to our environment. We haven't yet determined how far we're going to go with this... could it replace our WAF? Is it cheap enough for the DDoS layer? If we do go down those paths then it's obvious that yes we'd move the filtering to other places.
- squiguy7 9y agoIt's cool to see CloudFlare using Rust but I wish they went into a little more detail on the slides. I hope to see follow up blog posts or some of the code open sourced soon.
- steven_pack 9y agoThat's what happens when Product Managers present the things the engineering team is doing. :) The bigger projects are in London. I'm going to try get the engineers out to SF next time we host and go a bit deeper. The EM is on this thread answering questions also.
- squiguy7 9y agoOk, great. Thanks for sharing the information as it is! :)
- Already__Taken 9y ago2 videos up on the rust channel from this and hopefully more in future - https://www.youtube.com/channel/UCaYhcUwRBNscFNUKTjgPFiA/videos https://www.youtube.com/channel/UCaYhcUwRBNscFNUKTjgPFiA/vid...
- brian_herman 9y agoTrustDNS awesome for 1.1.1.1
- bluejekyll 9y agoWe're putting the 0.9 release of the Resolver together now, hopefully for release in the next few days. Lot's of good things, including DNS-over-TLS with cloudflare and quad9 configs available.
- cortesoft 9y agoHmmm, they say only 10Tbps capacity, but they serve 10% of the internet's HTTP traffic? That doesn't seem right.
- noselasd 9y agoI read it as 120 datacenters, each with 10Tbps capacity
- cortesoft 9y agoYeah, that isn’t possible.
- majke 9y agoThe "10%" is always going to be a metric of something. If you count bytes in the internet, to some approximation it's 100% netflix + youtube (with some error :P). Here, the metric probably means "unique domain names" used on the internet.
- steven_pack 9y agoThe slide says 10% requests. http[s] requests that is, not packets.
- lossolo 9y agoOnly? 10 Tbps is HUGE capacity. Biggest IX (Internet Exchange) which is AMS-IX have 5 Tbps at peak. Whole internet traffic in 2016 was around 160 Tbps. So it seems right.
- deleted 9y ago[deleted]
- steven_pack 9y agoHere are the videos and slides... (from the May 2018 Bay Area Rust Meetup, which was hosted at Cloudflare) Rust at Cloudflare Video: https://watch.cloudflarestream.com/4d5d6da3c6217c24f4e44564e041f772 https://watch.cloudflarestream.com/4d5d6da3c6217c24f4e44564e... Slides: https://docs.google.com/presentation/d/1ERVTXZbYBMZf-9Zk3YsWw2oV14C5j0i1PsVgGywSsAI/edit?usp=sharing https://docs.google.com/presentation/d/1ERVTXZbYBMZf-9Zk3YsW... TrustDNS Video: https://watch.cloudflarestream.com/e14e0d2335ffb94ae505289f55552142 https://watch.cloudflarestream.com/e14e0d2335ffb94ae505289f5... Slides: https://drive.google.com/drive/folders/1gQn9Uuj34TxS4cfUoW1Ng4o8axI9r8kq?usp=sharing https://drive.google.com/drive/folders/1gQn9Uuj34TxS4cfUoW1N... Rust Perf with lolbench Video: https://watch.cloudflarestream.com/5774ee39218ed516521adb74c3acddb5 https://watch.cloudflarestream.com/5774ee39218ed516521adb74c... Slides: https://docs.google.com/presentation/d/1BEI7zXhEiCwEd93-UUpWv-Yv5azRmBa5caPH0rCAh_Q/edit?usp=sharing https://docs.google.com/presentation/d/1BEI7zXhEiCwEd93-UUpW... edit: context about the event edit2: formatting
- manigandham 9y agoThanks for the info. 1 thing: I know you guys have your own Stream video service but Youtube is still much nicer for viewing...
- dikaiosune 9y agoThe official (I think?) youtube channel has them: https://www.youtube.com/channel/UCaYhcUwRBNscFNUKTjgPFiA https://www.youtube.com/channel/UCaYhcUwRBNscFNUKTjgPFiA.
- steveklabnik 9y agoIt is.
- steven_pack 9y agoMy pleasure! Hey, what do you like more about YouTube for watching the videos?
- kornish 9y agoI like the quote from Slide 10: > Why Rust (for CloudFlare) > ... > - Safe (we had a bug once...) > ... Funny because according to Algolia, the bug in question is the 7th-most-upvoted HN post of all time, clocking in at about 1k comments. Great to see Rust gaining industry adoption. edit: to clarify, I like that Cloudflare can look back at a bug in their C code, chuckle about it, and then start to move on to something safer. This is the bug in question: https://news.ycombinator.com/item?id=13718752 https://news.ycombinator.com/item?id=13718752
- hellofunk 9y agoCould you provide a link to it?
- lobster_johnson 9y agoI suspect it's this bug: https://blog.cloudflare.com/incident-report-on-memory-leak-caused-by-cloudflare-parser-bug/ https://blog.cloudflare.com/incident-report-on-memory-leak-c... HN: https://news.ycombinator.com/item?id=13718752 https://news.ycombinator.com/item?id=13718752
- sligor 9y agoThe blog post says that this bug is inside code written in C and Ragel (a parser generator), Rust seems not to be involved in this bug
- tptacek 9y agoThat's the point; Rust operates in the places they needed C before, and C is unsafe.
- pjmlp 9y agoThere is a huge difference between being able to track down unsafe statements and a language where 100% of the source code is unsafe, given the 200+ cases of UB, implicit conversions and lack of data integrity validations. Sure logic errors can always happen, but moving away from C would already get a portion of memory corruption issues out of the table. Unless you are asserting that Mesa/Cedar, NEWP, Oberon, Oberon-07, Active Oberon, Modula-2, Modula-2+, Modula-3, Object Pascal, Concurrent Pascal, Component Pascal, Basic, D, Ada, SPARK, Sing#, Midori, BLISS, PL/I, PL/S, PL/8, PL/M, Swift, HPC# are all unsafe as C.
- jiveturkey 9y agojust me, or anyone else find it odd that this is a google docs deck? don't see those published much (usu. pdf and of course ppt). anyway, another example of soft recruiting done right by cloudflare!
- qiqing 9y agoAlso, Cloudflare is hiring.
- theweb1 9y agohttp traffic from cloudflare is cutting edges.