- Building Serverless Web Applications
- Diego Zanon
- 231字
- 2021-07-15 17:31:23
Constraints
If you go serverless, you need to know what the vendor constraints are. For example, on AWS, you can't run a Lambda function for more than 5 minutes. It makes sense because if you spend long time running code, you are using it the wrong way. Serverless was designed to be cost efficient in short bursts. For constant and predictable processing, it will be expensive.
Another constraint on AWS Lambda is the number of concurrent executions across all functions within a given region. Amazon limits this to 1,000. Suppose that your functions need 100 milliseconds on average to execute. In this scenario, you can handle up to 10,000 users per second. The reasoning behind this restriction is to avoid excessive costs due to programming errors that may create potential runways or recursive iterations.
AWS Lambda has a default limit of 1,000 concurrent executions. However, you can file a case into AWS Support Center to raise this limit. If you say that your application is ready for production and that you understand the risks, they will probably increase this value.
When monitoring your Lambda functions using Amazon CloudWatch (more in Chapter 10, Testing, Deploying, and Monitoring), there is an option called throttles. Each invocation that exceeds the safety limit of concurrent calls is counted as one throttle. You can configure a CloudWatch alert to receive an e-mail if this scenario occurs.
- 計算機網絡
- 程序員面試筆試寶典
- 深入淺出Java虛擬機:JVM原理與實戰
- Java從入門到精通(第5版)
- 精通搜索分析
- RTC程序設計:實時音視頻權威指南
- 薛定宇教授大講堂(卷Ⅳ):MATLAB最優化計算
- Elastic Stack應用寶典
- Mastering Ubuntu Server
- Mastering ServiceNow(Second Edition)
- Hands-On Automation Testing with Java for Beginners
- Kotlin編程實戰:創建優雅、富于表現力和高性能的JVM與Android應用程序
- C++語言程序設計
- Python機器學習與量化投資
- Mastering Apache Camel