You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@cassandra.apache.org by A J <s5...@gmail.com> on 2011/04/06 19:20:08 UTC

Introduce Random latency

I want to run some tests where I incorporate random latency in some of
the nodes (that varies over time). I think the best place is to place
a 'sleep (random(10 to 50 seconds)) function' somewhere in the source
code of cassandra.
Or maybe the sleep is not random but the seconds to sleep are read
from an external file on that node. (that I will modify as the tests
are going on)

What would be a good spot in the source code to include this sleep function ?

Thanks.

Re: Introduce Random latency

Posted by A J <s5...@gmail.com>.
Thanks! This is a much better way.

On Wed, Apr 6, 2011 at 1:27 PM, Scott Brooks <sc...@beamdog.com> wrote:
> I'm not sure of your exact requirements for why you would do that
> there, but have you thought about putting the delay in the network
> instead?
> http://stackoverflow.com/questions/614795/simulate-delayed-and-dropped-packets-on-linux
>
> That SO page has a pretty good description of how you can do it on the
> network level without having to modify any source(assuming you are on
> linux).
>
> Scott
>
> On Wed, Apr 6, 2011 at 11:20 AM, A J <s5...@gmail.com> wrote:
>> I want to run some tests where I incorporate random latency in some of
>> the nodes (that varies over time). I think the best place is to place
>> a 'sleep (random(10 to 50 seconds)) function' somewhere in the source
>> code of cassandra.
>> Or maybe the sleep is not random but the seconds to sleep are read
>> from an external file on that node. (that I will modify as the tests
>> are going on)
>>
>> What would be a good spot in the source code to include this sleep function ?
>>
>> Thanks.
>>
>

Re: Introduce Random latency

Posted by Scott Brooks <sc...@beamdog.com>.
I'm not sure of your exact requirements for why you would do that
there, but have you thought about putting the delay in the network
instead?
http://stackoverflow.com/questions/614795/simulate-delayed-and-dropped-packets-on-linux

That SO page has a pretty good description of how you can do it on the
network level without having to modify any source(assuming you are on
linux).

Scott

On Wed, Apr 6, 2011 at 11:20 AM, A J <s5...@gmail.com> wrote:
> I want to run some tests where I incorporate random latency in some of
> the nodes (that varies over time). I think the best place is to place
> a 'sleep (random(10 to 50 seconds)) function' somewhere in the source
> code of cassandra.
> Or maybe the sleep is not random but the seconds to sleep are read
> from an external file on that node. (that I will modify as the tests
> are going on)
>
> What would be a good spot in the source code to include this sleep function ?
>
> Thanks.
>