I am using Restlet to implement a web service. From the PHP Client making many consecutive calls to the server, but after a small number of calls complete successfully, further calls hang the server, which shows the message:
INFO: Worker service state: Full
Jun 22, 2015 2:38:31 PM org.restlet.engine.http.connector.BaseHelper$1 rejectedExecution
INFO: Worker service tasks: 0 queued, 10 active, 16 completed, 26 scheduled.
Jun 22, 2015 2:38:31 PM org.restlet.engine.http.connector.BaseHelper$1 rejectedExecution
INFO: Worker service thread pool: 1 core size, 10 largest size, 10 maximum size, 10 current size
Jun 22, 2015 2:38:31 PM org.restlet.engine.http.connector.Controller run
INFO: Stop accepting new connections and transactions. Consider increasing the maximum number of threads.
Please find below the restlet server component code base:
final Component serverComponent = new Component();
serverComponent.getServers().add(Protocol.HTTP, 8182);
final Series<Parameter> parameters = serverComponent.getContext().getParameters();
parameters.add("maxThreads", "150");
parameters.add("minThreads", "10");
parameters.add("lowThreads", "145");
parameters.add("maxQueued", "20");
parameters.add("maxTotalConnections", "10000");
serverComponent.getDefaultHost().attach("/v1", new Appv1());
try {
serverComponent.start();
} catch (final Exception e) {
LOGGERS.error("Exception while starting the application: " + e.getMessage());
}
Can anybody know what changes I have missed in the setup ?
I suggest you to use the jetty extension of the framework, instead of the internal connector. If you want to do so, just add the org.restlet.ext.jetty.jar and org.eclipse.jetty.jar to your classpath.