Lambda functions bring with them some new limitations that we need to handle as part of the overall monitoring, for example - a limited amount of memory and time, according to our configuration.
Being aware of such issues is crucial, so let’s have an example of a timeout issue to understand how it looks like.
To create a timeout on our store, let’s increase the number of items in stock from 4 to 17 by running update_db.py script in the backend folder:
python update_db.py 17 <REGION>
Make sure to use the same region as before. Let’s revisit our retail store now. We can see that the loader is stuck again, but why?
Let’s get back again to to catalog-shop-dev-get-items
to understand what happened:
To get more details, let’s click in the request ID to find out more details in the trace, and switch to the timeline view:
We can easily identify that we are calling an API over and over again, to fetch images for every item in our catalog. This is not a best practice, especially when our catalog can grow to thousands of items.
Possible solutions for this issue can be: