aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2021-07-15 01:38:44 +0200
committerKim Alvefur <zash@zash.se>2021-07-15 01:38:44 +0200
commitc611398c1f1661f070c879cb0da4251d89abf1c1 (patch)
treec2bff716b5c8a05df5623a37040629f2d067e433 /net
parent79f35dccf0b76b5edc044211934431aa80ba77b6 (diff)
downloadprosody-c611398c1f1661f070c879cb0da4251d89abf1c1.tar.gz
prosody-c611398c1f1661f070c879cb0da4251d89abf1c1.zip
net.server_epoll: Set minimum wait time to 1ms, matching epoll
A timeout value less than 0.001 gets turned into zero on the C side, so epoll_wait() returns instantly and essentially busy-loops up to 1ms, e.g. when a timer event ends up scheduled (0, 0.001)ms into the future. Unsure if this has much effect in practice, but it may waste a small amount of CPU time. How much would depend on how often this ends up happening and how fast the CPU gets trough main loop iterations.
Diffstat (limited to 'net')
-rw-r--r--net/server_epoll.lua2
1 files changed, 1 insertions, 1 deletions
diff --git a/net/server_epoll.lua b/net/server_epoll.lua
index 415abd7f..2a7a0b28 100644
--- a/net/server_epoll.lua
+++ b/net/server_epoll.lua
@@ -65,7 +65,7 @@ local default_config = { __index = {
-- Maximum and minimum amount of time to sleep waiting for events (adjusted for pending timers)
max_wait = 86400;
- min_wait = 1e-06;
+ min_wait = 0.001;
-- Enable extra noisy debug logging
-- TODO disable once considered stable