This forum is now a read-only archive. All commenting, posting, registration services have been turned off. Those needing community support and/or wanting to ask questions should refer to the Tag/Forum map, and to http://spring.io/questions for a curated list of stackoverflow tags that Pivotal engineers, and the community, monitor.

Http-invoker performance?

Nov 24th, 2004, 07:42 PM

I ran the http-invoker based jpetstore sample. Interestingly, I got reasonably fast response times for up to 3 repetitions of the service request (400 ms or so). Beyond 4 repetitions, though, the performance got worse and worse, and it sort of stabilized at about 2 seconds/request, for, say, a loop of 20 requests.

What is causing this significant performance degradation? The requests are sent sequentially in a loop, so there is always only request dealt with at a time.

Comment

One note: The problematic performance can only be observed when NOT using "localhost" for the server address in client.properties, but a regular IP address (even though the client and the server are on the same machine). For "localhost", the performance is relatively consistent whether I have 1 or 20 iterations.

What I am puzzled with is not the ABSOLUTE performance (with network overhead, performance degradation is to be expected), but rather the sudden drop from 1-3 repetitions (very good performance) to 20 repetitions (very poor performance, 10-15x times worse).

msauer, could you re-run your test not using localhost, but an IP address?

Could it be the network?

Thanks in advance,

-- JK

Comment

What could be happening is that for some reason a new connection to the server is being created for each invocation rather than a keep alive being reused... but the old keep alive connections still exist and are still connected resulting in your server being overloaded with open connections that do nothing. Or it could be that the http client has some kind of limit on the number of concurrent connections it will make to a single server and it's waiting for an old connection to close before it will initiate a new connection....

Have you tried doing your test using both the JDK (SimpleHttpInvokerRequestExecutor) and HttpClient (CommonsHttpInvokerRequestExecutor) executors?

Comment

Looks like it has something to do with my Network Address Translation setup.
I ran the test on the private network (192.168.*) and did NOT see the degradation. The problem happens only when I try to use the external IP address. So I assume it is some kind of a NAT problem.