[Spread-users] Queries about spread daemon 4 release cadidate.

John Schultz jschultz at spreadconcepts.com
Wed May 31 17:30:25 EDT 2006

Danish Ahmed wrote:

> Hi all
> I have some queries:
> 1 ) I make a receiver that receive message on a group. Also i make a 
> sender that send messages to the receiver in a tight loop. There is no 
> delay between transmission of messages. Receiver receive messages and 
> does not do anything time consuming stuff. Just receive message and 
> then goes to receive another and so on and so forth. Now on receiver 
> side what i saw is that daemon kills the session of client program and 
> print on console like this:
> Sess_write: killing mbox 176 for not reading.
> After a couple of tries i opened the code and see if number of 
> messages in one session message queue is greater than 
> MAX_SESSION_MESSAGES then daemon kills the session. Then i saw value 
> of MAX_SESSION_MESSAGES. It is 1000. Then i changeed this value and 
> set 100000 then it runs fine. So what i want to ask does 1000 message 
> count was fine and my test case is wrong or is there any other method 
> to control this limit?
Spread does not do flow control for its clients.  If the incoming 
message flow is consistently faster than a reader can consume, then 
eventually it will be disconnected no matter how big you make your 
buffers (i.e. 1000 vs. 100000).  With one sender and one receiver you 
can probably make Spread's buffers big enough that you can have one 
sender sending full blast and not disconnect the reader.  Now add 
another sender sending full blast and you are almost surely "toast."

Also realize that increasing this number means that the messages are 
building up in the daemon.  If you do this too much and don't add flow 
control then eventually your daemon will exhaust its memory resources 
and likely crash (the usual result of a memory allocation failing).

The real way to deal with this limit is to implement some form of flow 
control in your clients so that they don't overwhelm one another.  It is 
also appropriate to raise that number by changing the code if you don't 
mind the potentially increased memory foot print of Spread.

> 2 ) I am developing a distributed application in which when an 
> application run on a machine on LAN it should become part of this 
> distributed application system( something like peer to peer ). Also we 
> can say a new system should be included in a plug n play manner. I run 
> all particiapted system in a single segment so they can communicate on 
> spread. Now the problem is that when a new computer want to come in 
> the system and its name is not included in the other daemons 
> configuration already running then it cannot communicate with other 
> systems. One solution is that i make a new file and copy it to on all 
> other computers and run reload config. But the problem is that i want 
> my application self started without help of any human interaction.
> So can anyone suggest me some solution to this problem.( Plug n play 
> system architecture )
> Note i also use TIBCO Randezvous and it does fine as it runs on 
> muticasting and as long as all system are running on a multicast group 
> then plag n play manner is achieved very easily.
You could automate the task of creating a new file, distributing it to the other machines and causing a monitor program to trigger the reload command.

Currently, reloading the configuration file is the only mechanism we have for adding and removing daemons.  You probably could make Spread be able to do dynamic discovery of daemons in a LAN and automatically include them, but that would take some serious tinkering with Spread's code.

John Schultz
Spread Concepts LLC
Phn:  301 498 3233
Cell: 443 838 2200

More information about the Spread-users mailing list