Large database connection timeout [Feb 18]

:raising_hand_man: vchans asked

@here, I’m trying to connect to AZURE sql database which has 200MB of data and 115 tables in it, The connection is successfuly, but it only retrives few tables in each time I create new project. Its totally inconsistent and there are few table schemas retrived but no data is fetched. Can anyone helpme out

The above case is with heroku deploy

To reproduce in local I’ve setup the application and connected to local mysql server the behaviour is same. I can see the logs with request timeout error

I’m attaching the log file here . Please let me know if there is more information needed for the same

timeout_error.txt

:man_bald: dstala replied

vchans@discord , we suspect timeout in this case could be happening due to large dataset.

Knex.js library that we use provides default timeout set to 15000 ms (15 seconds). Could you try changing this to a higher number, say 300000.

You can find details in below video to update knex.js configuration.

https://www.youtube.com/watch?v=rS0NRwRCjx0

We need to re-configure requestTimeout parameter & set it as requestTimeout: 300000

:man_bald: dstala replied

As guided in YouTube shared above, once you open “Edit Connection JSON” under SSL & Advanced Parameters - you will find something like below

“connection”: {

“host”: “localhost”,

“port”: “3306”,

“user”: “root”,

“password”: “password”,

“database”: “sakila”

},

Change this to

“connection”: {

“host”: “localhost”,

“port”: “3306”,

“user”: “root”,

“password”: “password”,

“database”: “sakila”,

“connectTimeout”: “300000”

},

:man_bald: dstala replied

In case if issue still persists, ping here. We will look into other possible configurations required.

:raising_hand_man: vchans replied

Its didn’t helped, The issue still exists, It only retrived 2 tables

:man_bald: dstala replied

can you help us with the error text in this iteration?

:man_bald: dstala replied

Apologies, my bad. Can we try with reconfiguring “requestTimeout”.

“connection”: {

“host”: “localhost”,

“port”: “3306”,

“user”: “root”,

“password”: “password”,

“database”: “sakila”,

“requestTimeout”: “300000”

},

:raising_hand_man: vchans replied

dstala@discord , Thanks for the suggestion, now we’re getting this error in console

KnexTimeoutError: Knex: Timeout acquiring a connection. The pool is probably ful

l. Are you missing a .transacting(trx) call?

I’ve added both requestTimeout and connectTimeout

poll_error.txt

:person_tipping_hand: o1lab replied

Try simple knexJs connection in a js file. See if it goes through. Where is database based

:raising_hand_man: vchans replied

sure, I’ll give it a try

:raising_hand_man: vchans replied

o1lab@discord dstala@discord , Finally it worked after few iterations and increased the connectTimeout, requestTimeout, acquireConnectionTimeout to 1800000. Still there are few tables with more than 2 lakh records are partially retrived the data, rest all tables reflects with 100% data. Also I’ve updated the pool size

“connection”: {

“host”: “localhost”,

“port”: “47536”,

“user”: “MyLogin”,

“password”: “password”,

“database”: “sakila”,

“connectTimeout”: “1800000”,

“requestTimeout”: 1800000,

“ssl”: {

“ca”: “”,

“key”: “”,

“cert”: “”

}

},

“pool”: {

“min”: 0,

“max”: 10

},

“acquireConnectionTimeout”: 1800000,

:person_tipping_hand: o1lab replied

will DM

:person_tipping_hand: o1lab replied

can u pls paste the project info ? looks like this is mssql ?

:person_tipping_hand: o1lab replied

if a table is having a lot of records, it shouldnt take any longer as we only fetch paginated result

Autogenerated from discord


Join NocoDB’s community

DiscordTwitterRedditDocs