0

I wonder if someone help me to understand Lambda Xray tracing please?

I have a Lambda function with cold start as below. As you can see, theres 699ms cold start. But what I don't understand why it also has high invocation duration. If I repeatedly invoke the function, the invocation duration will always be around 200-300ms.

with cold start

I did another experiment when the Lambda function is still warm but not frequently invoked. Basically, I waited for 1 min before invoke the function again. The results showed the Lambda function had high invocation duration as well

without cold start

This is very strange. I wonder what is included in the invocation time in xray tracing?

John Rotenstein
  • 241,921
  • 22
  • 380
  • 470
  • I highly doubt this behaviour is related to lambda cold start issue. I suspect it's related to the logic of your function. – jellycsc Oct 29 '22 at 17:34
  • I wouldnt think so. I did load testing and the p95 is around 320ms, p99 600ms, median 170ms – Minh Nguyen Oct 29 '22 at 23:00
  • so i increased the memory from 128 mb to 256 mb. It seems the performance is better and more consistent now. However, i dont see much changes in CPU usage in Lambda Insights. – Minh Nguyen Oct 29 '22 at 23:22
  • when using 128 mb , the memory usage is 90%. Meanwhile, when using 256 mb, memory usage is 50%. Would memory affect processing speed? – Minh Nguyen Oct 29 '22 at 23:29
  • @MinhNguyen, yes memory would affect processing speed since you would have more CPU: see the doc here: https://docs.aws.amazon.com/lambda/latest/dg/configuration-function-common.html#configuration-memory-console – brushtakopo Nov 07 '22 at 12:59

0 Answers0