[英]Executing API of a AWS Lambda function multiple times throws “message”: “Endpoint request timed out”. How to resolve this problem?
Lambda Specs: Python Version - 3.7 || Lambda 规格:Python 版本 - 3.7 || Memory - 10240MB (10GB) Memory - 10240MB (10GB)
The Synchronous API timeout limit is 30 seconds.同步 API 超时限制为 30 秒。 My code executes for 4 seconds.我的代码执行 4 秒。 The below code is a sample one that sleeps for 4 seconds.下面的代码是一个休眠 4 秒的示例。 I'm using EFS mounted in Ubuntu for storing the packages as the limit of lambda deployment is 250MB.我正在使用安装在 Ubuntu 中的 EFS 来存储包,因为 lambda 部署的限制是 250MB。
import time
import json
import os
import sys
sys.path.append("/mnt/access")
import math
import pandas as pd
import statsmodels.api as sm
import numpy as np
from datetime import datetime, timedelta
import sqlalchemy
from statsmodels.stats.outliers_influence import variance_inflation_factor
def lambda_handler(event, context):
time.sleep(4)
What is the AWS Lambda function timeout set at? AWS Lambda function 超时设置是多少?
It sounds like the lambda function timeout is set too low.听起来 lambda function 超时设置得太低。
https://console.aws.amazon.com/lambda/home - open the function and set the timeout under basic settings. https://console.aws.amazon.com/lambda/home - 打开 function 并在基本设置下设置超时。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.