Live data from Hacker News

Proxygen, Facebook's C++ HTTP Framework

code.facebook.com

71–80 of 98 posts

Re: Proxygen, Facebook's C++ HTTP Framework

#71
post #67

Earlier quoted context omitted.

nope, golang can't handle google either, it would be to expensive for them too.

spoken with some authority? https://talks.golang.org/2013/oscon-dl.slide#1

Google's a huge company and its products have a wide variety of requirements. For context, dl.google.com is basically a download server: its goal is to get static files from Google's servers to your client as quickly as possible, with some minimal business logic. Something like this is basically ideal for Go, because it is relatively stateless and focuses on shuffling bytes from one IO interface to another. Another ideal use-case was the project that Matt Welch blogged about moving to Go.

When most laypeople think about "Google", they probably mean the search engine. I cannot imagine the serving system of Google - the part that actually retrieves the results and ranks them - ever being written in anything but C++. The scale of data that it operates on is just too large, the complexity of the code too high, and the CPU budget per request too small.

Now, there are other binaries in the search serving stack that I think should ideally be written in Go. I said as much when I was at Google, though I doubt it'd ever happen simply because of inertia. But that's probably not what people are thinking of when they say "Google-scale".

Source: I worked in search for 5+ years.

Re: Proxygen, Facebook's C++ HTTP Framework

#72

Earlier quoted context omitted.

I'm curious to know why there is a file named PATENTS in the repo (alongside the LICENSE file). What kind of legal protections would this "additional grant" give you?

This is similar to the Apache License, which allows developers to use the project with the confidence that we grant a license to any patents that may affect the project. This is a grant we use for all of our projects and is not anything specific to Proxygen.

I am sorry to point this out, but the patent license of Proxygen does not look similar to that of Apache License for two reasons.

- the license is terminated when one files a claim against _any_ of Facebook's software or services (IIRC Apache License gets terminated only when filed against the software)

- the license also terminates when you claim that "any right in any patent claim of Facebook is invalid or unenforceable"

The second clause seems very agressive (or pro-patent) to me, which makes me feel sorry for the developers of Proxygen, since IMO such a clause would harm the acceptance of the software outside Facebook.

It would be great if you reconsider the patent license.

Disclaimer: I am developer of H2O, an open-source HTTP/1 and HTTP/2 library, so there is obviously a conflict of interest here. But I wanted to leave a comment anyways since, honestly, I feel sorry if my friends at Facebook needs to go with this kind of license.

Re: Proxygen, Facebook's C++ HTTP Framework

#73
post #64
post #2

Hey there, I work on Proxygen at Facebook. I'm happy to answer any questions you have about the project.

What are the security implications of running native code on a public facing service? How many RCEs has Proxygen had? Has it been audited for security? What is the testing procedure?

In general, native code is not the same as unsafe code (that's why I'm personally excited about Rust. Native + safe = awesome). In C++'s case though it is true that a memory error could be used to exploit the process. Careful use of safe memory abstractions are our main safeguard against this. I can't comment on RCEs, but Proxygen has been externally and internally audited for security. We have many unit tests in the project, and we also internally have more comprehensive integration tests and a fuzzer.

Re: Proxygen, Facebook's C++ HTTP Framework

#74
post #69

Earlier quoted context omitted.

Question for you and the general C++ community. I am a Java developer mostly but it looks like I'll be transitioning to a few C++ projects in the near future. Any good resources you can recommend for learning modern C++? Particularly anything you've used to get developers on your team similarly up to speed. I've cruised through the Proxygen code base and there are definitely some head scratchers.

This SO thread has a good overview of the books out there: http://stackoverflow.com/questions/388242/the-definitive-c-b... I'd recommend "C++ Primer" first, "Effective C++" second, and "The C++ Programming Language" as a reference. Other must haves are "Modern C++ Design", the other Scott Meyers books, and the Herb Sutter books.

Hey, could you recommend any books or tutorials for C++1y/C++14? I had learned C++ in my CS courses but I've used java/python/javascript these days. I'm thinking of coming back to C++ because C++14 looks cool.

Re: Proxygen, Facebook's C++ HTTP Framework

#75
post #72

Earlier quoted context omitted.

This is similar to the Apache License, which allows developers to use the project with the confidence that we grant a license to any patents that may affect the project. This is a grant we use for all of our projects and is not anything specific to Proxygen.

I am sorry to point this out, but the patent license of Proxygen does not look similar to that of Apache License for two reasons. - the license is terminated when one files a claim against _any_ of Facebook's software or services (IIRC Apache License gets terminated only when filed against the software) - the license also terminates when you claim that "any right in any patent claim of Facebook is invalid or unenforc…

Thats a good point though, thats not exactly the kind of stuff people expect in open source license.

Then everyone goes and complain about the GPL vs BSD.. but this is waaaaaaaaay worse.

Re: Proxygen, Facebook's C++ HTTP Framework

#76

Earlier quoted context omitted.

Is that the inception of the project? I am more curious about the lineage. How was the decision made to go this route instead of throwing more instances at it?

The blog post goes into more detail, but Proxygen started with an effort to write a L7 reverse proxy that could deeply integrate into FB internal services. We pulled out a lot of the non-FB specific stuff into this open source release. Before that, we used hardware load balancers for this role, which was expensive.

I'll have a look at the blog for more -- but this was something that couldn't be solved with haproxy and/or trafficserver?

Re: Proxygen, Facebook's C++ HTTP Framework

#77

"You will need at least 2 GiB of memory to compile proxygen and its dependencies." What?

fbthrift needs 2GiB of memory to compile ( https://github.com/facebook/fbthrift ) and proxygen has a dependency on fbthrift.

Offtopic: I have a problem using fbthrift and cpp2 server together. I'm find that there is two IDL to C++ compilers that I need to use - one old thrift compiler written in C++ and the new one written in python. Code generated by both this compilers is used in tests! Is there any tutorial or article with step by step instructions?

Re: Proxygen, Facebook's C++ HTTP Framework

#78
post #2

Hey there, I work on Proxygen at Facebook. I'm happy to answer any questions you have about the project.

Question for you and the general C++ community. I am a Java developer mostly but it looks like I'll be transitioning to a few C++ projects in the near future. Any good resources you can recommend for learning modern C++? Particularly anything you've used to get developers on your team similarly up to speed. I've cruised through the Proxygen code base and there are definitely some head scratchers.

You surely should pick Bjarne's latest book, "Tour of C++".

It is show how to make proper use of C++11 without any bad C influences.

Re: Proxygen, Facebook's C++ HTTP Framework

#79
post #74
post #69

Earlier quoted context omitted.

This SO thread has a good overview of the books out there: http://stackoverflow.com/questions/388242/the-definitive-c-b... I'd recommend "C++ Primer" first, "Effective C++" second, and "The C++ Programming Language" as a reference. Other must haves are "Modern C++ Design", the other Scott Meyers books, and the Herb Sutter books.

Hey, could you recommend any books or tutorials for C++1y/C++14? I had learned C++ in my CS courses but I've used java/python/javascript these days. I'm thinking of coming back to C++ because C++14 looks cool.

Start with Bjarne's new book, "Tour of C++", it shows how to make proper use of C++11 without those C unsafe influences.

C++14 is mostly fixing what was left out in C++11, so the book is already a good starting point.

C++14 is definitely cool, I use JVM/.NET nowadays at work, but am an old C++ dog (since 1993), so I always used the language on a few side projects.

C++14 kills quite a few complaints I had about the language. Now if we just could get proper modules.

Re: Proxygen, Facebook's C++ HTTP Framework

#80
post #41

Looks to me as facebook's answer to golang ? Building simple, standalone http services with good performances seems to me what those two projects (proxygen and golang) are really about. Now the question is, how much faster using C++ is, and how much safer and faster writing golang is...

Go is a nice language, but so is C++14, specially if you like the expressiveness it provides.

Plus, there are still lots of scenarios where Go tooling still doesn't provide support for. They will eventually, but not if you are starting a project today.

Post reply on HN