Almost, does lambda track resource usage down to cpu cycles, heap usage, and network bandwidth? I've contemplated adding scripting language support for my BaaS project with this level of accounting, but from what I've determined, it would require creating a new language, or a new runtime for an existing language, or Lua. Lua's is simple and easier to modify from what I can tell. Unfortunately, no ones writing web apps in Lua, aside from the OpenResty guys.
The goal being the utility model of computing, pay for exactly the cycles you use, no more, no less. Off premise on demand. Like tap water.
They do, yes. Rounded up to the nearest 100ms, scaled for chosen RAM capacity: https://aws.amazon.com/lambda/pricing/ Note that this doesn't measure actual RAM use, although they do display it after lambda runs.
Data traffic is already measured and priced accordingly in AWS so that's not something new for Lambda.
That's not exactly what marktt was asking. For example, calling sleep (explicitly or implicitly while waiting on network input) would not incur much CPU cost under marktt's accounting method but does incur wall clock charge under Lambda.
(It's totally understandable and fair that it does; it's just different than what he asked.)
One could think of Lambda as charging for (A * network bandwidth + B * RAM usage * wall clock time + C * CPU time + D * Disk IO) where C and D are both zero.
From a capacity planning perspective, your goal should be 100% cpu utilization per box. Allocating excessive, unutilized wall clock time is wasted capacity. Same applies for ram/heap per call. These are the same considerations that played out in client/server vs mainframes for so many years.
Mainframe budgeting of cycles, memory, an IO was highly effective and efficiently utilizing resources. It's a model of computation that has disappeared, but is still relevant. When google app engine first came I had hoped it would utilize this model, but instead went the containerization route.
Lambda does not bill on these, nor do they provide you with these metrics out of the box. This is something that 3rd-parties can provide, however... it's something that we collect with IOpipe[1] (disclaimer: I'm CTO & founder)
The goal being the utility model of computing, pay for exactly the cycles you use, no more, no less. Off premise on demand. Like tap water.