Software /
code /
prosody
Changeset
12084:59557bc3c4b8 0.11
net.server_epoll: Process all queued events from epoll before timers
Should call timers less frequently when many sockets are waiting for
processing. May help under heavy load.
Requested by Ge0rG
Backport of 2bcd84123eba requested by Roi
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Thu, 21 Oct 2021 15:59:16 +0200 |
parents | 11844:0f786c4a2cb2 |
children | 12085:1d213c6f781b |
files | net/server_epoll.lua |
diffstat | 1 files changed, 4 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/net/server_epoll.lua Tue Oct 12 14:53:45 2021 +0200 +++ b/net/server_epoll.lua Thu Oct 21 15:59:16 2021 +0200 @@ -771,7 +771,7 @@ repeat local t = runtimers(cfg.max_wait, cfg.min_wait); local fd, r, w = poll:wait(t); - if fd then + while fd do local conn = fds[fd]; if conn then if r then @@ -784,7 +784,9 @@ log("debug", "Removing unknown fd %d", fd); poll:del(fd); end - elseif r ~= "timeout" and r ~= "signal" then + fd, r, w = poll:wait(0); + end + if r ~= "timeout" and r ~= "signal" then log("debug", "epoll_wait error: %s[%d]", r, w); end until once or (quitting and next(fds) == nil);