Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: Use Lambda URL to bypass Gateway timeout limit #384

Merged
merged 1 commit into from
Mar 7, 2024

Conversation

LeeXuanHua
Copy link
Contributor

Summary

Fixed AWS API Gateway timeout limit for AWS Lambda deployment, by replacing API Gateway with Lambda function URL to generate invocation URL

Problem: Previous deployment with API Gateway (with differing page paths for each Lambda function) can only handle invocations within 29 seconds due to gateway timeout. However, actual traces involve invocations longer than 29s. Although our current code filters for invocations under 1 minute, it is not sufficient to address the problem.

**Included minor fixes to improve the logging description of errors.

Implementation Notes ⚒️

Solution: Utilise AWS' Lambda function URL feature to increase the maximum invocation duration to 15 minutes (same as Lambda execution timeout limit).

Therefore, program can now handle any requestedDuration within 15 minutes and the resulting function URLs no longer share the same domain name (unlike previous approach where different Lambda functions share the same domain name due to usage of an API Gateway and only differ for the page path)

External Dependencies 🍀

  • Relies on Serverless.com framework for deployment, and that resulting function URLs are displayed in console/terminal in sequence (to map the function URL to the correct Lambda function)

Breaking API Changes ⚠️

  • N/A

@LeeXuanHua LeeXuanHua requested a review from leokondrashov March 3, 2024 16:50
@LeeXuanHua LeeXuanHua force-pushed the api-gateway-duration branch from b596119 to 402e24d Compare March 4, 2024 11:38
@LeeXuanHua LeeXuanHua force-pushed the api-gateway-duration branch 2 times, most recently from 1dcf2b4 to 08624ec Compare March 6, 2024 14:04
@LeeXuanHua LeeXuanHua requested a review from cvetkovic March 6, 2024 14:13
@LeeXuanHua
Copy link
Contributor Author

@cvetkovic, could you help to review the above changes, thanks!

Signed-off-by: Lee Xuan Hua <46639916+LeeXuanHua@users.noreply.github.com>
@LeeXuanHua LeeXuanHua force-pushed the api-gateway-duration branch from 08624ec to bada7ad Compare March 7, 2024 04:29
@LeeXuanHua LeeXuanHua merged commit 4b169d1 into vhive-serverless:main Mar 7, 2024
13 checks passed
@LeeXuanHua LeeXuanHua deleted the api-gateway-duration branch March 7, 2024 04:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants