# HG changeset patch # User Kim Alvefur # Date 1626294432 -7200 # Node ID f9f6e82fb57266bb9e76aa7044f0724043170051 # Parent 3fc564f7441beed827710a2649748e377e06bc93 net.server_epoll: Add setting for disabling the Nagle algorithm Nagle increases latency and is the bane of all networking! diff -r 3fc564f7441b -r f9f6e82fb572 net/server_epoll.lua --- 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