On Sun, 2012-12-16 at 13:03 +0200, Nir Dweck wrote: > Hi, > I am new to HTTP Components. I wrote a short server which is based on the > Asynchronous HTTP Server example. I am using httpcore-4.2.2 and > httpcore-nio-4.2.2. I wrote a short test program that loads my server. I > see that after ~500,000 requests I get a socket leak of ~600 sockets. I got > 84 SocketTimeoutException during the test. After I got to a big number of > leak sockets the application stopped responding and I couldn't even connect > to it with remote debugger. > bellow is my test. > Regards, > Nir
Nir Your code does not compile so I cannot test it. I know that HttpCore (both blocking and non-blocking) can easily handle millions of requests. There is an (non-scientific) HTTP micro-benchmark used by the project to test HttpCore's performance [1]. Based on it 1'000'000 request do not seem to pose any sort of issue. Feel free to tweak the micro-benchmark and see how it performs for you Oleg [1] http://svn.apache.org/repos/asf/httpcomponents/benchmark/httpcore/trunk/ --------------------------------------------------------------- HttpCore (blocking I/O); version: 4.2.3 --------------------------------------------------------------- Server Software: HttpCore-Test/1.1 Server Hostname: localhost Server Port: 8989 Document Path: http://localhost:8989/rnd?c=2048 Document Length: 2048 bytes Concurrency Level: 10 Time taken for tests: 9.889423 seconds Complete requests: 1000000 Failed requests: 0 Write errors: 0 Kept alive: 1000000 Total transferred: 2048000000 bytes Requests per second: 101,118.13 [#/sec] (mean) Time per request: 0.099 [ms] (mean) Time per request: 0.010 [ms] (mean, across all concurrent requests) Transfer rate: 207,089.94 [Kbytes/sec] received -1 kb/s sent 207,089.94 kb/s total --------------------------------------------------------------- --------------------------------------------------------------- HttpCore (NIO); version: 4.2.3 --------------------------------------------------------------- Server Software: HttpCore-NIO-Test/1.1 Server Hostname: localhost Server Port: 8989 Document Path: http://localhost:8989/rnd?c=2048 Document Length: 2048 bytes Concurrency Level: 10 Time taken for tests: 20.235072 seconds Complete requests: 1000000 Failed requests: 0 Write errors: 0 Kept alive: 1000000 Total transferred: 2048000000 bytes Requests per second: 49,419.15 [#/sec] (mean) Time per request: 0.202 [ms] (mean) Time per request: 0.020 [ms] (mean, across all concurrent requests) Transfer rate: 101,210.41 [Kbytes/sec] received -1 kb/s sent 101,210.41 kb/s total --------------------------------------------------------------- --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
