Allocated cores by memory
In addition to @Marcin's reply, according to Chris Munns's presentation at AWS re:Invent 2020: What’s new in serverless, you can have the following allocated cores for your Lambda (which is also mentioned in AWS Documentation > Lambda > Configuring function memory (console)):
| Configured Memory (MB) | Allocated cores |
| 128-1769 | 1 |
| 1770-3538 | 2 |
| 3539-5307 | 3 |
| 5308-7076 | 4 |
| 7077-8845 | 5 |
| 8846-10240 | 6 |
Allocated computing power by memory (CPU Cap)
Also, AWS Documentation > Lambda > Memory and computing power states that "The amount of memory also determines the amount of virtual CPU available to a function. Adding more memory proportionally increases the amount of CPU, increasing the overall computational power available. If a function is CPU-, network- or memory-bound, then changing the memory setting can dramatically improve its performance."
According to the AWS Docs > Lambda > Configuring function memory (console), "At 1,769 MB, a function has the equivalent of one vCPU (one vCPU-second of credits per second)."
Supported by my own experiments, you can utilize at maximum "N/1769 * 100"% of a vCPU where N is the configured maximum memory in MB. This is what I call CPU Cap, the maximum percentage of a CPU core (vCPU) that can be utilized at any point in a time that is bound by memory size.
| Memory | CPU Cap |
| 192 MB | 10.8% |
| 256 MB | 14.1% |
In my experiment, I observed 38ms duration for 192MB memory (10.8% CPU Cap), and 29ms duration for 256MB memory (14.1% CPU Cap):
38ms x 10.8% CPU Cap => 410,4 unit work
410,4 unit work / 29ms => 14.1% CPU Cap
10x improvement in performance with the same cost
According to the experiment shown on the same docs, it is mentioned that "at 128 MB, the function takes 11.722 seconds on average to complete, at a cost of $0.024628 for 1,000 invocations. When the memory is increased to 1536 MB, the duration average drops to 1.465 seconds, so the cost is $0.024638. For a one-thousandth of a cent cost difference, the function has a 10-fold improvement in performance."
| Memory | Duration | Cost |
| 128 MB | 11.722 s | $0.024628 |
| 512 MB | 6.678 s | $0.028035 |
| 1024 MB | 3.194 s | $0.026830 |
| 1536 MB | 1.465 s | $0.024638 |