On Mon, Jun 14, 2010 at 7:34 PM, Tad Glines <[email protected]> wrote:
> As the wavelet gets more content it's initial snapshot will get bigger. At
> some point, the snapshot size will exceed the allocated buffer size in
> SequencedProtoChannel.
> To test the theory, you can increase the amount of text being pushed into
> the blips, or you can add a larger delay between the launching of each
> thread.
> The result should be that even with the change from "8192*4" to "8192*10"
> you'll get the exception.
>
> The same problem will occur if the number of deltas included int an update
> message get to large for the buffer.
>
> In my own project I modified SequencedProtoChannel so that it wraps the
> Channel in a CodedInputStream and lets the proto stuff parse the message
> directly from the channel instead of staging it in a buffer first.
>
> If others are interested I can try and extract that change and submit it as
> a patch.
>

That would be interesting to see. If you could add this patch it would
be much appreciated (at least by me :D). Btw, your theory confirms. If
i add 1k blips to a wavelet, altough the server receives all the ops
and doesn't complain I can't open the blip anymore. Actually I can't
do anything with that client anymore until I reboot the server and
clean the waves.

> -Tad
>
> On Mon, Jun 14, 2010 at 10:21 AM, Bernardo Ferreira
> <[email protected]> wrote:
>>
>> Hi,
>>
>> I was "playing around" with fedone and decided to make some load
>> testing with multiple clients. I created a test where i would spawn
>> multiple threads in sequence, waiting only 10 seconds before launching
>> the next. Each thread would connect to my local fedone server by
>> opening a new ClientBackend. Before the test spawned the threads it
>> would connect as the first client, create a new wave and add
>> participants for the other threads. Each thread, when spawned, would
>> open the wave from it's own ClientBackend and would start appending
>> blips one after the other. This way i was simulating multiples clients
>> communicating in a single wave (altough at a very high speed :P).
>>
>> Very interesting indeed. But now the funny part. When I ran the test I
>> noticed that it would throw an exception by the time it would spawn
>> the fourth thread. When I checked the exception, I realized it had
>> been thrown by this line in the class SequencedProtoChannel:
>>
>>  // Try to grab the whole payload.
>> if (requiredSize > bufferSize) {
>>                throw new IllegalStateException(String.format("Payload
>> (%d bytes) too large for" +
>>                                " buffer (%d bytes)", requiredSize,
>> bufferSize));
>>              }
>>
>> Why wasn't this being thrown when I had 1, 2 or 3 clients but it was
>> when i tried to start the 4th?  Indeed, very strange. I later tried
>> with 4 separate computers, instead of using threads, and the problem
>> persisted.
>> Finally, i tried twiking with the buffer size. I changed:
>>
>> final int bufferSize = 8192 * 4;
>>
>> to:
>>
>> final int bufferSize = 8192 * 10;
>>
>> This allowed me to connect the 4th client, but i don't know what the
>> consequences of this action are. Any brave soul has an insight into
>> the problem?
>>
>> Cheers,
>> Bernardo
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Wave Protocol" group.
>> To post to this group, send email to [email protected].
>> To unsubscribe from this group, send email to
>> [email protected].
>> For more options, visit this group at
>> http://groups.google.com/group/wave-protocol?hl=en.
>>
>
> --
> You received this message because you are subscribed to the Google Groups
> "Wave Protocol" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected].
> For more options, visit this group at
> http://groups.google.com/group/wave-protocol?hl=en.
>

-- 
You received this message because you are subscribed to the Google Groups "Wave 
Protocol" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/wave-protocol?hl=en.

Reply via email to