Skip to content

Commit 13b60b7

Browse files
committed
Use lifo scheduling by default
This is the default in node v15.6 but will improve performance by reusing the most recently used sockets first, reducing the likelihood of keepalive timeouts and ECONNRESETs.
1 parent 232de67 commit 13b60b7

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

CHANGELOG.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,16 @@ This driver uses semantic versioning:
1414
- A change in the major version (e.g. 1.Y.Z -> 2.0.0) indicates _breaking_
1515
changes that require changes in your code to upgrade.
1616

17+
## [Unreleased]
18+
19+
### Changed
20+
21+
- Changed the default for `agentOptions.scheduling` to `"lifo"`
22+
23+
This is already the default in Node v15.6 but can reduce latency caused by
24+
sockets expiring, especially with larger connection pools and infrequent
25+
requests.
26+
1727
## [7.2.0] - 2020-12-02
1828

1929
### Added
@@ -1126,6 +1136,7 @@ For a detailed list of changes between pre-release versions of v7 see the
11261136

11271137
Graph methods now only return the relevant part of the response body.
11281138

1139+
[unreleased]: https://github.com/arangodb/arangojs/compare/v7.2.0...HEAD
11291140
[7.2.0]: https://github.com/arangodb/arangojs/compare/v7.1.1...v7.2.0
11301141
[7.1.1]: https://github.com/arangodb/arangojs/compare/v7.1.0...v7.1.1
11311142
[7.1.0]: https://github.com/arangodb/arangojs/compare/v7.0.2...v7.1.0

src/connection.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -519,6 +519,7 @@ export class Connection {
519519
maxSockets: 3,
520520
keepAlive: true,
521521
keepAliveMsecs: 1000,
522+
scheduling: "lifo",
522523
...config.agentOptions,
523524
};
524525
this._maxTasks = this._agentOptions.maxSockets;

0 commit comments

Comments
 (0)