undici pipelining & idempotent
See original GitHub issueIf you want to take advantage of HTTP pipelining with undici you should probably set the idempotent: true
option to the POST
/PUT
requests that are idempotent, e.g. /_bulk
. Otherwise undici won’t pipeline them.
Refs: https://undici.nodejs.org/#/docs/api/Dispatcher?id=parameter-dispatchoptions
Issue Analytics
- State:
- Created 2 years ago
- Comments:14 (5 by maintainers)
Top Results From Across the Web
undici/README.md - UNPKG
27, undici - pipeline x 31,321 ops/sec ±0.77% (276 runs sampled) ... 111, * `idempotent: Boolean`, whether the requests can be safely retried...
Read more >undici - npm
Start using undici in your project by running `npm i undici`. ... Non-idempotent requests will not be pipelined in order to avoid indirect...
Read more >undici 4.5: A Modern HTTP/1.1 Client for Node.js - Morioh
idempotent : Boolean, whether the requests can be safely retried or not. If false the request won't be sent until all preceding requests...
Read more >HTTP pipelining - Wikipedia
HTTP pipelining is a feature of HTTP/1.1 which allows multiple HTTP requests to be sent over a single TCP connection without waiting for...
Read more >github.com-nodejs-undici_-_2021-02-17_21-48-37
An HTTP/1.1 client, written from scratch for Node.js undici A HTTP/1.1 ... Non-idempotent requests will not be pipelined in orderto avoid ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
By default, the client will always consume the body (you can find here how undici is being used), but advanced users can pass the
asStream
option which will give them back the raw stream from undici. You are right that we should mention the risks of doing so in the docs 😃Then you might want to set
keepAliveTimeout: 5 * 60e3
or something so that undici doesn’t aggressively disconnect. The default is quite short to be safe.