Devang Sanghani
Devang Sanghani

Reputation: 780

Boto3.resource seems slow

I am running the below code, where I dynamically populate the region. The below code takes a little long to execute. In Lambda, the time shows 11600ms. Is it normal or is there a way to speed it up?

ec2_r = boto3.resource('ec2', region_name=aws_regions)
  DO SOMETHING

Upvotes: 0

Views: 1242

Answers (1)

Hardik Sanghavi
Hardik Sanghavi

Reputation: 73

Execution of a Lambda function depends on "Memory" that you allocate to the function.

The memory is not just CPU Memory, it also loosely correlates to the actual resource your code will be running on. Think of it like EC2 machines with t2 micro vs t2 large.

You can also enable X-Ray on Lambda to see if there is anything else.

Upvotes: 1

Related Questions