7 ms·
Hey there, I work on Proxygen at Facebook. I'm happy to answer any questions you have about the project.
by dcsommer 12y ago
Hey there, I work on Proxygen at Facebook. I'm happy to answer any questions you have about the project.
- brian_herman 12y agoAre there any plans for spdy and http2?
- spicyj 12y agoFrom the first paragraph: In addition to HTTP/1.1, Proxygen (rhymes with "oxygen") supports SPDY/3 and SPDY/3.1. We are also iterating and developing support for HTTP/2.
- seasonedschemer 12y agoWe already do support SPDY/3 and SPDY/3.1, and we're working on HTTP/2 currently.
- invisible 12y agoHey! So Proxygen was originally a reverse-proxy load balancer. Is that still how Facebook utilizes it now? If not, what is its current role? Are there any plans for integrating this with Hiphop/PHP in any way?
- dcsommer 12y agoYup, we still use Proxygen (the library) in our reverse proxy. Maybe some day we'll be able to open source the reverse proxy too, but it's pretty deeply integrated with internal FB code right now so that's tricky. We already use the Proxygen HTTP code for the webserver part of HHVM internally. We hope to release that webserver part too (in the HHVM project).
- x3c 12y agoWebsockets were mentioned in the blog post. Has proxygen been deployed with websockets at facebook scale? How much support for websockets is there in the opensourced proxygen?
- datashovel 12y agoI would love to see Proxygen integrated as a HackLang extension. Especially the HTTP parser. As far as I know, the PHP world is sorely lacking a robust HTTP parser.
- datashovel 12y agoIn response to my comment here, I did some more experimentation with pecl_http. Turns out version 2.1.4 looks relatively stable. Just be sure not to make the same mistake I made of referring to the documentation on the php.net website. Instead one should look here for version 2.x documentation: http://devel-m6w6.rhcloud.com/mdref/http/ http://devel-m6w6.rhcloud.com/mdref/http/
- drefined 12y agoThe blog post mentions that HHVM uses parts of Proxygen.
- invisible 12y agoSorry; I had read through most of it but was scanning for PHP or Hiphop. Honest mistake, I swear :).
- mikebo 12y agoHow tested is the websocket support? Does facebook use this for TLS termination?
- dcsommer 12y agoWebsocket support isn't out yet unfortunately. It's something we hope to get to soon. Our reverse proxy uses proxygen and does TLS termination too, yes.
- mattgodbolt 12y agoIf you need a really simple embeddable C++ webserver that supports websockets (and as the primary developer) can I suggest SeaSocks: https://github.com/mattgodbolt/seasocks https://github.com/mattgodbolt/seasocks
- lost_name 12y agoThis question is a bit naive, but outside of Facebook, can you think of what kind of application this is well suited for?
- swartkrans 12y agoAny kind of internal service that listens and accepts an API. Like you could put a bunch of monitoring agents on all your machines and those agents get information about your machines and report back to the service that makes use of Proxygen. Your service would use Proxygen instead of hiding behind an nginx or apache server and running via some kind of fcgi setup. The agents themselves could be using the Proxygen client to talk to the service using Proxygen server pieces.
- dcsommer 12y agoWell besides the fun of hacking around and building little HTTP servers, I could see this being useful if you want to save money by running fewer instances of your HTTP service. For instance, if you have a widely deployed python webservice that isn't scaling well, you could rewrite it in C++ with very little boilerplate using proxygen's httpserver. It's early stages for the proxygen open source project. Maybe further down the road we'll provide off-the-shelf binaries, but we think the library is already interesting enough to warrant a release.
- johnbellone 12y agoIs 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?
- dcsommer 12y agoThe 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.
- plainOldText 12y agoI'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?
- dcsommer 12y agoThis 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.
- kazuho 12y agoI 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.
- zobzu 12y agoThats 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.
- leeber 12y agoI currently use nginx for all my projects, which for me mostly consist of (1) serving static content and (2) proxying to gunicorn. My setups are usually not overly complicated, basic redirects for stuff like www/non-www or ssl/non-ssl, installing ssl certs can be a pain sometimes, and for the most part I use a lot of default settings and have never needed to go in-depth with tweaking settings. Does somebody like me have a reason to check out Proxygen?
- dcsommer 12y agoMaybe not today. We haven't open sourced a configurable proxy yet, so you wouldn't be able to do your redirects and some of these other features without writing C++ code. If you're interested in how HTTP frameworks are designed and implemented, I'd definitely suggest checking it out though. This project is initially going to be more interesting to people integrating with HTTP quite directly.
- egonschiele 12y agoI would love to see a comparison between Proxygen and another server (ideally nginx or golang server). The numbers are impressive, but the client is on the same box, it is a big box, and it is a simple and short response. So I'm not sure if I should be wowed or not. From reading the post, Proxygen was written as a server that would be well-integrated into Facebook tools. I don't really use Facebook tools, so I'm not sure if Proxygen would be right for me?
- dcsommer 12y agoI think https://news.ycombinator.com/item?id=8563766 https://news.ycombinator.com/item?id=8563766 is a good answer to use cases.
- egonschiele 12y agoMaybe I am being dense, but why is Proxygen a better solution here?
- prlin 12y agoIt's a library that you can integrate into your application rather than passing requests via an intermediary (so performance would improve). It's not necessarily a better solution unless you're optimizing for performance. It probably isn't if you're going for ease of development and maintainability.
- thrownaway2424 12y agoCould you comment on the verisimilitude of the benchmark parameters? I would expect in Facebook's production environment the number of active sockets would be hundreds or thousands of times greater than 400.
- dcsommer 12y agoYou're right we see many more connections in production. We didn't have enough time to run exhaustive benchmarks for all the different possible combinations of active sockets, requests per connection, etc. As you might suspect, 400 was a sweet spot for our performance numbers at 1 core. Overall RPS didn't dip too much when increasing the number of connections. The table we included is just to give a rough idea of perf.
- sitkack 12y agoWhat 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?
- dcsommer 12y agoIn 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.
- deleted 12y ago[deleted]
- djb_hackernews 12y agoQuestion 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.
- krate 12y agoThis SO thread has a good overview of the books out there: http://stackoverflow.com/questions/388242/the-definitive-c-book-guide-and-list 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.
- xissy 12y agoHey, 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.
- pjmlp 12y agoStart 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.
- pjmlp 12y agoYou 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.
- syncopate 12y agoHey, I am a bit late, but I wonder how you generally handle unicode in C++, since the language itself does not have much support for it. That's what always makes me weary of writing any kind of server in C++.
- optymizer 12y agoBy using icu::UnicodeString. Docs: http://icu-project.org/apiref/icu4c/classicu_1_1UnicodeString.html http://icu-project.org/apiref/icu4c/classicu_1_1UnicodeStrin... Site: http://site.icu-project.org/ http://site.icu-project.org/
- matt_d 12y agoHi! Looks interesting! I have a question -- in particular, the blog post mentions that the framework "includes both server and client code", any my question is about the second part :-) I'm wondering, how does it compare to the other C++ HTTP client solutions: Is it closer to higher-level libraries like cpp-netlib, Casablanca, or POCO -- or more on a lower-level / comparable to Asio (or Boost.Asio)? In your view, what are the main relative advantages/disadvantages (namely in the scenario mentioned in the blog post, i.e., integration into existing applications)?