Skip to content

Commit cca5d68

Browse files
committed
erts: Cap the adaptive esock rcvbuf at 256 KB
Draining a local bulk stream on an M2 Pro is flat or slightly better with a 128 KB or 256 KB cap (7.4-7.6 GB/s) than with 1 MB (6.0 GB/s), so past the point where the buffer amortises the syscall the larger memcpy only costs. 256 KB keeps 2x headroom over the measured knee for links with more latency than loopback.
1 parent 595c377 commit cca5d68

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

erts/emulator/nifs/unix/unix_socket_syncio.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@
214214
* the configured size once an EWMA of the read sizes falls below a
215215
* quarter of it.
216216
*/
217-
#define ESSIO_RECV_ADAPT_BUFFER_MAX (1 << 20)
217+
#define ESSIO_RECV_ADAPT_BUFFER_MAX (1 << 18)
218218
#define ESSIO_RECV_ADAPT_EWMA_SHIFT 3
219219
// #define sock_close_event(e) /* do nothing */
220220
#define sock_connect(s, addr, len) connect((s), (addr), (len))

0 commit comments

Comments
 (0)