I'm investigating converting some code using HttpClient to use the MultiThreadedHttpConnectionManager, which will allow some cached connections to be able to skip the SSL handshake. I was wondering if there are any disadvantages of this approach.
If the URL I'm connecting to is a load balancer, I would think that means that the connection that gets set up goes directly to a target node, and not to the load balancer. I would think a load balancer either uses a "round-robin" or "load measurement" strategy, or some combination of both. If it primarily measures load to determine where to bind a connection, then doesn't the presence of cached connections make it more difficult for this kind of load balancer to balance load effectively? I noticed that HttpClient has some notion of expiring "idle" connections, with the "closeIdleConnections()" on MultiThreadedHttpConnectionManager. I'm not sure what this does, however. From the wording of the javadoc, it makes it sound like it performs the action when the method is called (closing idle connections), as opposed to simply automatically closing all connections that have been idle that long (which seems much more logical). Which interpretation is correct? I'm not sure whether closing idle connections will mitigate the concern I have about load balancing, but it might help. I read the "performance guide", but I didn't see these issues addressed. --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
