The important part is really time to let things run, not so much iterations.
It takes multiple seconds for HotSpot to kick in: typically first 5 or
so seconds of running (or more for complex systems) should be
discarded completely.
Or just dynamically find steady state of throughput, point at which
rate does not vary significantly.
A simple way would be for example to let it run for 5 seconds to warm
up, then measure for next 30 seconds (or whatever).
...
> I have a feeling there might be a bottleneck somewhere related to
> multiple threads. Like I said one thread doing writes, the performance
> was pretty good. The minute I go to 50 threads it just falls apart.
Java threading does not scale particularly well for large number of
active threads (blocked threads are less problematic before thousands
of them). So this could well be causing lower throughput; often you do
not get improved throughput well beyond couple of threads per core (or
maybe even just one thread per core).
-+ Tatu +-
Actually you probably should have upgraded to 1.5.2 to fix some bugs :),
but that's apparently not the problem. A different shot in the dark - the
TCP stack. Start regedit and for all instances of the following keys under
HKEY_LOCAL_MACHINE find/post all their values:
DefaultReceiveWindow
DefaultSendWindow
GlobalMaxTcpWindowSize
TcpWindowSize
SackOpts
Tcp1323Opts
That might give a clue.
Microsoft apps (and others) frequently set custom options or even bypass
the regular Win32 API in favor of internal APIs. I don't know whether the
existing Java client does any of this (which should be easy to add, like
e.g. disabling Nagle or setting the receive/send buffer size), but finding
this out and/or seeing the values in any case cannot hurt. There is a huge
number of knobs that could affect the behaviour that you're seeing, and
normally Java is just as fast on Windows as on Linux (minus thread CPU
affinity but let's take it slow here). I do agree that bdb/IO looks like a
more likely culprit, but the point was to rule out seemimgly unrelated
factors.
I also assume there are no virus scanners enabled. :-)
-h