[英]Migrating an API to a serverless architecture with aws lambda
I have an API that: 我有一个API:
I want to migrate my API to a serverless architecture with lambda, the issue is that getting that information from the API that isn't mine could take 2 seconds, and my operations with that data take 0,3 seconds. 我想将我的API迁移到具有lambda的无服务器架构,问题是从不是我的API那里获取信息可能需要2秒钟,而我对该数据的操作则需要0.3秒钟。 In lambda we must pay for the processing time that we use, but I'm just waiting most of the time.
在lambda中,我们必须为使用的处理时间付费,但是我大部分时间只是在等待。 Is there any way to mitigate this issue?
有什么办法可以减轻这个问题?
The pricing in AWS Lambda is a factor of AWS Lambda中的价格是
In your case you cannot do much about the 2 second wait time for calling your other API 就您而言,调用其他API的2秒等待时间不能做太多事情
Regarding your own processing time you can try out different memory footprint options to optimise the cost. 关于您自己的处理时间,您可以尝试不同的内存占用选项以优化成本。 Keep in mind that with increased memory you will be charged more but at the same time you get more processing power.
请记住,随着内存的增加,您将需要支付更多费用,但与此同时,您将获得更多的处理能力。 So eventually it might even turn out to be cheaper because your execution might get over quickly (although that may vary from case to case basis).
因此最终它可能甚至会变得更便宜,因为您的执行可能会很快结束(尽管具体情况可能会有所不同)。
So the crux is that you might be able to optimise your own processing time by playing around with different memory footprints but you can't do much about the waiting that you have to do for the other API call 因此,症结在于,您可以通过处理不同的内存占用空间来优化自己的处理时间,但对于等待其他API调用所要做的等待却无能为力
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.