[pgjdbc/pgjdbc] c14439: perf: enable tcpNoDelay by default (#2495)

Поиск
Список
Период
Сортировка
Искать

[pgjdbc/pgjdbc] c14439: perf: enable tcpNoDelay by default (#2495)

От:
Olivier Bourgain <noreply@github.com>
Дата:
  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.




FAQ