Skip to content

Commit 17e840c

Browse files
committed
Add notes on max thread pool size and on RWP Group recommendations
1 parent 2a2b25e commit 17e840c

File tree

1 file changed

+19
-2
lines changed

1 file changed

+19
-2
lines changed

doc/api.md

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2680,8 +2680,8 @@ oracledb.getConnection(
26802680
26812681
### <a name="numberofthreads"></a> 8.2 Connections and Number of Threads
26822682
2683-
If you use a large number of connections, such as via increasing
2684-
[`poolMax`](#proppoolpoolmax), you may want to also increase the
2683+
If you open more than four connections, such as via
2684+
increasing [`poolMax`](#proppoolpoolmax), you should increase the
26852685
number of threads available to node-oracledb.
26862686
26872687
Node.js worker threads executing database statements on a connection will
@@ -2703,6 +2703,14 @@ can be increased to 10 by using the following command:
27032703
$ UV_THREADPOOL_SIZE=10 node myapp.js
27042704
```
27052705
2706+
The thread pool size should be at least equal to the maxiumum number
2707+
of connections. If the application does database and non-database
2708+
work concurrently, extra threads could also be required for optimal
2709+
throughput.
2710+
2711+
Note the '[libuv](https://github.com/libuv/libuv)' library used by
2712+
Node.js limits the number of threads to 128.
2713+
27062714
### <a name="connpooling"></a> 8.3 Connection Pooling
27072715
27082716
When applications use a lot of connections for short periods, Oracle
@@ -2770,6 +2778,15 @@ Pool attributes [`poolIncrement`](#proppoolpoolincrement),
27702778
Authentication is used, the pool behavior is different, see
27712779
[External Authentication](#extauth).
27722780
2781+
The Oracle Real-World Performance Group's general recommendation for
2782+
client connection pools is for the minimum and maximum number of
2783+
connections to be the same. This avoids connection storms which can
2784+
decrease throughput. They also recommend sizing connection pools so
2785+
that the sum of all connections from all applications accessing a
2786+
database gives 1-10 connections per database server CPU core.
2787+
See
2788+
[About Optimizing Real-World Performance with Static Connection Pools](http://docs.oracle.com/cd/E82638_01/JJUCP/optimizing-real-world-performance.htm#JJUCP-GUID-BC09F045-5D80-4AF5-93F5-FEF0531E0E1D).
2789+
27732790
The Pool attribute [`stmtCacheSize`](#propconnstmtcachesize) can be
27742791
used to set the statement cache size used by connections in the pool,
27752792
see [Statement Caching](#stmtcache).

0 commit comments

Comments
 (0)