Timeout when performing an "INSERT" query into RDS Aurora DB?

0

I have a Python Lambda function that accesses my RDS Aurora DB, copies a table, but doing the folllowing

conn = pymysql.connect(...)  
with conn.cursor() as cur:  
        cur.execute("create table some_table_temp like some_table;")  
        cur.execute("insert into some_table_temp select * from some_table;")  
          

I performed the following query into my sandbox RDS Aurora DB, and it worked. I then setup my Lambda function to use my staging environment (VPC, subnet, security groups). I'm getting a connection object, and am able to create the some_table_temp table, but the succeeding "insert" query fails due to timeout since this table takes longer than 3.00s to copy in the staging environment.

2020-10-17T17:14:15.243Z 17d05521-d0da-441c-bd71-befa37e447cb Task timed out after 3.00 seconds  

How can I increase the timeout for my DB queries?

Thanks.

ChrisFZ
질문됨 4년 전545회 조회
1개 답변
1

It was the Lambda function timeout setting, which was 3.00s by default. Once I increased that, the function worked.

ChrisFZ
답변함 4년 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인