Hi,
I've put together a banal client/server application where the client
connects to the server via TCP and maintains the connection for
multiple requests.
The latency for a single request is around 400ms +/- 2ms, even if both
client and server are running on the same host, and the binding
address is 127.0.0.1. I have tried running the server and client on a
variety of OpenBSD boxes (4.3) ranging from 4 core Xeons to 7 year-old
PCs. The latency is the same on all of them, and the latency does
not vary significantly if the client and server are on different
OpenBSD hosts.
If I use unix domain sockets, the latency is reduced to under 1 ms,
and if I run the same client and server (recompiled) on my mac, the
latency is also significantly less. Furthermore, if I run the client
on the mac and the server on an openbsd box, the latency is around
200ms per request, i.e., half of when both client and server are
running on the same OpenBSD box.
I have TCP_NODELAY enabled, so this is unlikely to be the problem. pf
is not running out of states, and the machines are all lightly
loaded. So, I am not sure where to look next, particularly since this
seems to be endemic to OpenBSD (I do not have a Linux server handy to
test it on there).
Any suggestions where to look next would be appreciated.
ttyl
Alex
------------------------------------------------------------------------------
To put it bluntly, we simply do not know yet what we should be talking
about,
but that should not worry us, for it just illustrates what was meant by
"intangible goods and uncertain rewards".
-- Edsger Dijkstra, 'The End of Computer
Science'