Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[jetty-users] Bottleneck while perf testing on Jetty

Hi,

I came across in some performance problems while load testing one of my web services.

This service has an API that gives back JSON documents keyed by their ids. Sometime these JSON documents are really big (~20MB) and takes a while to load them. 

We setup a load test to see what would happen in a situation where *all* the requests are for these large JSON documents and we noticed that the service gets slower and slower.

Looking at a thread dump we saw that 80% of our threads are blocked here:

"qtp-84" prio=5 tid=112044000 nid=0x11b6e2000 in Object.wait() [11b6e0000]
   java.lang.Thread.State: TIMED_WAITING (on object monitor)
        at java.lang.Object.wait(Native Method)
        at org.eclipse.jetty.io.nio.SelectChannelEndPoint.blockWritable(SelectChannelEndPoint.java:436)
        - locked <77c868130> (a org.eclipse.jetty.io.nio.SelectChannelEndPoint)
        at org.eclipse.jetty.http.AbstractGenerator.blockForOutput(AbstractGenerator.java:512)
        at org.eclipse.jetty.server.HttpOutput.write(HttpOutput.java:182)
        at org.eclipse.jetty.server.HttpOutput.write(HttpOutput.java:101)
        at com.sun.jersey.spi.container.servlet.WebComponent$Writer.write(WebComponent.java:305)
        at com.sun.jersey.spi.container.ContainerResponse$CommittingOutputStream.write(ContainerResponse.java:134)
        at org.codehaus.jackson.impl.Utf8Generator._flushBuffer(Utf8Generator.java:1754)
        at org.codehaus.jackson.impl.Utf8Generator.writeNumber(Utf8Generator.java:886)
        at org.codehaus.jackson.node.LongNode.serialize(LongNode.java:81)
        at org.codehaus.jackson.node.ArrayNode.serialize(ArrayNode.java:86)
        at org.codehaus.jackson.node.ObjectNode.serialize(ObjectNode.java:230)
        at org.codehaus.jackson.node.ObjectNode.serialize(ObjectNode.java:230)
        at org.codehaus.jackson.map.ser.std.SerializableWithTypeSerializer.serialize(SerializableWithTypeSerializer.java:38)
        at org.codehaus.jackson.map.ser.std.SerializableWithTypeSerializer.serialize(SerializableWithTypeSerializer.java:25)
        at org.codehaus.jackson.map.ser.std.MapSerializer.serializeFields(MapSerializer.java:262)
        at org.codehaus.jackson.map.ser.std.MapSerializer.serialize(MapSerializer.java:186)
        at org.codehaus.jackson.map.ser.std.MapSerializer.serialize(MapSerializer.java:23)
        at org.codehaus.jackson.map.ser.StdSerializerProvider._serializeValue(StdSerializerProvider.java:610)
        at org.codehaus.jackson.map.ser.StdSerializerProvider.serializeValue(StdSerializerProvider.java:256)
        at org.codehaus.jackson.map.ObjectMapper.writeValue(ObjectMapper.java:1613)
        at org.codehaus.jackson.jaxrs.JacksonJsonProvider.writeTo(JacksonJsonProvider.java:558)
  ...


I think that this test is quite unrealistic but I'm curious about this bottleneck. Does anyone ran into this problems before??

Any insight ??

Thank you and best regards,
Ugo.

Back to the top