简体   繁体   English

AWS API Gateway + Lamda - 如何处理每秒 100 万个请求

[英]AWS API Gateway + Lamda - how to handle 1 million requests per second

we would like to create serverless architecture for our startup and we would like to support up to 1 million requests per second and 50 millions active users.我们想为我们的初创公司创建无服务器架构,我们希望支持每秒多达 100 万个请求和 5000 万活跃用户。 How can we handle this use case with AWS architecture?我们如何使用 AWS 架构处理这个用例?

Regarding to AWS documentation API Gateway can handle only 10K requests/s and lamda can process 1K invocations/s and for us this is unacceptable.关于 AWS 文档,API 网关每秒只能处理 10K 个请求,lamda 每秒可以处理 1K 个调用,这对我们来说是不可接受的。

How can we overcome this limitation?我们怎样才能克服这个限制呢? Can we request this throughput with AWS support or can we connect somehow to another AWS services (queues)?我们能否通过 AWS 支持请求此吞吐量,或者我们能否以某种方式连接到其他 AWS 服务(队列)?

Thanks!谢谢!

Those numbers you quoted are the default account limits.您引用的那些数字是默认帐户限制。 Lambda and API Gateway can handle more than that, but you have to send a request to Amazon to raise your account limits. Lambda 和 API Gateway 可以处理更多,但您必须向亚马逊发送请求以提高您的账户限制。 If you are truly going to receive 1 million API requests per second then you should discuss it with an AWS account rep.如果您真的要每秒接收 100 万个 API 请求,那么您应该与 AWS 客户代表讨论。 Are you sure most of those requests won't be handled by a cache like CloudFront?您确定大多数请求不会由像 CloudFront 这样的缓存处理吗?

The gateway is NOT your API Server.网关不是您的 API 服务器。 Lambda's are the bottleneck. Lambda 是瓶颈。

While the gateway can handle 100000 messages/sec (because it is going through a message queue), Lambdas top out at around 2,200 rps even with scaling ( https://amido.com/blog/azure-functions-vs-aws-lambda-vs-google-cloud-functions-javascript-scaling-face-off/ )虽然网关每秒可以处理 100000 条消息(因为它正在通过消息队列),但 Lambda 的最高速度约为 2,200 rps,即使进行了扩展( https://amido.com/blog/azure-functions-vs-aws-lambda -vs-google-cloud-functions-javascript-scaling-face-off/ )

This differs dramatically from actually API framework implementations wherein the scale goes up to 3,500+ rps...这与规模高达 3,500+ rps 的实际 API 框架实现有很大不同...... 在此处输入图像描述

I think you should go with Application Load Balancer.我认为您应该使用 Application Load Balancer。 It is limitless in terms of RPS and can potentially be even cheaper for a large number of requests.它在 RPS 方面是无限的,并且对于大量请求来说可能更便宜。 It does have fewer integrations with AWS services though, but in general, it has everything you need for a gateway.虽然它与 AWS 服务的集成确实较少,但总的来说,它具有网关所需的一切。 https://dashbird.io/blog/aws-api-gateway-vs-application-load-balancer/ https://dashbird.io/blog/aws-api-gateway-vs-application-load-balancer/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 dynamodb 表可以处理每秒 100 万个请求吗? - Can dynamodb table handle 1million requests per second? 如何在代理和 API 网关后面将 API 请求 (AWS SigV4) 签名到 Lambda? - How do I sign API requests (AWS SigV4) to Lambda behind Proxy & API Gateway? python3用chatGPT和AWS API网关发送请求请教问题 - python3 with chatGPT and AWS API gateway to send requests to ask questions CORS 错误:即使我在上传到 Lamda 时在 API 网关和我的 index.js 文件中启用它 function AWS - CORS error: even i enable it at API-Gateway and in my index.js file when uploading to Lamda function AWS SAM AWS Lambda Python:网关 api - 处理二进制形式上传 - SAM AWS Lambda Python: gateway api - handle binary form upload AWS API 网关:处理无效的 URL 和验证错误 - AWS API Gateway: Handle both invalid URL and validation errors AWS API Gateway OPTIONS 请求返回 500 错误 - AWS API Gateway OPTIONS requests returns 500 error AWS API 网关监控每个 Lambda 和每个客户端(公共 ip)的使用情况 - AWS API Gateway monitoring usage per Lambda and per client (public ip) AWS API 网关签名 - AWS API Gateway Signature 尝试使用 aws lamda 返回错误类型 object 调用外部 api - Trying to call an external api with aws lamda returning error type object
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM