I had a very strange latency issue pop up today which I have isolated to an
apparent issue with 2.2.1. I can take the "Hello World" stand alone example
from Restlet.com and modify the Resource to be:
package firstSteps;
import org.restlet.resource.Get;
import org.restlet.resource.ServerResource;
public class HelloWorldResource extends ServerResource {
@Get
public String represent() throws InterruptedException
{
System.out.println(Thread.currentThread().getId());
Thread.sleep(10000);
return "hello, world";
}
}
I then take two browsers, Firefox and Chrome, and make a request from each.
Firefox shows Hello World after 10 seconds and Chrome after 20. Looking at the
console I see that both requests were serviced by the same thread. I can the
take my load generator, jMeter, and send a lot of requests in parallel to
Restlet. Restlet processes them one at a time and always with the same thread.
It is as if the default thread pool size is one. When I downgrade to 2.1 and
run the same tests, the issue goes away with a variety of threads servicing the
requests in parallel.
Please advise.
------------------------------------------------------
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=3086285