Please sign in to comment.
Scheduler: new REUSEPORT balancing method/architecture.
Starting from Linux Kernel 3.9, there is a new TCP/UDP socket option which allows to bind same port and address from multiples threads (or any instance under the same process context). This patch implements the SO_REUSEPORT TCP Flag if the running Kernel is >= 3.9, so on that mode each working thread create it own socket that bind the same address, with this implementation we reduce the number of system calls involved when a new connection arrives, avoid lookup the lowest loaded thread and also we allow the Kernel to perform a better Scheduling on SMP systems that requires to scale. If the detected Kernel is lower than 3.9, it will use the old Fair Balancing mechanism. Signed-off-by: Eduardo Silva <email@example.com>
Showing with 134 additions and 22 deletions.
- +9 −3 plugins/liana/liana.c
- +2 −1 src/include/MKPlugin.h
- +2 −1 src/include/mk_config.h
- +1 −1 src/include/mk_epoll.h
- +2 −1 src/include/mk_plugin.h
- +20 −0 src/include/mk_scheduler.h
- +6 −1 src/include/mk_socket.h
- +9 −1 src/mk_config.c
- +20 −2 src/mk_epoll.c
- +1 −0 src/mk_plugin.c
- +37 −5 src/mk_scheduler.c
- +5 −0 src/mk_server.c
- +8 −3 src/mk_socket.c
- +12 −3 src/monkey.c
Oops, something went wrong.