Live data from Hacker News

Proxygen, Facebook's C++ HTTP Framework

code.facebook.com

81–90 of 98 posts

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

#82
post #67

Earlier quoted context omitted.

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 i…

By "the part that actually retrieves the results and ranks them" you mean the nodes of a cluster, that run the RPCs?

I guess the "hotspot" would be the code that has to merge the top results from the different nodes and actually deliver top rated 10 items to the user?

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

#83

Earlier quoted context omitted.

Hey! 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?

Yup, 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).

I 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.

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

#84

Earlier quoted context omitted.

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

That then begs the question of what in fbthrift needs so much memory... is it mainly due to heavy use of C++ features like template metaprogramming?

And then we go back to minimalism, Lua, ... always in this circle.

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

#85
Facebook oughta hire some better scripters, the deps.sh is of terribly low quality. I didn't get more than a couple of lines until i stumble upon this (which tells me the author has no clue :):

'start_dir=`pwd`; trap "cd $start_dir" EXIT;'...

No need to say that the script can be dangerous, in case directory change fails for instance, there's no checks but sudo make uninstall is run anyway in another dir than the intended one.

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

#86

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.

Can you tell us motivation to build this instead of contorting to and using existing solutions such as Apache Traffic Server, squid, nginx or haproxy?

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

#87
post #2

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

Hey, 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++.

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

#88
post #58

Earlier quoted context omitted.

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.

By expensive, not just capital costs, but costs around operating them - they weren't as reliably configurable, health-checkable, and instrumentable as we'd want, and Proxygen (and a later L4 load balancer) were. Also the previous load balancers had constraints we weren't willing to accept - they required special connectivity to our networks, we could not use particular combinations of options, and we had to rely on v…

Yeah, we are hitting the same wall right now and we've been going down the same route using HAProxy/Chef. Our plan is to put an API in front of it and treat it similar to an ELB. Are you still using hardware load balancers for SSL termination?

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

#89
post #86

Earlier quoted context omitted.

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.

Can you tell us motivation to build this instead of contorting to and using existing solutions such as Apache Traffic Server, squid, nginx or haproxy?

I am not a huge fan of NIH but more often than not it is simply easier in the long run to roll something in house that does the job. Although the debt that piles up tends to dwarf the original choice it is often still a better idea due to having employee churn. Its much easier to keep it within the standards of normal coding conventions.

I don't work at FB but near the bottom in the comments you can see that they build on existing C++ libraries that have been tried/tested. We do the [same thing][1] with smaller services simply because its easier in the SDLC process to move libraries that are already in-house.

[1]: https://github.com/bloomberg/bde/tree/master/groups/bsl

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

#90
post #2

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

Hey, 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++.

By using icu::UnicodeString.

Docs: http://icu-project.org/apiref/icu4c/classicu_1_1UnicodeStrin...

Site: http://site.icu-project.org/

Post reply on HN