# How to increase connection pool in node-red-node-sqlite node?

**URL:** <https://discourse.nodered.org/t/how-to-increase-connection-pool-in-node-red-node-sqlite-node/75112>\
**Category:** General\
**Created:** [13 February 2023 12:58 UTC](https://discourse.nodered.org/t/how-to-increase-connection-pool-in-node-red-node-sqlite-node/75112 "2023-02-13T12:58:44Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![Josh](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/josh/32/62208_2.png) [@Josh](https://discourse.nodered.org/u/Josh)\
**Post date:** [13 February 2023 12:58 UTC](https://discourse.nodered.org/t/how-to-increase-connection-pool-in-node-red-node-sqlite-node/75112/1 "2023-02-13T12:58:44Z")

</div>

Hi Forum and fellow devs and contributors,  
Just wanted to know if I can increase the connection pool? I dont have any option to do it in the node configuration. Please Help !!!

---

<div class="post-metadata">

**Author:** ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)\
**Post date:** [13 February 2023 13:16 UTC](https://discourse.nodered.org/t/how-to-increase-connection-pool-in-node-red-node-sqlite-node/75112/2 "2023-02-13T13:16:14Z")

</div>

I don't think the underlying library node-sqlite3 has a pool at all...

---

<div class="post-metadata">

**Author:** ![Josh](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/josh/32/62208_2.png) [@Josh](https://discourse.nodered.org/u/Josh)\
**Post date:** [13 February 2023 13:22 UTC](https://discourse.nodered.org/t/how-to-increase-connection-pool-in-node-red-node-sqlite-node/75112/3 "2023-02-13T13:22:30Z")

</div>

Thanks for the help. Anyways @dceejay I have another additional question when I performed a stress test by injecting many data using sqlite node my database is getting locked. In this case any suggestions to prevent those errors?

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [13 February 2023 15:07 UTC](https://discourse.nodered.org/t/how-to-increase-connection-pool-in-node-red-node-sqlite-node/75112/4 "2023-02-13T15:07:07Z")

</div>

Are you sending data to the db via multiple nodes or is it all going through one node? Are you sending data quicker than the database driver can cope it?

I tend to think that if you need to stress test it then you should not be using sqlite.

---

<div class="post-metadata">

**Author:** ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)\
**Post date:** [13 February 2023 16:25 UTC](https://discourse.nodered.org/t/how-to-increase-connection-pool-in-node-red-node-sqlite-node/75112/5 "2023-02-13T16:25:37Z")

</div>

Well there is another library called better-sqlite3 - that may be API compatible that claims to be a lot faster... so if someone/anyone wanted to clone the repo and create a tested Pull request that would be excellent... (I haven't used sqlite in a long time so not in a position to pick this up just now - but happy to look at a pull request).

---

<div class="post-metadata">

**Author:** ![Josh](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/josh/32/62208_2.png) [@Josh](https://discourse.nodered.org/u/Josh)\
**Post date:** [14 February 2023 05:20 UTC](https://discourse.nodered.org/t/how-to-increase-connection-pool-in-node-red-node-sqlite-node/75112/6 "2023-02-14T05:20:31Z")

</div>

Yes @Colin I am kinda stress testing it to know it capability. Indeed I am sending data quicker that it can handle to find the threshold so that I can customize my application accordingly.

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [14 February 2023 06:44 UTC](https://discourse.nodered.org/t/how-to-increase-connection-pool-in-node-red-node-sqlite-node/75112/7 "2023-02-14T06:44:36Z")

</div>

The important question was:

> [@Colin](#):
>
> Are you sending data to the db via multiple nodes or is it all going through one node?

As that would likely be the reason for locks

---

<div class="post-metadata">

**Author:** ![Josh](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/josh/32/62208_2.png) [@Josh](https://discourse.nodered.org/u/Josh)\
**Post date:** [14 February 2023 07:04 UTC](https://discourse.nodered.org/t/how-to-increase-connection-pool-in-node-red-node-sqlite-node/75112/8 "2023-02-14T07:04:05Z")

</div>

Yes I am sending data via multiple nodes. In this case what reason could that be?

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [14 February 2023 07:09 UTC](https://discourse.nodered.org/t/how-to-increase-connection-pool-in-node-red-node-sqlite-node/75112/9 "2023-02-14T07:09:06Z")

</div>

Sqlite is poor at handling multiple connections, it's simple underlying design makes it unsuitable for such tasks

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [28 February 2023 07:09 UTC](https://discourse.nodered.org/t/how-to-increase-connection-pool-in-node-red-node-sqlite-node/75112/10 "2023-02-28T07:09:06Z")

</div>

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
