3

I enable labmda xray on AWS and I am able to see the service map on xray console. But what I don't understand is the different between AWS::LAMBDA and AWS::LAMBDA::FUNCTION. If you look at below screenshot, you will see that my lambda requestTransactionhandler show in two section. One is AWS:Lambda the other is AWS::Lambda::Function. Each of them have a different latency. What is the different between them?

And there are 2 seconds more latency on AWS::Lambda so how can I improve it?

enter image description here

Joey Yi Zhao
  • 37,514
  • 71
  • 268
  • 523
  • `AWS::Lambda` is the AWS Lambda service itself, while `AWS::Lambda::Function` is your actual function that you developed. – Marcin Jul 23 '20 at 04:21
  • why is there 2 sec latency on AWS:Lambda? – Joey Yi Zhao Jul 23 '20 at 04:22
  • Maybe it was the start up time of your function? Not sure, thus I can't give you full answer. – Marcin Jul 23 '20 at 04:23
  • If it is AWS lambda service, that means the latency has nothing to do with my lambda right? – Joey Yi Zhao Jul 23 '20 at 04:31
  • Does this happen all the time, or only for the first execution of your function? Usually the first invocation is slow due to so called "cold start". – Marcin Jul 23 '20 at 04:35
  • It is 2 seconds at the first time but around 1 second on average. I understand code start is a performance but I don't expect it to be second. It makes sense for 200 ms. – Joey Yi Zhao Jul 23 '20 at 04:37
  • Marcin is right about the two components of the lambda service and the function itself. – Rohit Banga Jul 23 '20 at 13:49

1 Answers1

6

X-ray divides the function in two parts

  1. Functions's startup overhead represented with AWS::Lambda
  2. Functions's execution time represented with AWS::Lambda::Function

These two parts of function are the two subsegments created by XRay.