Go Back   ZeroC Forums > Comments

Reply
 
LinkBack Thread Tools Rate Thread Display Modes
  #1 (permalink)  
Old 05-18-2006
joe joe is offline
Registered User
 
 
Join Date: Aug 2005
Location: Hamilton, NZ
Posts: 16
Minor IceStorm enhancements

Hi ZeroC,

1. Are there any design or performance issues for IceStorm supporting only one level of topic linking? I can't see any and would like to be able to use n-level linking to support geographical IceStorm "distributors" without the need to unmarshall/remarshall the event in some propagating stub code.

From a (quick) review of LinkSubscriber.cpp I would change line 83 from :
Code:
    if(event->forwarded || (_cost > 0 && event->cost > _cost))
to
Code:
    if(_cost > 0 && event->cost > _cost)
I'd need to be aware of potential for cyclic subscriptions, etc

2. Do you think a pool of publisher threads would perform any faster than a serial loop iteration when dealing with slow subscribers. ie, assign n threads to dispatch on every (iterator+n) subscribers. The case I'm thinking of is serving to a public internet audience, 10-20% of whom may still be on 56K distributed anywhere on the globe, downloading MP3s at the same time. In the case of large or high-volume messages, wouldn't these subscribers penalise the rest if the publish is done in serial?.. I'm no networking expert, so the real cost may be negligible...

TopicI.cpp line 228
Code:
    for(SubscriberList::iterator p = copy.begin(); p != copy.end(); ++p)
    {
	(*p)->publish(event);
    }
If you think this is a reasonable improvement, I'm happy to take a stab at the code changes, maybe also including COW for Event or coverting Event references to EventPtr references to save data copying also... (your notes in Event.h).

Thanks.
__________________
Researching ICE
Independent Developer
No project yet
Reply With Quote
  #2 (permalink)  
Old 05-21-2006
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,055
I'm not sure why you want to support N-level linking directly in your application. The idea of the existing topic linking is support this through an external application. You describe the topic graph and the cost between each segment, and a maximum cost. The application then computes the connectivity, and links everything up directly with the appropriate cost.

For example, if you have three nodes A, B, C. A links to B with a cost of 5, and B links to C with a cost of 3. The tool will create interconnections of A to B with a cost of 5, and a link from A->C with a cost of 8, and a link from B to C with a cost of 3.

This means that IceStorm itself doesn't have to deal with cycles, and keep track of the cost as the event moves through the system.

The only disadvantage with this model that I'm aware of is that it assumes that all nodes are reachable from all other nodes.

With respect to event delivery:

If you have very slow & very fast subscribers on the same icestorm instance, then with the current implementation I think you can see the effect you are describing. You can make all of them fully independent by having a thread-per-subscriber model, however, this has a high cost in the number of threads. If you use a thread pool model then you'll run into problems in determining how big to make the pool... too small and then they'll all be potentially consumed by slow subscribers again.

If you are generating large amounts of traffic & have slow subscribers that cannot keep up eventually you'll start to consume large amounts of memory. With this type of model you'll likely want to start limiting the size of the queue -- which means some sort of discard policy. This starts to get quite complex

Note that you can simulate slow links using some of the linux networking tools (see the "tc" command for details).
Reply With Quote
  #3 (permalink)  
Old 05-21-2006
joe joe is offline
Registered User
 
 
Join Date: Aug 2005
Location: Hamilton, NZ
Posts: 16
Thanks Matthew

Quote:
Originally Posted by matthew
I'm not sure why you want to support N-level linking directly in your application.
Essentially to support chains of pub/sub. Eg, stock quotes are generated centrally and pushed to hundreds/thousands of users distributed globally. The load on a central distributor may be impractical, and rather than have several central distributors, I'd like to have several decentralised distributors for each key geography (eg, North America, Asia, Europe, Pacific). I'm not concerned at all with link or message cost since each message must be delivered. Is there a good reason to only allow one level of linking, or would it be an improvement to make this configurable?

Quote:
Originally Posted by matthew
If you use a thread pool model then you'll run into problems in determining how big to make the pool... too small and then they'll all be potentially consumed by slow subscribers again.
I'm not sure this is a problem per se, any more than sizing client or server thread pools is. Plus however small the pool, it would would be an improvement over a size of 1 currently. A crude way of supporting this out of the box might be to have a "session" object consume the messages on the server end (thread pooled) which then makes a client call to distribute :-
(a) IceStorm publish ---> (b) Session subscribe --> (c) Client invoke

I'd want to do some genuine before/after throughput tests to be sure that the average case on the client side had improved, but if (a) and (b) were co-located then the added latency cost might be trivial but you'd achieve basic parallelism...

Quote:
If you are generating large amounts of traffic & have slow subscribers that cannot keep up eventually you'll start to consume large amounts of memory. With this type of model you'll likely want to start limiting the size of the queue -- which means some sort of discard policy. This starts to get quite complex
The only other option I'd consider (if it became a true bottleneck) would be to implement a heartbeat to determine client response times and redistribute load for problem clients to a dedicated "slow subscriber" IceStorm instance. All other instances would have higher QoS (fast delivery, no lost messages) whereas the slow box would drop messages as needed, with no delivery timeliness, etc. With a session facade on the client side this would be relatively transparent...
__________________
Researching ICE
Independent Developer
No project yet
Reply With Quote
  #4 (permalink)  
Old 05-21-2006
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,055
If the link level is more than 1 then it becomes more complex to manage internally the events. That's the key difference.

Quote:
I'm not sure this is a problem per se, any more than sizing client or server thread pools is. Plus however small the pool, it would would be an improvement over a size of 1 currently. A crude way of supporting this out of the box might be to have a "session" object consume the messages on the server end (thread pooled) which then makes a client call to distribute :-
(a) IceStorm publish ---> (b) Session subscribe --> (c) Client invoke
...
This is a typical solution to your problem. If you require each of your clients to have a session, then this session is typically collocated on the same machine as the Glacier2 server, and hence inside the internal network. You would want to be careful to ensure that your sessions share connections otherwise the connection concentrator advantage that Glacier2 provides would be lost

You then push from the IceStorm server to the session server, and then send this to the client. This ensures that all internal communications are fast, and mis-behaving clients to not cause the IceStorm service to hang-up. I think this will scale much better, and will be much more fault tolerant and performant than doing all of this inside the IceStorm service itself.

You have to be careful not to block the thread that consumes the events that arrives in the session from IceStorm -- since that will then eventually block up other sessions also.
Reply With Quote
  #5 (permalink)  
Old 05-22-2006
joe joe is offline
Registered User
 
 
Join Date: Aug 2005
Location: Hamilton, NZ
Posts: 16
Cheers Matthew

I'll be using Session objects in any case and it sounds like there's a good argument for using them as IceStorm consumers/distributors as well.

Joe
__________________
Researching ICE
Independent Developer
No project yet
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
Minor typos in Ice 3.0.1 manual bartley Comments 0 02-14-2006 03:46 PM
A (very) minor gift as a thank you! SteveWampler Patches 2 01-21-2004 09:52 AM
Minor problem with Ice 1.2.0 on Win 2000 weida Bug Reports 1 10-29-2003 11:00 AM
Minor i386 fixes rodrigc Patches 3 03-07-2003 04:50 PM
Minor Documentation Corrections Ken Carpenter Comments 3 03-03-2003 10:12 PM


All times are GMT -4. The time now is 08:30 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.