aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2021-07-14 22:27:12 +0200
committerKim Alvefur <zash@zash.se>2021-07-14 22:27:12 +0200
commit005e93100580f29f888d361977d35eb391e7097d (patch)
tree2e531c0922cf20c76d8aba68f347804da8868dca /net
parent15dd3e56878b2deb7918add604e0dcb33073dafb (diff)
downloadprosody-005e93100580f29f888d361977d35eb391e7097d.tar.gz
prosody-005e93100580f29f888d361977d35eb391e7097d.zip
net.server_epoll: Add setting for disabling the Nagle algorithm
Nagle increases latency and is the bane of all networking!
Diffstat (limited to 'net')
-rw-r--r--net/server_epoll.lua6
1 files changed, 6 insertions, 0 deletions
diff --git a/net/server_epoll.lua b/net/server_epoll.lua
index 4ffaf506..415abd7f 100644
--- a/net/server_epoll.lua
+++ b/net/server_epoll.lua
@@ -83,6 +83,9 @@ local default_config = { __index = {
-- 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 @@ function interface:init()
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