Carsten
Carsten

Reputation: 4334

Apache HTTPClient doesn't allow more than 1500 reusable connections

I'm using Apache HTTPClient (4.2.2) / Java7 to open many reusable connections to a tomcat 7 server (to simulate many users repeatedly hitting the service). Both client and server on Ubuntu 12 (but different machines). I made sure that systctl.conf and limits.conf allow this scenario.

This works well up to about 1500 simulated users / connections. The connections get reused as expected. Somewhere between 1500 and 1600 simulated users however, connections are no longer reused and closed/ re-opend all the time. Why might this be the case?

I don't think the problem is on the server side as when I start multiple simulation clients on different machines against the same server, the server has no problems reusing the connections as long as each client doesn't go beyond 1500 connections.

Upvotes: 1

Views: 228

Answers (2)

iddqd
iddqd

Reputation: 1389

You might need to increase the number of available workers,at least check if there are workers free when you run out of connections by going to server-status

Upvotes: 0

ok2c
ok2c

Reputation: 27593

There can be various reasons as to why connections are not longer being re-used depending on the configuration of the connection manager OR server side configuration. The easiest way to find out the reason is to run HttpClient with context logging on as described in the 'context logging for connection management / request execution' example in the Logging Guide

Upvotes: 1

Related Questions