Browse Chapters
Speed and Execution Time
One distinctive feature of serverless apps is the focus on speed and execution time. Serverless functions are often limited to a specific length of time to run. But serverless runtime environments are often also focused on high-performance execution.
It is presumed, since there is no long-running server, that a serverless app will quickly handle the request. Most (and perhaps all) serverless app platforms place a maximum time limit on the execution of a serverless app. AWS Lambda allows no more than 15 minutes. In contrast, Vercel edge functions must return in mere seconds. Most serverless app platforms fall somewhere between these two.
Theoretically, a serverless platform that handles large amounts of data in a workflow like an ETL pipeline could justify running for long periods of time. But the prevailing pattern for such circumstances is often to break data into chunks and run multiple concurrent processes of the same function on different segments of the data.
Some serverless app platforms like Google Functions and AWS Lambda charge for every fractional second that a serverless app runs. So, in addition to having a maximum execution time, it can be financially beneficial to write fast code.
While first-generation serverless platforms like Lambda tend to be slow to start and sometimes slow to execute, the newer generation of serverless app platforms focuses on speed. Most Lambda functions take more than 200 milliseconds to cold start – and sometimes as much as a few seconds. This is too long for typical HTTP endpoints. In contrast, Fermyon Spin starts nearly instantly (typically 2ms or less, and often under 1msec).
Browse Chapters