相关文章推荐

I'm having an issue at the moment where I'm trying to make use of a Serverless Aurora database as part of my application.

The problem is essential that when the database is cold, time to establish a connection can be greater than 30 seconds (due to db spinup) - This seems to be longer than the default timeout in Sequelize (using mysql), and as far as I can see I can't find any other way to increase this timeout or perhaps I need some way of re-attempting a connection?

Here's my current config:

const sequelize = new Sequelize(DATABASE, DB_USER, DB_PASSWORD, {

host: DB_ENDPOINT,

dialect: "mysql",

operatorsAliases: false,

pool: {

max: 2,

min: 0,

acquire: 120000, // This needs to be fairly high to account for a

serverless db spinup

idle: 120000,

evict: 120000

}

});

A couple of extra points: Once the database is warm then everything works perfectly. Keeping the database "hot", while it would technically work, kind of defeats the point of having it as a serverless db (Cost reasons). I'm open to simply having my client re-try the API call in the event the timeout is a connection error.

Here are the logs in case they help at all.

{

"name": "SequelizeConnectionError",

"parent": {

"errorno": "ETIMEDOUT",

"code": "ETIMEDOUT",

"syscall": "connect",

"fatal": true

},

"original": {

"errorno": "ETIMEDOUT",

"code": "ETIMEDOUT",

"syscall": "connect",

"fatal": true

}

}

  • E&ICT MNIT - Data Science and Machine Learning | IITM Pravartak - Advance Certification in Data Science and AI | E&ICT IIT Guwahati - Cloud Computing & DevOps | E&ICT IIT Guwahati - Cyber Security | E&ICT IIT Guwahati - Software Engineering & Application Development | E&ICT IIT Guwahati - Big Data Analytics | E&ICT IIT Guwahati - Full Stack Web Development | E&ICT MNIT - AI and Machine Learning | E&ICT IIT Guwahati - UI UX Design Strategy | IITM Pravartak - Data Analytics for Business | E&ICT IIT Roorkee - Cloud Computing & DevOps | E&ICT MNIT - Cyber Security & Ethical Hacking | E&ICT MNIT - Business Analyst & Project Management | M. Tech in AI & ML

    Browse By Domains

    Big Data Analytics Courses | Data Science Courses | Business Intelligence courses | Best Salesforce Courses | Cloud Computing Courses | Best Digital Marketing Courses | Programming Courses Online | Database Certification Courses | Project Management Certification Courses | Best Web Development Certification courses | Automation Trainings | UI UX Course

    Popular Courses

    Data Science Courses | Best Artificial Certification Intelligence Course | Machine Learning Training | Python Course | DevOps Certification Course | AWS Training and Certification | Azure Certification | AWS DevOps Training | Azure DevOps Certification Course | Cyber Security Course | Ethical Hacking Course | Big Data Hadoop Certification | SQL Course | Salesforce Admin Certification | Online Salesforce Developer Certification | Selenium Training Online | Business Analyst Course Online | Data Analyst Certification course | Best Microsoft Power BI Certification Course | Tableau Course Online | Linux certification Course | Data Analytics Certification Course | Digital Marketing Course | Online Business Analytics Course | Online Investment Banking Course | Online Supply Chain Course | Online Electric Vehicle Course

    Top Tutorials

    Python Tutorial | AWS Tutorial | Devops Tutorial | Tableau Tutorial | Java Tutorial | Node Js Tutorial | Mongodb Tutorial | Mysql Tutorial | Git Tutorial | Kafka Tutorial | Cloud Computing Tutorial | Data Science Tutorial | Hadoop tutorial | Machine Learning Tutorial | PL/SQL Tutorial | Cyber Security Tutorial | Salesforce Tutorial | Informatica Tutorial | Azure Tutorial | Power BI Tutorial | SQL Tutorial | Selenium Tutorial | Ethical Hacking Tutorial | Artificial Intelligence Tutorial | Ansible Tutorial | Digital Marketing Tutorial | Data Analytics Tutorial | UI/UX Tutorial

    Top Articles

    What is Cloud Computing | What is Data Science | What is Machine Learning | What is AWS | What is Digital Marketing | What is Cyber Security | What is Salesforce | What is Artificial Intelligence | What is SQL | What is DevOps | What is Python | What is Blockchain | What is Data Analytics | What is Full Stack Developer | What is Web Development | What is Business Analytics | What is UI/UX Design | What is Ethical Hacking | What is Software Development

    Top Interview Questions

    Python Interview Questions | AWS Interview Questions | Data Science Interview Questions | Devops Interview Questions | Salesforce Interview Questions | Java Interview Questions | Html Interview Questions | React Interview Questions | Node Js Interview Questions | CSS Interview Questions | Selenium Interview Questions | SQL Interview Questions | Hadoop Interview Questions | Digital Marketing Interview Questions | Machine Learning Interview Questions | Cyber Security Interview Questions | Azure Interview Questions | Business Analyst Interview Questions and Answers | Cloud Computing Interview Questions | Tableau Interview Questions | Power Bi Interview Questions | Data Structure Interview Questions | Software Testing Interview Questions | Kubernetes Interview Questions | Jenkins Interview Questions | Docker Interview Questions | Data Analyst Interview Questions | Terraform Interview Questions | Git Interview Questions | Software Engineering Interview Questions | Data Warehouse Interview Questions | Chef Interview Questions
     
    推荐文章