Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nhSjH-0001Lo-C4 for pgsql-jdbc@arkaria.postgresql.org; Thu, 21 Apr 2022 09:03:59 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1nhSjF-0000fM-6i for pgsql-jdbc@arkaria.postgresql.org; Thu, 21 Apr 2022 09:03:57 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nhSjE-0000fA-Tj for pgsql-jdbc@lists.postgresql.org; Thu, 21 Apr 2022 09:03:56 +0000 Received: from out-21.smtp.github.com ([192.30.252.204] helo=smtp.github.com) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nhSjA-00033q-PO for pgsql-jdbc@lists.postgresql.org; Thu, 21 Apr 2022 09:03:54 +0000 Received: from github.com (hubbernetes-node-7778b86.ac4-iad.github.net [10.52.202.17]) by smtp.github.com (Postfix) with ESMTPA id BDA82521A40 for ; Thu, 21 Apr 2022 02:03:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=github.com; s=pf2014; t=1650531830; bh=wrsdJ6XZeyGZ9mvQv5vvSF9H3LpYQapGmKeitzhSDWY=; h=Date:From:To:Subject:From; b=szV4+1Tnzmba07Q1DPS703ZfQrSgI3ZwFvFbTBkuFR5Xr9kAlTA3UKh4ApMz5Go84 cht4jGfsRZ+eLOxj7TzmH22CvfZuRdGieXImi13O4NCLsieFZkhKgFG7AnZx1303s3 vqrAFXyrA4usF15bEcmJRTgWT9OL3PBwVgoGPgzs= Date: Thu, 21 Apr 2022 02:03:50 -0700 From: Olivier Bourgain To: pgsql-jdbc@lists.postgresql.org Message-ID: Subject: [pgjdbc/pgjdbc] c14439: perf: enable tcpNoDelay by default (#2495) Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Approved: 58GruLoMopuc X-GitHub-Recipient-Address: pgsql-jdbc@lists.postgresql.org X-Auto-Response-Suppress: All List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Branch: refs/heads/master Home: https://github.com/pgjdbc/pgjdbc Commit: c144392f79a2e5d7f62bd9164ca7dc18438159c3 https://github.com/pgjdbc/pgjdbc/commit/c144392f79a2e5d7f62bd9164ca7dc18438159c3 Author: Olivier Bourgain Date: 2022-04-21 (Thu, 21 Apr 2022) Changed paths: M docs/documentation/head/connect.md M pgjdbc/src/main/java/org/postgresql/PGProperty.java M pgjdbc/src/main/java/org/postgresql/core/PGStream.java Log Message: ----------- perf: enable tcpNoDelay by default (#2495) In [#2341](https://github.com/pgjdbc/pgjdbc/pull/2341) the option to configure tcpNoDelay was added, with a default value of false. The previous value of this setting was true, as set in PGStream.changeSocket(Socket) with the following code: ``` // Submitted by Jason Venner . Disable Nagle // as we are selective about flushing output only when we // really need to. connection.setTcpNoDelay(true); ``` `changeSocket()` is called from the `PGStream` constructor, which is called in `ConnectionFactoryImpl`, and then later we overwrite the value with the one from the properties. We had a performance issue when upgrading from 42.2.24 to 42.3.3, and we suspected the issue in 42.3.2 and confirmed that by passing the property `tcpNoDelay=true` to the driver, the performance issue was fixed.