Earlier quoted context omitted.
> It's interesting to see the heavily growing demand graph. Is that because people want to adopt it, or is it being mandated or encouraged as "best practice" etc? FaaS is well justified from the point of view of an infrastructure provider. You get far better utilization from your hardware with a tradeoff of a convoluted software architecture and development model. In theory you also get systems that are easier to man…
>FaaS is well justified from the point of view of an infrastructure provider. What if you are both provider and user? Are the tradeoffs justified?
XFaaS: Hyperscale and Low Cost Serverless Functions at Meta
41–50 of 79 posts
Re: XFaaS: Hyperscale and Low Cost Serverless Functions at Meta
#42> To reduce latency, a common approach is to keep a VM idle for 10 minutes or longer after a function invocation to allow for potential reuse [45]. In contrast, if a FaaS platform is optimized for hardware utilization and throughput, this waiting time should be reduced by a factor of 10 or more, because starting a VM consumes significantly fewer resources than having a VM idle for 10 minutes This seems somewhat surpr…
Every 15 minutes, the 100k server network has 1,500,000 compute-minutes available.
For an extreme example, every 15 minutes, 50k DB Cleanup processes run for 5 minutes, and then sit idle for 10 minutes, totalling 15 mins each. In this scenario, to satisfy 250,000 demanded compute-minutes (16.6%), 750,000 compute-minutes were supplied (50%). All else equal, to keep up healthy throughput on the rest of the network, Meta needs to purchase and maintain an excess 33,400 (50%-16.6%) physical servers to satisfy this DB Cleanup process.
Reducing the idle-time to 1 minute. The 50k process runs for 5 minutes, and then sits idle for 1 minute, totalling 6 min each. In this scenario, to satisfy 250,000 demanded compute-minutes (16.6%), 300,000 compute-minutes were supplied (20%). All else equal, to keep up healthy throughput on the rest of the network, Meta only needs to purchase and maintain an excess 4,000 (20%-16%) physical servers.
That's an extreme example, but hopefully it demonstrates why at Meta's scale, the energy requirements of the servers can be secondary when optimising for hardware. Since optomising for hardware can make a difference large enough to mothball a moderately sized datacenter.
Re: XFaaS: Hyperscale and Low Cost Serverless Functions at Meta
#43Any insight to what kinds of work is being run in the functions? I run a lot of jobs in background queues but I'm wondering if I'm missing out on some new paradigm.
Re: XFaaS: Hyperscale and Low Cost Serverless Functions at Meta
#44Earlier quoted context omitted.
What would the point of self-hosted FaaS be? They lose their whole value proposition when you're paying for dedicated servers or when you don't have large numbers of servers.
The pendulum has swung (is swinging?) for many companies back to on-prem for cost savings. Self-hosted FAAS allows your developers to retain the abstraction over the compute platform (a step beyond what containers provide), and grants those running the physical infra significant flexibility in managing it. It's also arguably less complex than k8s for basically everyone, if your use case supports short-lived functions…
This is only true of very large companies, so it doesn't change anything about this thread, which was saying that FaaS only makes sense if you're a public cloud or a large company with many on-prem servers.
Re: XFaaS: Hyperscale and Low Cost Serverless Functions at Meta
#45> To reduce latency, a common approach is to keep a VM idle for 10 minutes or longer after a function invocation to allow for potential reuse [45]. In contrast, if a FaaS platform is optimized for hardware utilization and throughput, this waiting time should be reduced by a factor of 10 or more, because starting a VM consumes significantly fewer resources than having a VM idle for 10 minutes This seems somewhat surpr…
A server idling on Function A can't be called for Function B. 144 servers idling for 10 minutes each before expiring makes up a day of compute-time for 1 server. For every 144 expected idle servers, Meta needs to purchase and maintain an additional physical machine to keep up with healthy throughput on xfaas. Every 15 minutes, the 100k server network has 1,500,000 compute-minutes available. For an extreme example, ev…
why not?
Re: XFaaS: Hyperscale and Low Cost Serverless Functions at Meta
#46Earlier quoted context omitted.
RAM, disk. Functions are often written in high level JITd languages, they may need to load large reference datasets from disk, they may require a lot of code to be transferred over the network before they can begin running, and because nobody trusts the security of the Linux kernel you also have to pay the VM startup time. An idle process on Linux isn't much different: it consumes RAM, disk and a kernel. If you trust…
> and because nobody trusts the security of the Linux kernel Seriously? I imagine all the infra worldwide is run on FaaS and short-lived VMs, right?
Re: XFaaS: Hyperscale and Low Cost Serverless Functions at Meta
#47It's interesting to see the heavily growing demand graph. Is that because people want to adopt it, or is it being mandated or encouraged as "best practice" etc? I'm not implying that true organic demand wouldn't exist because it definitely might, but I have seen in practice where leadership encourages or even mandates usage of FaaS, so the numbers go up even though on a neutral field people wouldn't necessarily choos…
Its because its the simplest, fastest way to get compute for non realtime bits of code. Its much less hard to deploy stuff to, and its really simple to trigger it from other services.
A lot of things in FB are communicated by RPC, so its not really "web" fucntions that run on there, its more generic ETL type stuff. (as in system x has updated y, this triggers a function to update paths to use the latest version)
Re: XFaaS: Hyperscale and Low Cost Serverless Functions at Meta
#48> Furthermore, XFaaS explicitly does not handle functions and the path of a user-interaction The wording of this is a little strange, but does this really mean that XFaaS is not used to serve end-user traffic at all? The general approach here is interesting. I've always thought that there are two potential benefits for Function-based hosting ("Serverless") – low cost of components via scale-to-zero infrastructure (go…
When I worked at a company with a similar-ish setup, we were told that if you could do it in less than a minute and the user has to wait on it, do it in the request, don't send it to a job. This was because it was "cheaper" to keep a thread running vs. spinning up the resources to do a job. When I say cheaper, I mean in dev-time, user experience, and actual resources.
1) on the front-end, the dev doesn't have to "refresh" or "poll" an endpoint to get the status.
2) user experience is better. many people naively check "every 30s" or something ... well, what happens if services are degraded and it takes more than 30s to respond to your status check? Now, after a few minutes, you have dozens of pending requests for the exact same resource.
3) we didn't have a fancy SLO priority queue, just a regular one, so sometimes, you could have your job stuck behind a ton of jobs that are a higher priority than you, causing what was only 30s in your tests to now take 2 hours with the user polling your status endpoint and randomly refreshing, then eventually contacting support asking why it isn't working.
Re: XFaaS: Hyperscale and Low Cost Serverless Functions at Meta
#49Any insight to what kinds of work is being run in the functions? I run a lot of jobs in background queues but I'm wondering if I'm missing out on some new paradigm.
Nothing really new, except that you don't have to build it yourself ... but if you do and you sell it to your coworkers/clients/customers, you just call it FaaS.
Re: XFaaS: Hyperscale and Low Cost Serverless Functions at Meta
#50Earlier quoted context omitted.
> and because nobody trusts the security of the Linux kernel Seriously? I imagine all the infra worldwide is run on FaaS and short-lived VMs, right?
What they mean is that if you trusted the kernel you’d run functions in containers instead of micro-VMs, since containers need fewer resources and better start/stop latency.
Unfortunately FaaS platforms actually suffer twice, because Linux userland is too chaotic to use directly. So you have to boot a clean VM with Docker in it, then install a container into that VM so the user can send you software in the now-standard format, then start up the function.
Booting a Docker container from a standard running Linux system already takes ~100msec if I recall correctly. But 100msec of added latency can actually reduce usage and hurt revenue on big sites, so it's not acceptable. And that's just the inner container. Then you have the cost of booting Linux, cost of downloading the container (docker format is highly unoptimized) etc.
So all these costs add up and then the only way to solve them is to amortize them.
Oracle Cloud is working on a thing called GraalOS which is intended to help address this. It works by letting apps share a Linux kernel and using a userspace "supervisor" that relies on CFI, MPKs and NaCL style binary analysis to prevent code from connecting to the kernel directly. Containers and VMs are no longer necessary in that model and loading an app is just a case of copying it down to a node and mmapping it, but it does mean you have to be able to compile your app for this alternative pseudo-operating system. If you work with Java then you use native-image that makes Java apps compile to native code and start up super fast, so it works.