ibmdb / node-ibm_db

IBM DB2 and IBM Informix bindings for node
MIT License
188 stars 151 forks source link

SSL connection to db2 is slower #930

Closed DaisyYangl closed 1 year ago

DaisyYangl commented 1 year ago

Hello team, We used the connection string to connect DB2 and it worked well, but we met a issue is: it takes too much time to get connection . Nodejs: v14/ v16 ibm_db: "^2.7.3" const stringconnStr = "DATABASE=database;HOSTNAME=hostname;PORT=port;Security=SSL;SSLServerCertificate=;PROTOCOL=TCPIP;UID=username;PWD=passwd;"; This is the time cost: No ssl connection: 870.773ms ssl_connection: 3.385s

Do you have any suggestion how to improve this since our each API request will connect to DB2 once? Thanks so much!

bimalkjha commented 1 year ago

@DaisyYangl Try using connection pooling as used this test file for faster connection. pool.init() will open all connections and will keep it in pool to be used by pool.open(). You can also update your ibm_db to 3.2.1 version which is the latest version and few pool related issues are fixed in it. Still facing issue, let us know the Operating System name on which you have installed ibm_db. We'll share commands to collect db2traces using which we can find the root cause and which step is taking more time for SSL and non-SSL connection. Thanks.