官术网_书友最值得收藏!

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.

主站蜘蛛池模板: 信丰县| 拜城县| 英山县| 呼图壁县| 襄垣县| 广宗县| 腾冲县| 察雅县| 孟连| 新乐市| 化德县| 南溪县| 宁安市| 大同市| 博乐市| 井冈山市| 清苑县| 寿光市| 云林县| 天长市| 修文县| 东光县| 晋宁县| 大连市| 古田县| 社旗县| 富顺县| 凤凰县| 花垣县| 台山市| 咸阳市| 阳原县| 巢湖市| 哈尔滨市| 龙泉市| 文昌市| 格尔木市| 秦皇岛市| 毕节市| 阳春市| 义马市|