[Spread-users] producer/consumer queue via spread.
John Lane Schultz
jschultz at spreadconcepts.com
Tue Mar 20 18:21:41 EDT 2007
What I believe is happening is that your producer is producing messages faster
than your consumer can take them from Spread. This causes the consumer's
message buffer within Spread to grow. When it gets too big (~1000 msgs), Spread
disconnects your consumer rather than run out of memory and crash.
If you are going to be producing messages fast, then you need a flow control
mechanism to ensure you don't overflow your receiver and have Spread kick the
receiver.
The simplest flow control mechanism would be to wait a period of time (e.g. -
1-10ms) between sending each message. If your receiver does little work per msg
receipt and is not loaded, then it probably will be able to keep up.
For a simple message based flow control mechanism you can examine the
spflooder.c program. For a true flow control mechanism, you need your consumer
to send some form of ACKs back to the producer and block the producer from
sending if the consumer falls "too far" (i.e. - approaching 1000 msgs) behind.
Cheers!
Allan Bailey wrote:
> John Lane Schultz <jschultz at spreadconcepts.com> wrote:
>> That solution only works if no one else is sending to the group and you have
>> group membership turned off.
>>
>> If you really want just a producer, with no reads, then the most simple and
>> efficient route is to simply not SP_join to the group.
>
> Yes, this works for the producer, but now the consumer also dies after a bit.
>
> I've tried having the consumer also send messages, but it still dies.
>
> thanks,
> Allan
>
--
John Schultz
Spread Concepts LLC
Phn: 443 838 2200
Fax: 301 560 8875
More information about the Spread-users
mailing list