cassandra-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jan Algermissen <>
Subject Tolerable amount of CAS queries?
Date Fri, 21 Jul 2017 13:41:53 GMT

I just read [1] which describes a lease implementation using CAS 
queries. It applies a TTL to the lease which needs to be refreshed 
periodically by the lease holder.

I use such a pattern myself since a couple of years, so no surprise 

However, the article uses CAS queries not only for acquiring the lease, 
but also for TTL updates and active lease canceling. Given a default TTL 
of three minutes is described, the amount of CAS queries might be ok.

What if I go for much shorter TTLs, eg 5 seconds to minimise the time 
another peer takes over if the current lease owner crashes or is 
stopped? Using some safety margin for updating the TTL, we'd end up with 
a CAS query every 3 seconds or so. If we have a bunch of such leases, 
we'd likely see 10 or more such CAS queries a second.

I am looking for advice whether such a high number of CAS queries could 
be tolerable at all? I'd assume there is not much contention on the same 
lease, is the overhead of a CAS query basically that it leads to 4 or 
sometimes significantly more 'queries' in the C* cluster?

IOW, suppose I

- have a cluster spanning geographic regions
- restrict the CAS queries to key spaces that are only replicated in a 
single region and I use LOCAL_SERIAL CL

would 100 CAS queries per second that in the normal case do not conflict 
(== work in different partition keys) be sort of 'ok'?

Or should it rather be in the range of 10/s?



To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message