View Single Post
  #1 (permalink)  
Old 04-23-2008
kalaxy kalaxy is offline
Registered User
 
Name: Kalon Mills
Organization: Omniture, Inc.
Project: Distributed/Parallel processing.
 
Join Date: Dec 2007
Posts: 8
Connection Reuse Management

First a bit of history. I have an ice client that is sending data via multiple threads to a set of ice servers through a hardware load balancer. The key point is "through a hardware load balancer." Thus the stringified proxy is exactly the same for each thread and the proxies are created in the same manner. From what I can tell this qualifies the proxies to reuse the same connection. However I would like the balancer to be able to do its job. Thus if each thread had its own connection, the load balancer could distribute them to different hosts. Also I would like it if these connections were closed every now and again such that when a new connection is opened the load balancer could again do its magic.

So the problem has two parts. One, how do I get a different connection for each thread? And two, how do I actively close/restart these connections over time?

It would be nice if there were a configuration property that said use a different connection per client thread thus dealing with problem part one, but I couldn't find one. Does such a property exist? Also it would be nice it Active Connection Management could be told to gracefully close connections after a certain time even if they are not idle thus dealing with problem part 2, but I couldn't not find such a configuration. Does one exist?

Assuming the above are not options, I realize I can use connection ids. To solve problem part one I can base the connection id on the thread id, thus each thread will be guaranteed its own set of connections. To solve problem part two I can base the connection id on an interval in time, thus as I create proxies over time each proxy created in a new time interval will create a new connection.

So let me restate this to make sure I am being clear. Each thread has a loop. In the loop a proxy is created with the connection id being "<THREAD_ID><MINUTE_X>". Thus for every thread and for every minute a new connection id is created. ACM will then follow behind and clean up connections for connection groups that are no longer used, i.e., a thread has ended or an new minute has begun. I assume this will work only if ACM or something also cleans up structures/memory that are used by the connection id group that no longer has any active connections. Is this the case?

If this is not the case then I need another solution. Since my threads last the duration of the program then I could still use a connection id of "<THREAD_ID>" and just explicitly close the connection every time interval. Is this a better solution anyway?

Do you have any other suggestions?

Thanks for your time in helping me to understand this.
Kalon
Reply With Quote