Go Back   ZeroC Forums > Help Center

Reply
 
LinkBack Thread Tools Rate Thread Display Modes
  #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
  #2 (permalink)  
Old 04-23-2008
matthew's Avatar
matthew matthew is offline
ZeroC Staff
 
Name: Matthew Newhook
Organization: ZeroC, Inc.
Project: Internet Communications Engine
 
Join Date: Feb 2003
Location: NL, Canada
Posts: 1,052
I think you have a good understanding of the problem. I think what I'd do in this case is assign a unique connection id to the proxy associated with each thread, and then have a timer that explicitly closes the connection at regular intervals. This is simpler because you then don't need the sending thread to re-sync the proxy it is using when the connection id changes.

Since you would be explicitly closing the connections using the timer, there is no need for ACM to do anything.
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Reuse sockets? hotlips Help Center 1 09-05-2007 07:42 AM
Session Management with Glacier2 question 123w456t Help Center 1 03-29-2006 06:46 PM
A question about Connection Reuse in Ice rc_hz Help Center 5 06-01-2005 08:31 AM
A question about Connection Management rc_hz Help Center 9 05-31-2005 11:57 PM
Does IceUtil provide Memory Management functions? JaneShang Help Center 1 05-08-2005 11:29 PM


All times are GMT -4. The time now is 01:03 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.0.0
(c) 2008 ZeroC, Inc.