GeezerVison is showing github.com — http: set lifo as the default scheduling strategy in Agent · nodejs/node@f70aee0
File tree
Expand file treeCollapse file tree
Open diff view settings
Expand file treeCollapse file tree
Open diff view settings
Collapse file
Copy file name to clipboardExpand all lines: doc/api/http.md +4-1Lines changed: 4 additions & 1 deletion - Display the source diff
- Display the rich diff
| Original file line number | Diff line number | Diff line change |
|---|
@@ -113,6 +113,9 @@ http.get({ |
113 | 113 | <!-- YAML |
114 | 114 | added: v0.3.4 |
115 | 115 | changes: |
| 116 | + - version: REPLACEME |
| 117 | + pr-url: https://github.com/nodejs/node/pull/36685 |
| 118 | + description: Change the default scheduling from 'fifo' to 'lifo'. |
116 | 119 | - version: v14.5.0 |
117 | 120 | pr-url: https://github.com/nodejs/node/pull/33617 |
118 | 121 | description: Add `maxTotalSockets` option to agent constructor. |
@@ -157,7 +160,7 @@ changes: |
157 | 160 | In case of a high rate of request per second, |
158 | 161 | the `'fifo'` scheduling will maximize the number of open sockets, |
159 | 162 | while the `'lifo'` scheduling will keep it as low as possible. |
160 | | - **Default:** `'fifo'`. |
| 163 | + **Default:** `'lifo'`. |
161 | 164 | * `timeout` {number} Socket timeout in milliseconds. |
162 | 165 | This will set the timeout when the socket is created. |
163 | 166 |
|
|
Collapse file
Copy file name to clipboardExpand all lines: lib/_http_agent.js +1-1Lines changed: 1 addition & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -94,7 +94,7 @@ function Agent(options) { |
94 | 94 | this.keepAlive = this.options.keepAlive || false; |
95 | 95 | this.maxSockets = this.options.maxSockets || Agent.defaultMaxSockets; |
96 | 96 | this.maxFreeSockets = this.options.maxFreeSockets || 256; |
97 | | - this.scheduling = this.options.scheduling || 'fifo'; |
| 97 | + this.scheduling = this.options.scheduling || 'lifo'; |
98 | 98 | this.maxTotalSockets = this.options.maxTotalSockets; |
99 | 99 | this.totalSocketCount = 0; |
100 | 100 |
|
|
Collapse file
Copy file name to clipboardExpand all lines: test/parallel/test-http-agent-scheduling.js +3-3Lines changed: 3 additions & 3 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -56,11 +56,11 @@ function defaultTest() { |
56 | 56 |
|
57 | 57 | bulkRequest(url, agent, (ports) => { |
58 | 58 | makeRequest(url, agent, (port) => { |
59 | | - assert.strictEqual(ports[0], port); |
| 59 | + assert.strictEqual(ports[ports.length - 1], port); |
60 | 60 | makeRequest(url, agent, (port) => { |
61 | | - assert.strictEqual(ports[1], port); |
| 61 | + assert.strictEqual(ports[ports.length - 1], port); |
62 | 62 | makeRequest(url, agent, (port) => { |
63 | | - assert.strictEqual(ports[2], port); |
| 63 | + assert.strictEqual(ports[ports.length - 1], port); |
64 | 64 | server.close(); |
65 | 65 | agent.destroy(); |
66 | 66 | }); |
|