Hi Sebastian, We still have a couple of bugs to fix on this new internal connector. If you need something more stable for now, you can drop in the Jetty or Simple extensions.
Any help fixing/tuning this new async NIO connector is welcome as well (not for the faint of heart)! Best regards, Jerome -- http://www.restlet.org http://twitter.com/#!/jlouvel -----Message d'origine----- De : Sebastian Krause [mailto:[email protected]] Envoyé : jeudi 26 janvier 2012 11:35 À : [email protected] Objet : ApacheBench hangs with the Restlet 2.1 connector Hi, For quite some time I've had the problem that whenever I try to benchmark the server's performance with ApacheBench with the new, internal connector of Restlet 2.1 (currently testing with 2.1-RC2) I get a timeout. Here is a minimal program I used for testing: import org.restlet.Component; import org.restlet.data.MediaType; import org.restlet.data.Protocol; import org.restlet.representation.Representation; import org.restlet.representation.StringRepresentation; import org.restlet.resource.Get; import org.restlet.resource.ServerResource; public class Main { public static void main(String... args) throws Exception { Component comp = new Component(); comp.getServers().add(Protocol.HTTP, 8182); comp.getDefaultHost().attach("/test", TestResource.class); comp.start(); } public static class TestResource extends ServerResource { @Get public Representation getText() { return new StringRepresentation("test\n", MediaType.TEXT_PLAIN); } } } Calling "curl http://192.168.100.97:8182/test" gives me the expected result, but "ab -n 1 http://192.168.100.97:8182/test" freezes for some time and finally gives up with the following error message: Benchmarking 192.168.100.97 (be patient)...apr_poll: The timeout specified has expired (70007) However, the request does show up in Restlet's log: 2012-01-26 11:25:15 192.168.100.170 - - 8182 GET /test - 200 5 0 1 http://192.168.100.97:8182 curl/7.21.0 (x86_64-pc-linux-gnu) libcurl/7.21.0 OpenSSL/0.9.8o zlib/1.2.3.4 libidn/1.15 libssh2/1.2.6 - 2012-01-26 11:25:20 192.168.100.170 - - 8182 GET /test - 200 5 0 2 http://192.168.100.97:8182 ApacheBench/2.3 - I'm using Windows 7 x64. When I suspend the program during the freeze in Eclipse, it shows the following stack trace of Restlet's thread: Thread [Restlet-2004273875] (Suspended) WindowsSelectorImpl$SubSelector.poll0(long, int, int[], int[], int[], long) line: not available [native method] WindowsSelectorImpl$SubSelector.poll() line: not available WindowsSelectorImpl$SubSelector.access$400(WindowsSelectorImpl$SubSelector) line: not available WindowsSelectorImpl.doSelect(long) line: not available WindowsSelectorImpl(SelectorImpl).lockAndDoSelect(long) line: not available WindowsSelectorImpl(SelectorImpl).select(long) line: not available ServerConnectionController(ConnectionController).selectKeys(long) line: 259 ServerConnectionController(ConnectionController).doRun(long) line: 150 ServerConnectionController(Controller).run() line: 155 Executors$RunnableAdapter<T>.call() line: not available FutureTask$Sync.innerRun() line: not available FutureTask<V>.run() line: not available ThreadPoolExecutor$Worker.runTask(Runnable) line: not available ThreadPoolExecutor$Worker.run() line: not available Thread.run() line: not available Sebastian ------------------------------------------------------ http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=29250 22 ------------------------------------------------------ http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2925113

