Janakiraman
Janakiraman

Reputation: 11

How to Create slowness in Cassandra?

I want to create slowness in Cassandra to test my application. Is there any specific ways to induce slowness in Cassandra. In RDBMS we use locking, to wait for other operation until the lock is released. As Cassandra doesn't have locking, is there any other way to create deadlock, slowness etc.

Upvotes: 1

Views: 381

Answers (4)

Greg Bestland
Greg Bestland

Reputation: 833

You could check out our project here simulacron. https://github.com/datastax/simulacron

This is a C*/DSE simulator, that was written specifically to test things like race conditions, and error conditions. You would have to prime all your relevant queries ahead of time, but it would allow you introduce a wait time, or errors to your responses. You can also simulate a large cluster on your local machine.

There is also a similar tool called scassandra, which does much of the same thing. http://www.scassandra.org/

Upvotes: 2

FuzzyAmi
FuzzyAmi

Reputation: 8157

Maybe easier to just limit the network on the nodes. Depending on the OS ure using there are different options.

Upvotes: 0

Horia
Horia

Reputation: 2982

You could use cassandra-stress tool

Upvotes: 2

nevsv
nevsv

Reputation: 2466

There are many ways to do it, i'll list two:

  1. Create UDF with sleep/wait function within, if your version of Cassandra supports it.

Link to the docs: https://docs.datastax.com/en/cql/3.3/cql/cql_using/useCreateUDF.html

  1. Create large table (the larger it be, slower it will run), and run:

select some_column from table where other_column = 'something' allow filtering;

where other_column is not a partition key of the table. It will result in full table scan, and since Cassandra isn't built for it, it will take some time (also I/O and CPU).

Upvotes: 1

Related Questions