Skip to content
Snippets Groups Projects
Commit bcd13810 authored by Konstantin Osipov's avatar Konstantin Osipov
Browse files

net.box: avoid unnecessary syscalls when socket is ready most of the time

Don't run event loop if socket is ready to write. *Always* write
optimistically. With fiber.channel(), channel push  wakes up the waiter
without in the same event loop iteration. This means that whenever we have
data on an incoming connection, we can push messages to outgoing connections
in the same iteration, without epoll_ctl syscalls or unnecessary
epoll_wait.
With 1 incoming and 5 outgoing connections, for example, this saves
~10 syscalls per each incoming request.
parent 4fe85243
No related branches found
No related tags found
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment