Go Back   ZeroC Forums > Help Center

Reply
 
LinkBack Thread Tools Rate Thread Display Modes
  #1 (permalink)  
Old 03-13-2008
netfish netfish is offline
Registered User
 
Name: smith jason
Organization: nyapc.com
Project: apc 1.0 which use Ice to publishing messages!
 
Join Date: Jun 2006
Location: beijing china
Posts: 10
Send a message via MSN to netfish
-->
Glacier2 will block all session with callback,when a session hung.

Glacier2's session blocking problem.

Hardware: cpu p4,memory 512M
Software: Windows 2000,Ice3.2.1,ANT
I have create a project which is based on ice3.2.1/demoj/Glacier2/CallBack example,to make sure Icestorm can work with Glacier.In my test project,in order to pass firewall's NAT, icestorm publishs messages to subscriber with a callback proxy object ,which is provided by subscriber before.This is the same as Glacier2/CallBack example.Below is my project diagram .

Subscribers----Clacier2----IceStorm----Publisher

My problem is : Glacier2 can send all messages to a lot of subscribers successfully and quickly,But if a subscriber hungs,Glacier2 sends messages to other subscribers more and more slowly,and finally,Clacier2 will not sending any messages.
Does Glacier2 has solution to send messages to other subscribers,even when some subscribers hung or blocked?

To Test my problem:

1)In a separate window:

$ glacier2router --Ice.Config=config.glacier2


2) Start the IceStorm service:

$ icebox --Ice.Config=config.icebox


3) In a separate window,starting two subscriber

$ ant run-Subscriber
$ ant run-Subscriber

4) In another window

$ ant run-Publisher

5)In another window, starting a subscriber that will hung.
$ ant run-BlockSubscriber


I enclose all my codes and config below.

================================================== ============================
// Clock.ice
================================================== ===========================
#ifndef CLOCK_ICE
#define CLOCK_ICE

module Demo
{

struct Structure
{
int index;
string name;

};


interface Clock
{
void tick(string time);
void tick2(Structure ct);
};

};

#endif



================================================== ============================
// config.glacier2
================================================== ===========================
Glacier2.InstanceName=DemoGlacier2
Ice.ThreadPerConnection.StackSize=262144
Glacier2.Client.Endpoints=tcp -p 10005

Glacier2.Server.Endpoints=tcp
Glacier2.PermissionsVerifier=DemoGlacier2/NullPermissionsVerifier

Glacier2.Client.Buffered=0
Glacier2.Server.Buffered=0

Glacier2.Client.ForwardContext=1
Glacier2.Server.ForwardContext=1

Glacier2.Client.SleepTime=500
Glacier2.Server.SleepTime=500

Glacier2.Client.AlwaysBatch=0
Glacier2.Server.AlwaysBatch=0

Glacier2.Client.Trace.Request=1
Glacier2.Server.Trace.Request=1
#Glacier2.Client.Trace.Override=1
#Glacier2.Server.Trace.Override=1
Glacier2.Client.Trace.Reject=1
Glacier2.Trace.Session=1
Glacier2.Trace.RoutingTable=1

Ice.Warn.Connections=1

Ice.Trace.Protocol=1
================================================== ============================
// config.sub.glacier2
================================================== ===========================
Ice.Default.Router=DemoGlacier2/router:tcp -p 10005 -h 127.0.0.1

Clock.Subscriber.Router=DemoGlacier2/router:tcp -p 10005 -h 127.0.0.1

Clock.Subscriber.Endpoints=tcp


Ice.ACM.Client=0
Ice.ACM.Server=0

Ice.MonitorConnections=60


Ice.RetryIntervals=-1


Ice.Warn.Connections=1
IceStorm.TopicManager.Proxy=DemoIceStorm/TopicManager:default -p 10000
IceStorm.Trace.Subscriber=2
================================================== ===========================
// config.icebox
================================================== ===========================
IceBox.ServiceManager.Endpoints=tcp -p 9998

IceBox.Service.IceStorm=IceStormService,32:createI ceStorm --Ice.Config=config.service

Ice.Trace.Network=3
Ice.Trace.Protocol=1

#IceStorm.SubscriberPool.Size=10
#IceStorm.SubscriberPool.SizeMax=100
#IceStorm.SubscriberPool.SizeWarn=50
#IceStorm.SubscriberPool.Timeout=5
Attached Files
File Type: txt BlockSubscriber.java.txt (3.7 KB, 37 views)
File Type: txt Subscriber.java.txt (3.3 KB, 31 views)
File Type: txt Clock.ice.txt (205 Bytes, 35 views)
File Type: txt Publisher.java.txt (2.7 KB, 39 views)
File Type: txt build.xml.txt (2.3 KB, 32 views)
Reply With Quote
  #2 (permalink)  
Old 03-14-2008
benoit's Avatar
benoit benoit is offline
ZeroC Staff
 
Name: Benoit Foucher
Organization: ZeroC, Inc.
Project: Ice
 
Join Date: Feb 2003
Location: Rennes, France
Posts: 1,542
Hi,

By just looking at the Glacier2 configuration, it's very likely that the problem is caused by using the non-buffered mode. In the Glacier2 configuration file you should try setting the Glacier2.Client.Buffered and Glacier2.Server.Buffered properties to 1. See here in the Ice manual for more information on Glacier buffered mode.

Cheers,
Benoit.
Reply With Quote
  #3 (permalink)  
Old 03-14-2008
netfish netfish is offline
Registered User
 
Name: smith jason
Organization: nyapc.com
Project: apc 1.0 which use Ice to publishing messages!
 
Join Date: Jun 2006
Location: beijing china
Posts: 10
Send a message via MSN to netfish
-->
If I use Glacier2's Buffered and Batch configuration as below, i find Subscriber can get messages but very slow,and will lost message.Because
i want to send and receive message quickly, Do you have other solution while not use batch or buffer model?


Glacier2.Client.Buffered=1
Glacier2.Server.Buffered=1
Glacier2.Client.AlwaysBatch=1
Glacier2.Server.AlwaysBatch=1
Reply With Quote
  #4 (permalink)  
Old 03-14-2008
netfish netfish is offline
Registered User
 
Name: smith jason
Organization: nyapc.com
Project: apc 1.0 which use Ice to publishing messages!
 
Join Date: Jun 2006
Location: beijing china
Posts: 10
Send a message via MSN to netfish
-->
In my project, publisher call subscriber's callback object frequently. I find
all subscribers which do not hung will get messages promptly at first and then more and more slow if i hung a subscriber, Does os's socket buffer affect Glacier2? or Does Glacier has some special way for frequently callback invoke?
Reply With Quote
  #5 (permalink)  
Old 03-14-2008
benoit's Avatar
benoit benoit is offline
ZeroC Staff
 
Name: Benoit Foucher
Organization: ZeroC, Inc.
Project: Ice
 
Join Date: Feb 2003
Location: Rennes, France
Posts: 1,542
Hi,

Unless you use UDP, messages shouldn't be dropped when using buffered mode. It's also not clear to me why it would be slower when using the buffered mode. How many clients are connected to Glacier2 and how many messages are forwarded through Glacier2?

In unbuffered mode, a client can affect the message delivery of other clients for several reasons:
  • Glacier2 is forwarding a twoway invocation and the client doesn't send the response in a timely manner.
  • The socket TCP/IP send buffer of the client connection is full (see also this FAQ)
You should definitely use the buffered mode if you don't want a client to affect the message delivery of other clients.

Note that this won't be the case anymore with Ice 3.3.0. With Glacier2 from Ice 3.3.0, the unbuffered or buffered mode will offer the same guarantees in this respect, that is, a slow client or misbehaving client won't affect the delivery of messages to other clients. The buffered mode will still be useful to allow the batching of oneway messages (which can improve throughput: it's more efficient to send a batch of N oneway messages than N oneway messages separately).

Cheers,
Benoit.
Reply With Quote
  #6 (permalink)  
Old 03-14-2008
netfish netfish is offline
Registered User
 
Name: smith jason
Organization: nyapc.com
Project: apc 1.0 which use Ice to publishing messages!
 
Join Date: Jun 2006
Location: beijing china
Posts: 10
Send a message via MSN to netfish
-->
Thanks Benoit! You are right!
In my project ,the reason why it would be slower is i set batch config as below. Moreover, my publisher publishs messages very very frequently,just for testing.
Glacier2.Client.Buffered=1
Glacier2.Server.Buffered=1
Glacier2.Client.AlwaysBatch=1
Glacier2.Server.AlwaysBatch=1


if i turn off batch config ,and doesnot publish so frequently,then Glacier2 can send message quickly.

thanks again.
Reply With Quote
  #7 (permalink)  
Old 03-14-2008
netfish netfish is offline
Registered User
 
Name: smith jason
Organization: nyapc.com
Project: apc 1.0 which use Ice to publishing messages!
 
Join Date: Jun 2006
Location: beijing china
Posts: 10
Send a message via MSN to netfish
-->
Thanks !
this problem has been solved!
__________________
jason.smith
Topsec network security technology
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
Glacier2 Session Timeout andreynech Help Center 4 01-14-2008 10:21 AM
What happens to the session when Glacier2 dies? apetrov Help Center 2 10-26-2007 06:35 PM
Glacier2 Per Session Context paolo Help Center 6 09-20-2007 10:17 AM
Session Management with Glacier2 question 123w456t Help Center 1 03-29-2006 06:46 PM
Glacier2 session expiration Nis Baggesen Help Center 10 03-21-2006 08:05 AM


All times are GMT -4. The time now is 11:06 AM.


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.