# Large database connection timeout \[Feb 18\]

**URL:** <https://community.nocodb.com/t/large-database-connection-timeout-feb-18/203>\
**Category:** Discord-Discussions\
**Created:** [November 3, 2022, 8:01am UTC](https://community.nocodb.com/t/large-database-connection-timeout-feb-18/203 "2022-11-03T08:01:04Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![NocoDB](https://avatars.discourse-cdn.com/v4/letter/n/6f9a4e/32.png) [@NocoDB](https://community.nocodb.com/u/NocoDB)\
**Post date:** [November 3, 2022, 8:01am UTC](https://community.nocodb.com/t/large-database-connection-timeout-feb-18/203/1 "2022-11-03T08:01:04Z")

</div>

> 🙋‍♂️ **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](https://cdn.discordapp.com/attachments/661905455894888493/943768442903875584/timeout_error.txt)

---

<div class="post-metadata">

**Author:** ![NocoDB](https://avatars.discourse-cdn.com/v4/letter/n/6f9a4e/32.png) [@NocoDB](https://community.nocodb.com/u/NocoDB)\
**Post date:** [November 3, 2022, 8:01am UTC](https://community.nocodb.com/t/large-database-connection-timeout-feb-18/203/2 "2022-11-03T08:01:05Z")

</div>

> 👨‍🦲 **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](https://www.youtube.com/watch?v=rS0NRwRCjx0)

#### 

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

#

---

<div class="post-metadata">

**Author:** ![NocoDB](https://avatars.discourse-cdn.com/v4/letter/n/6f9a4e/32.png) [@NocoDB](https://community.nocodb.com/u/NocoDB)\
**Post date:** [November 3, 2022, 8:01am UTC](https://community.nocodb.com/t/large-database-connection-timeout-feb-18/203/3 "2022-11-03T08:01:07Z")

</div>

> 👨‍🦲 **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”

#### },

#

---

<div class="post-metadata">

**Author:** ![NocoDB](https://avatars.discourse-cdn.com/v4/letter/n/6f9a4e/32.png) [@NocoDB](https://community.nocodb.com/u/NocoDB)\
**Post date:** [November 3, 2022, 8:01am UTC](https://community.nocodb.com/t/large-database-connection-timeout-feb-18/203/4 "2022-11-03T08:01:08Z")

</div>

> 👨‍🦲 **dstala** _replied_

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

#

---

<div class="post-metadata">

**Author:** ![NocoDB](https://avatars.discourse-cdn.com/v4/letter/n/6f9a4e/32.png) [@NocoDB](https://community.nocodb.com/u/NocoDB)\
**Post date:** [November 3, 2022, 8:01am UTC](https://community.nocodb.com/t/large-database-connection-timeout-feb-18/203/5 "2022-11-03T08:01:09Z")

</div>

> 🙋‍♂️ **vchans** _replied_

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

#

---

<div class="post-metadata">

**Author:** ![NocoDB](https://avatars.discourse-cdn.com/v4/letter/n/6f9a4e/32.png) [@NocoDB](https://community.nocodb.com/u/NocoDB)\
**Post date:** [November 3, 2022, 8:01am UTC](https://community.nocodb.com/t/large-database-connection-timeout-feb-18/203/6 "2022-11-03T08:01:10Z")

</div>

> 👨‍🦲 **dstala** _replied_

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

#

---

<div class="post-metadata">

**Author:** ![NocoDB](https://avatars.discourse-cdn.com/v4/letter/n/6f9a4e/32.png) [@NocoDB](https://community.nocodb.com/u/NocoDB)\
**Post date:** [November 3, 2022, 8:01am UTC](https://community.nocodb.com/t/large-database-connection-timeout-feb-18/203/7 "2022-11-03T08:01:11Z")

</div>

> 👨‍🦲 **dstala** _replied_

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

#### 

#### “connection”: {

#### “host”: “localhost”,

#### “port”: “3306”,

#### “user”: “root”,

#### “password”: “password”,

#### “database”: “sakila”,

#### “requestTimeout”: “300000”

#### },

#

---

<div class="post-metadata">

**Author:** ![NocoDB](https://avatars.discourse-cdn.com/v4/letter/n/6f9a4e/32.png) [@NocoDB](https://community.nocodb.com/u/NocoDB)\
**Post date:** [November 3, 2022, 8:01am UTC](https://community.nocodb.com/t/large-database-connection-timeout-feb-18/203/8 "2022-11-03T08:01:12Z")

</div>

> 🙋‍♂️ **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](https://cdn.discordapp.com/attachments/943768443172298783/943794034051264522/poll_error.txt)

#

---

<div class="post-metadata">

**Author:** ![NocoDB](https://avatars.discourse-cdn.com/v4/letter/n/6f9a4e/32.png) [@NocoDB](https://community.nocodb.com/u/NocoDB)\
**Post date:** [November 3, 2022, 8:01am UTC](https://community.nocodb.com/t/large-database-connection-timeout-feb-18/203/9 "2022-11-03T08:01:13Z")

</div>

> 💁 **o1lab** _replied_

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

#

---

<div class="post-metadata">

**Author:** ![NocoDB](https://avatars.discourse-cdn.com/v4/letter/n/6f9a4e/32.png) [@NocoDB](https://community.nocodb.com/u/NocoDB)\
**Post date:** [November 3, 2022, 8:01am UTC](https://community.nocodb.com/t/large-database-connection-timeout-feb-18/203/10 "2022-11-03T08:01:15Z")

</div>

> 🙋‍♂️ **vchans** _replied_

#### sure, I’ll give it a try

#

---

<div class="post-metadata">

**Author:** ![NocoDB](https://avatars.discourse-cdn.com/v4/letter/n/6f9a4e/32.png) [@NocoDB](https://community.nocodb.com/u/NocoDB)\
**Post date:** [November 3, 2022, 8:01am UTC](https://community.nocodb.com/t/large-database-connection-timeout-feb-18/203/11 "2022-11-03T08:01:16Z")

</div>

> 🙋‍♂️ **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,

#

---

<div class="post-metadata">

**Author:** ![NocoDB](https://avatars.discourse-cdn.com/v4/letter/n/6f9a4e/32.png) [@NocoDB](https://community.nocodb.com/u/NocoDB)\
**Post date:** [November 3, 2022, 8:01am UTC](https://community.nocodb.com/t/large-database-connection-timeout-feb-18/203/12 "2022-11-03T08:01:17Z")

</div>

> 💁 **o1lab** _replied_

#### will DM

#

---

<div class="post-metadata">

**Author:** ![NocoDB](https://avatars.discourse-cdn.com/v4/letter/n/6f9a4e/32.png) [@NocoDB](https://community.nocodb.com/u/NocoDB)\
**Post date:** [November 3, 2022, 8:01am UTC](https://community.nocodb.com/t/large-database-connection-timeout-feb-18/203/13 "2022-11-03T08:01:18Z")

</div>

> 💁 **o1lab** _replied_

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

#

---

<div class="post-metadata">

**Author:** ![NocoDB](https://avatars.discourse-cdn.com/v4/letter/n/6f9a4e/32.png) [@NocoDB](https://community.nocodb.com/u/NocoDB)\
**Post date:** [November 3, 2022, 8:01am UTC](https://community.nocodb.com/t/large-database-connection-timeout-feb-18/203/14 "2022-11-03T08:01:19Z")

</div>

> 💁 **o1lab** _replied_

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

#

---

<div class="post-metadata">

**Author:** ![NocoDB](https://avatars.discourse-cdn.com/v4/letter/n/6f9a4e/32.png) [@NocoDB](https://community.nocodb.com/u/NocoDB)\
**Post date:** [November 3, 2022, 8:01am UTC](https://community.nocodb.com/t/large-database-connection-timeout-feb-18/203/15 "2022-11-03T08:01:20Z")

</div>

[Autogenerated from discord](https://discord.com/channels/661905455894888490/943768443172298783)

* * *

#### Join [NocoDB’s](http://www.nocodb.com/) community

[Discord](https://discord.gg/5RgZmkW) • [Twitter](https://twitter.com/nocodb) • [Reddit](https://www.reddit.com/r/NocoDB/) • [Docs](https://docs.nocodb.com/)
