From 914d6a5e7ac20d76d6cf489084f473ab004acd2a Mon Sep 17 00:00:00 2001 From: Christopher Jones Date: Sat, 9 May 2020 12:34:40 +1000 Subject: [PATCH] Update examples to show how to set UV_THREADPOOL_SIZE --- examples/connectionpool.js | 7 ++++++- examples/webappawait.js | 5 +++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/examples/connectionpool.js b/examples/connectionpool.js index 26dec134..07719168 100644 --- a/examples/connectionpool.js +++ b/examples/connectionpool.js @@ -1,4 +1,4 @@ -/* Copyright (c) 2018, 2019, Oracle and/or its affiliates. All rights reserved. */ +/* Copyright (c) 2018, 2020, Oracle and/or its affiliates. All rights reserved. */ /****************************************************************************** * @@ -33,6 +33,11 @@ * *****************************************************************************/ +// If you increase poolMax, you must increase UV_THREADPOOL_SIZE before Node.js +// starts its thread pool. If you set UV_THREADPOOL_SIZE too late, the value is +// ignored and the default size of 4 is used. +// process.env.UV_THREADPOOL_SIZE = 4; + const oracledb = require('oracledb'); const dbConfig = require('./dbconfig.js'); diff --git a/examples/webappawait.js b/examples/webappawait.js index af789e32..e83fd363 100644 --- a/examples/webappawait.js +++ b/examples/webappawait.js @@ -34,6 +34,11 @@ * *****************************************************************************/ +// If you increase poolMax, you must increase UV_THREADPOOL_SIZE before Node.js +// starts its thread pool. If you set UV_THREADPOOL_SIZE too late, the value is +// ignored and the default size of 4 is used. +// process.env.UV_THREADPOOL_SIZE = 4; + const http = require('http'); const oracledb = require('oracledb'); const dbConfig = require('./dbconfig.js');