multithread socketWrite0 performance
807580Sep 16 2009 — edited Sep 16 2009Hi,
Is there a known issue related to the scaling of socketWrite in a multi-socket multi-thread environment?
We are having an application which makes n separate connections to a database server and use them to insert huge amount of data using the jdbc interface.
We are analyzing the performance of the operation if more threads are introduced and data divided among these operations. We are on an 8 core box. Though we have enough resources, the scaling is not seen as we introduce more threads beyond a point.
Profiling shows the bottleneck around socketWrite0(FileDescriptor fd, byte[] b, int off, int len) operation on SocketOutputStream. This particular function is not scaling with more number of threads and less data per thread.
In fact we are seeing some negative scaling too.
I am guessing something in the native implementation of the function is playing a role in this when more sockets co-exist and lot of writing is done on these sockets. Any suggestions on an alternate approach or any tuning which can be done at the socket level to improve the performance?
Thanks,
Kiran