Join us
In Part 4 of the "multithreading in serverless" series, the author, JV Roig, explores whether using multithreading in AWS Lambda is more efficient and cost-effective than a standard multi-instance Lambda architecture. The author uses data from the experiment described in Part 1 , which showed massive improvements in both throughput and cost efficiency when properly multithreading Lambdas for a CPU-intensive workload.
JV explains how they derived the throughput and cost figures from their raw data by adding columns for GB-secs, a reference cost for GB-secs, the total cost of execution, throughput, and throughput/$. The resulting data shows that multithreaded Lambdas, especially those with maximum threads and memory, outperform single-threaded Lambdas.
However, the author notes that the experiment was designed to tease out threaded performance against different memory sizes and was explicitly made CPU-intensive. Most normal workloads might not be as CPU-intensive, and therefore, may not be as sensitive to bigger memory configs or explicit multithreading. The author also cautions that the results are workload-dependent and may not necessarily apply to all workloads.
The author also discusses some caveats, including the fact that the x86 results are not as clean as the arm64 results, which speaks to the architectural differences between the CPUs powering these architectures.
In summary, the author recommends considering implementing multithreading in AWS Lambda for any sort of CPU-intensive processing and suggests benchmarking workloads to validate expected efficiency boost.
Join other developers and claim your FAUN account now!
Only registered users can post comments. Please, login or signup.