Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
113 views
in Technique[技术] by (71.8m points)

Poorly configured lambda

Recently I create my first serverless service. Nothing fancy, just a script that uses FFMPEG to encode some CCTV footage and reduce quality.

After a couple of days, I realize that many of my footage where not there. After stare for some time at the aws lambda metrics panel, I assume that the cause of the problem was too little time and to little memory, so I cranked up the timeout (8 minutes) and max memory (380MB). And then I left it work for a couple of days to see if it would get better. Fast forward to today, I log in on aws and notice that I was never using more than 95MB of memory (as seen on the image).

Last logs

Is this right? Also, looking at the graph, I notice that I still get some errors. Increase the timeout is the solution?

aws graphs

Sorry for the poor quality of the question, I really tried to lookup.

question from:https://stackoverflow.com/questions/66063709/poorly-configured-lambda

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

Available RAM is not the only thing that's influenced by the Memory setting, which is a bit counterintuitive at first. The memory setting in a Lambda function influences:

  • The amount of compute (vCPUs) that's available to the function
  • The amount of network throughput that's available
  • The amount of system memory / RAM that's available

All of these scale based on the memory. You can think of it like this: If you provision 128MB RAM, you also get about 1/8 of a vCPU, if you go to 256 MB, you get a quarter of a vCPU. These are not exact numbers, but it's a useful mental model. Somewhere between 1024 and 1280 MB you get a full vCPU and afterwards a second vCPU is added.

Your workload seems CPU intensive (since there's not GPU to offload it to), so I'd try to increase the Memory to give Lambda more compute power to see how it behaves.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...