Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[jetty-dev] NIO inefficiency?

Hi,

While profiling a high-traffic server, I have noticed the following hotspot and wanted to get your analysis:

5.2%  - sun.nio.ch.NativeThread.current
  3.2%  - sun.nio.ch.SocketChannelImpl.write
    3.2%  - org.eclipse.jetty.io.AbstractEndPoint.write
    2.4%  - org.eclipse.jetty.server.HttpConnection$CommitCallback.process
      2.4%  - org.eclipse.jetty.util.IteratingCallback.iterate
      2.4%  - org.eclipse.jetty.server.HttpConnection.send
      2.4%  - org.eclipse.jetty.server.HttpChannel.sendResponse
      2.4%  - org.eclipse.jetty.server.HttpChannel.write
        1.5%  - org.eclipse.jetty.server.HttpOutput.flush
          1.3%  - java.util.zip.DeflaterOutputStream.flush
            ...
        0.9%  - org.eclipse.jetty.server.HttpOutput.close
          ...
    0.8%  - org.eclipse.jetty.server.HttpConnection$ContentCallback.process
      ...
  2.0%  - sun.nio.ch.SocketChannelImpl.read
    ...


So basically the read/write/flush operations seem to be burning a whole lot of time in NativeThread.current (= pthread_self on Linux), which doesn't seem reasonable. Do you have any thoughts on why this is the case and if there are alternative approaches to reduce / avoid this?  (e.g. combining the last flush and close?)

Regards,
  Viktor


Back to the top