git: tools: Add bench tools for accept(2) and connect(2)
Sepherosa Ziehau
sephe at crater.dragonflybsd.org
Sun Jul 21 23:46:57 PDT 2013
commit 9a1272865c3cb6e079e1554031dcc712a881598b
Author: Sepherosa Ziehau <sephe at dragonflybsd.org>
Date: Mon Jul 22 14:21:08 2013 +0800
tools: Add bench tools for accept(2) and connect(2)
The main reasons behind making these tools instead of using netperf TCP_CC
test are:
- Netperf TCP_CC creates new server for each testing client
- Netperf TCP_CC creates new listen socket on different TCP port for each
testing client
- Netperf TCP_CC created listen socket is in blocking mode
- Netperf TCP_CC closes accepted sockets immediately
All of the above listed items make netperf TCP_CC do not reflect real life
TCP server usage.
Tools in accept_connect:
- "connect_client"
Fork certain amount of processes to perform blocking connect(2)/close(2)
for the certain amount of time.
- "accpet_server"
Fork certain amount of processes to perform blocking accept(2) on the same
addr/port bound socket. close(2) on the accepted socket is called
immediately. If -r is specified, each processes will create their own
listen socket on the same port/addr w/ SO_REUSEPORT sockopt.
- "kq_accept_server"
Fork certain amount of processes to perform non-blocking accept(2) on the
same addr/port bound socket w/ help of kqueue(2). close(2) on the accepted
socket is called after the other side closed the connection. If -r is
specified, each processes will create their own listen socket on the same
port/addr w/ SO_REUSEPORT sockopt.
kq_accept_server closely mimics the real life TCP server.
Summary of changes:
.../accept_connect/accept_server/.gitignore | 1 +
.../netrate/accept_connect/accept_server/Makefile | 10 ++
.../accept_connect/accept_server/accept_server.c | 131 +++++++++++++++
.../accept_connect/connect_client/.gitignore | 1 +
.../netrate/accept_connect/connect_client/Makefile | 10 ++
.../accept_connect/connect_client/connect_client.c | 153 +++++++++++++++++
.../accept_connect/kq_accept_server/.gitignore | 1 +
.../accept_connect/kq_accept_server/Makefile | 10 ++
.../kq_accept_server/kq_accept_server.c | 183 +++++++++++++++++++++
9 files changed, 500 insertions(+)
create mode 100644 tools/tools/netrate/accept_connect/accept_server/.gitignore
create mode 100644 tools/tools/netrate/accept_connect/accept_server/Makefile
create mode 100644 tools/tools/netrate/accept_connect/accept_server/accept_server.c
create mode 100644 tools/tools/netrate/accept_connect/connect_client/.gitignore
create mode 100644 tools/tools/netrate/accept_connect/connect_client/Makefile
create mode 100644 tools/tools/netrate/accept_connect/connect_client/connect_client.c
create mode 100644 tools/tools/netrate/accept_connect/kq_accept_server/.gitignore
create mode 100644 tools/tools/netrate/accept_connect/kq_accept_server/Makefile
create mode 100644 tools/tools/netrate/accept_connect/kq_accept_server/kq_accept_server.c
http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/9a1272865c3cb6e079e1554031dcc712a881598b
--
DragonFly BSD source repository
More information about the Commits
mailing list