Software /
code /
prosody
Diff
net/server_epoll.lua @ 11689:f9f6e82fb572
net.server_epoll: Add setting for disabling the Nagle algorithm
Nagle increases latency and is the bane of all networking!
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Wed, 14 Jul 2021 22:27:12 +0200 |
parent | 11688:3fc564f7441b |
child | 11694:d6be4dda1f60 |
line wrap: on
line diff
--- a/net/server_epoll.lua Wed Jul 14 22:13:30 2021 +0200 +++ b/net/server_epoll.lua Wed Jul 14 22:27:12 2021 +0200 @@ -83,6 +83,9 @@ -- TCP Keepalives tcp_keepalive = false; -- boolean | number + + -- Whether to let the Nagle algorithm stay enabled + nagle = true; }}; local cfg = default_config.__index; @@ -731,6 +734,9 @@ end function interface:defaultoptions() + if cfg.nagle == false then + self:setoption("tcp-nodelay", true); + end if cfg.tcp_keepalive then self:setoption("keepalive", true); if type(cfg.tcp_keepalive) == "number" then