Connecting to a cloud PostgreSQL using psycopg2 from an AWS lambda : Timeout and OpenBLAS WARNING

Viewed 19

Using a AWS Lambda function, I'm trying to connect to a cloud PostgreSQL in order to use an SQL query to get a certain information like in the simplified code below. However, I get a timeout no matter how much I increase the memory and timeout configuration.

I also used https://github.com/jkehler/awslambda-psycopg2 but in vain.

I also get the following warning :

OpenBLAS WARNING - could not determine the L2 cache size on this system, assuming 256k.

import psycopg2
import datetime  
import pandas as pd 


       
def lambda_handler(event, context):
    
    conn = psycopg2.connect( host="", dbname="", user="", password="")
    
    sql_requests_users = """
    select *
    """
    df_requests_users = pd.read_sql_query(sql_requests_users,conn)
    conn.close()
    
    return "OK"

Thank you.

0 Answers
Related