By using AWS re:Post, you agree to the AWS re:Post Terms of Use

AWS Lambda + beautifulSoup python painfully slow

0

I'm working on web scraping project with Lambda and beautifulsoup,requests libs.

Unfortunately the code is extremely slow. locally the code run 20 seconds, on Lambda its 172 seconds.

I can't work and develop my project like that.

Please suggest me some solutions

asked 2 years ago535 views
2 Answers
1
Accepted Answer

How about increasing the Lambda specs to match the specs of the local development environment?
The default setting is 128 MB.
As per the following documentation, Lambda can be configured with up to 10 GB of memory.
https://docs.aws.amazon.com/lambda/latest/dg/configuration-function-common.html#configuration-memory-console

We recommend that you read the following best practices document once.
https://docs.aws.amazon.com/lambda/latest/dg/best-practices.html

profile picture
EXPERT
answered 2 years ago
profile pictureAWS
EXPERT
reviewed 2 years ago
1

Hi,

Apart increasing memory on lambda, which is something without limitations under free tier as well, you can consider creating the function as a container: https://docs.aws.amazon.com/lambda/latest/dg/images-create.html,as increases portability, supports larger package size (mostly for python numpy and similar libraries).

profile picture
EXPERT
answered 2 years ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions