cancel
Showing results for 
Search instead for 
Did you mean: 

HDB_NODEJS_THREADPOOL_SIZE not working

01-31-2023 5:42 AM
satish_kumar_kara Product and Topic Expert
2066 views 5 comments
0 Likes
SAP Managed Tags
Subscribe

We are using HDB_NODEJS_THREADPOOL_SIZE attribute to increase worker threads in pool as per the recommendation for one of our nodeJS CAP module. Internally we use sap-cds to get a transaction and run the db queries against hana cloud.

It helped us run the DB queries against HC parallelly.

A year back, I tested this in my laptop and it was working for me in one of our nodeJS(CAP) module.

Recently I found the attribute has no effect and same I verified in my laptop.

Initially I though may be some new OS upgrade is blocking this.

As HDB_NODEJS_THREADPOOL_SIZE overrides UV_THREADPOOL_SIZE, I tested libuv’s non-blocking IO feature by utilizing UV_THREADPOOL_SIZE attribute with the help of a sample nodejs program and it worked(not with CAP).

Want to understand if any change at CAP side blocking this?

0 Likes

Accepted Solutions (0)

Answers (2)

Answers (2)

0 Likes

Hi,

There have been no recent changes to the Node.js driver's usage of the HDB_NODEJS_THREADPOOL_SIZE environment variable and we have just confirmed that it works as expected in the latest version of the driver. Perhaps this environment variable is getting cleared before it reaches the Node.js driver by some intermediary layer.

Mike

satish_kumar_kara
Product and Topic Expert
Product and Topic Expert
0 Likes

Can you share more details on that?

0 Likes

My point was that although I don't know what's happening in the CAP layer, our team's testing for the Node.js driver itself shows the HDB_NODEJS_THREADPOOL_SIZE environment variable working as expected.

I notice that you've opened an internal support ticket for this issue. I believe this will be helpful in determining why your queries seem to be executing sequentially.

One thing that might help is turning on API call tracing in the Node.js driver to observe if the Node.js driver is being called concurrently or sequentially:

hdbsqldbc_cons trace filename nodejs-%p.txt

hdbsqldbc_cons TRACE API ON LEVEL DEBUG

https://help.sap.com/docs/SAP_HANA_CLIENT/f1b440ded6144a54ada97ff95dac7adf/dfcd6fa2e8bf49d98e1681bd7...

Mike

Johan_sapbasis
Active Contributor
0 Likes

Hi,

Perhaps check this:

https://help.sap.com/docs/SAP_HANA_CLIENT/79ae9d3916b84356a89744c65793b924/22485d2937c4427fbbedefe3c...

Node.js Environment Variables

The new HDB_NODEJS_THREADPOOL_SIZE environment variable specifies the number of worker threads in the thread pool. The formerly used UV_THREADPOOL_SIZE environment variable is still respected, but is overridden by HDB_NODEJS_THREADPOOL_SIZE. If neither is set, a default value of 4 worker threads is used.

Kind Regards,

Johan