git: accept: Implement fast soaccept predication
Sepherosa Ziehau
sephe at crater.dragonflybsd.org
Thu Nov 24 17:44:54 PST 2011
commit 5e4b399478dd637a5a3939ddd2ebb4c5cffd3138
Author: Sepherosa Ziehau <sephe at dragonflybsd.org>
Date: Thu Nov 24 13:53:54 2011 +0800
accept: Implement fast soaccept predication
Fast soaccept predication tries to run soaccept_predicate before
domsg to the proto-thread, i.e. put the current thread into sleep.
We could do this because listen socket's completion list is always
protected by the listen socket's pool-token. Domsg to proto-thread
to extract socket from completion list for non-block listen socket
does not make any sense. Even for blocking listen socket if there
are sockets on the completion list, domsg to the proto-thread to
extract socket from completion list also wastes time.
The result:
192.168.249.42 (Xeon E3-1230 HT enabled, 16G) runs httperf
192.168.249.29 (i7-2600 HT enabled, 16G) runs nginx (web server)
The server runs nginx-1.0.4 (from pkgsrc-2011Q2), using the default
configure w/ following changes:
events {
worker_connections 10240;
use kqueue;
}
The client runs httperf-0.9.0 manually compiled w/ FD_SETSIZE to 16424
The client machine runs following commands before starting benching:
net.inet.ip.portrange.last=60000
route change -net 192.168.249.0/24 -msl 500
16 parallel httperf --server=192.168.249.29 --wsess=5000,1,1 --max-conn=4
4 runs (Request rate, unit: req/s)
old 23554.0 23542.0 23557.0 23526.2
new 24793.7 24809.9 24792.7 24794.4
This gives 5.3% performance improvement
Summary of changes:
sys/kern/uipc_socket.c | 4 ++++
sys/kern/uipc_syscalls.c | 23 +++++++++++++++++++++++
2 files changed, 27 insertions(+), 0 deletions(-)
http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/5e4b399478dd637a5a3939ddd2ebb4c5cffd3138
--
DragonFly BSD source repository
More information about the Commits
mailing list