Hi Vishal,

If you're talking standard client side HTTP, MINA might not be the best tool for the job. For example, see http://jakarta.apache.org/httpcomponents/httpclient-3.x/

One of the features you might be interested in:
* Connection management support for use in multi-threaded applications. Supports setting the maximum total connections as well as the maximum connections per host. Detects and closes stale connections.

Trustin mentioned that connection pools are useful when the cost of connection is relatively high (eg, SSL handshake). Another time they are useful is when you want to limit the number of connections to the server from a multi threaded client. This is often to conserve resources/limit load on the server.

Cheers,
Brad.

Vishal_Jain wrote:
Thanks Trustin !

The server i have at my disposal is within the LAN (same subnet) and the
connection time i have noticed is about 50ms.
My dilemma is to whether accept 50ms as acceptable/reasonable or try
something to further reduce this.
Purpose is to connect to a HTTP server (tomcat actually) and send/receive
requests (socket would close after every transaction); my aim is to keep the
system decently scalable with heavy loads (am not sure about how heavy it
could get yet).

- vishal


Trustin Lee wrote:
On 11/6/07, Vishal_Jain <[EMAIL PROTECTED]> wrote:
Thats right.
I was wondering if someone in this forum has implemented a connection
pool
(not necessarily around Mina) and perhaps share with rest of newbies like
me
? :)
Another doubt i have is regarding keeping a pool of 'connected' sockets.
How
useful is it to pull up a already connected socket and do a message
exchange
compared to creating and connecting a socket as and when required ?
I think it depends on the cost of making a connection.  It's often
very small and once connected, there's no problem with your bandwidth.
 If disconnection is unlikely, you could simply reconnect even if the
connection cost is somewhat high.

HTH,
Trustin
--
what we call human nature is actually human habit
--
http://gleamynode.net/
--
PGP Key ID: 0x0255ECA6



Reply via email to