Hacker News new | ask | show | jobs
by divbzero 1440 days ago
> I am still working out kinks in the backend, particularly cold-start issues because the Lambda function has to load the entire Torch library (~2GB). This occasionally causes the AWS API Gateway to reach max timeout before the Lambda function finishes.

I could not find your backend code to confirm, but I suspect you could convert that Lambda function into a long-running app to avoid cold-start issues. This could be deployed with an app engine (e.g. Heroku, Google App Engine, AWS Elastic Beanstalk), as a Docker container (e.g. AWS EKS), or directly on a server (e.g. AWS EC2). Feel free to contact me via my profile, happy to point you in the right direction.

1 comments

Thanks! In a previous iteration I used some of those solutions, both Heroku and Render. I thought this might be a good use case for Lambda because the API doesn't get called very often, and it's really just one function. Refactoring the backend code to keep the lambda handler skinny seemed to help. If I continue to have problems I will definitely look at these options.