简体   繁体   中英

How to set TCP NODELAY for db connections on a spring boot application

I have a java web application built on spring boot and spring data using Hikari pool, deployed in azure Kubernetes cluster, connecting to azure postgres database. To solve a performance issue the Azure team has advised to set TCP NODELAY for this application. Can you please advise how to configure this for the spring application

Current version of PostgreSQL JDBC Driver (42.3.1) does not support TCP_NODELAY option. But next version (42.3.2) will be supported.

After 42.3.2 version you can use TCP_NODELAY option by adding 'tcpNoDelay=true' at the end of the JDBC URL like jdbc:postgresql://localhost:5432/postgres?tcpNoDelay=true

The issue link: https://github.com/pgjdbc/pgjdbc/issues/2324

The commit link: https://github.com/pgjdbc/pgjdbc/commit/2a8ecbe2321ed92bc7051d3415a0484a5464346b#diff-af76c66c8a01becfcbfe739ba0cc2e4333e7d27865cb67cbb63db2e6f534801a

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM