Table of Contents
List of Tables
List of Examples
This module is an implementation of a cache system designed to work with Cassandra servers. It uses the Key-Value interface exported from the core.
memory costs are no longer on the server
many servers can be used inside a cluster, so the memory is virtually unlimited
the cache is 100% persistent. A restart of OpenSIPS server will not affect the DB. The Cassandra DB is also persistent so it can also be restarted without loss of information.
Cassandra is an open-source project so it can be used to exchange data with various other applications
By creating a Cassandra Cluster, multiple OpenSIPS instances can easily share key-value information
The following libraries or applications must be installed before running OpenSIPS with this module loaded:
Thrift 0.6.1 can be downloaded from http://archive.apache.org/dist/thrift/ Download the archive, extract sources, run ./configure,make,sudo make install.
The urls of the server groups that OpenSIPS will connect to in order to use the from script cache_store,cache_fetch, etc operations. It can be set more than one time. The prefix part of the URL will be the identifier that will be used from the script. The database part of the URL needs to be in the format Keyspace_ColumnFamily_CounterFamily
Example 1.1. Set
... modparam("cachedb_cassandra", "cachedb_url","cassandra:group1://localhost:9061/Keyspace1_Users_Counters"); modparam("cachedb_cassandra", "cachedb_url","cassandra:cluster1://random_url:8888/Keyspace2_Keys_CounterF"); ...
Example 1.2. Use Cassandra servers
... cache_store("cassandra:group1","key","$ru value"); cache_fetch("cassandra:cluster1","key",$avp(10)); cache_remove("cassandra:cluster1","key"); ...
The timeout in ms that will be triggered in case a connection attempt fails.
Example 1.3. Set
... modparam("cachedb_cassandra", "connection_timeout",1000); ...
The timeout in ms that will be triggered in case a Cassandra write takes too long
The timeout in ms that will be triggered in case a Cassandra read takes too long
Example 1.5. Set
... modparam("cachedb_cassandra", "receive_timeout",1000); ...
The consistency level desired for write operations. Options are :
1 - Ensure that the write has been written to at least 1 replica's commit log and memory table before responding to the client.
2 - Ensure that the write has been written to N / 2 + 1 replicas before responding to the client.
3 - Ensure that the write has been written to ReplicationFactor / 2 + 1 nodes, within the local datacenter (requires NetworkTopologyStrategy)
4 - Ensure that the write has been written to ReplicationFactor / 2 + 1 nodes in each datacenter (requires NetworkTopologyStrategy)
5 - Ensure that the write is written to all N replicas before responding to the client. Any unresponsive replicas will fail the operation.
6 - Ensure that the write has been written to at least 1 node, including HintedHandoff recipients.
7 - Ensure that the write has been written to at least 2 replica's before responding to the client.
8 - Ensure that the write has been written to at least 3 replica's before responding to the client.
Default is 1
Example 1.6. Set
... modparam("cachedb_cassandra", "wr_consistency_level",7); ...
The consistency level desired for read operations. Options are the same as for write consistency level.
Example 1.7. Set
... modparam("cachedb_cassandra", "rd_consistency_level",7); ...
The maximum number of microseconds that a cassandra cache query can last. Anything above the threshold will trigger a warning message to the log
Default value is “0 ( unlimited - no warnings )”.
Example 1.8. Set
... modparam("cachedb_cassandra", "exec_threshold", 100000) ...
Due to the fact that Cassandra cannot store counters and regular columns in the same ColumnFamily, add() and sub() methods are not exported through the Key-Value interface.
Also, the module does not currently support Authentication.
Future realeases of this module will address this issue.
Table 2.1. Top contributors by DevScore(1), authored commits(2) and lines added/removed(3)
|Name||DevScore||Commits||Lines ++||Lines --|
|1.||Vlad Paiu (@vladpaiu)||177||7||21444||38|
|2.||Liviu Chircu (@liviuchircu)||7||5||24||42|
|3.||Razvan Crainea (@razvancrainea)||4||2||12||12|
|5.||Julián Moreno Patiño||3||1||1||1|
|6.||Jarrod Baumann (@jarrodb)||2||1||2||0|
|7.||Bogdan-Andrei Iancu (@bogdan-iancu)||2||1||1||0|
|8.||Vlad Patrascu (@rvlad-patrascu)||2||1||1||0|
(1) DevScore = author_commits + author_lines_added / (project_lines_added / project_commits) + author_lines_deleted / (project_lines_deleted / project_commits)
(2) including any documentation-related commits, excluding merge commits. Regarding imported patches/code, we do our best to count the work on behalf of the proper owner, as per the "fix_authors" and "mod_renames" arrays in opensips/doc/build-contrib.sh. If you identify any patches/commits which do not get properly attributed to you, please submit a pull request which extends "fix_authors" and/or "mod_renames".
(3) ignoring whitespace edits, renamed files and auto-generated files
Table 2.2. Most recently active contributors(1) to this module
|1.||Liviu Chircu (@liviuchircu)||Mar 2014 - Jun 2018|
|2.||Vlad Patrascu (@rvlad-patrascu)||May 2017 - May 2017|
|3.||Julián Moreno Patiño||Feb 2016 - Feb 2016|
|4.||Razvan Crainea (@razvancrainea)||Feb 2012 - Aug 2015|
|5.||Jarrod Baumann (@jarrodb)||May 2015 - May 2015|
|6.||Bogdan-Andrei Iancu (@bogdan-iancu)||Oct 2014 - Oct 2014|
|7.||fabriziopicconi||Apr 2014 - Apr 2014|
|8.||Vlad Paiu (@vladpaiu)||Dec 2011 - Nov 2013|
(1) including any documentation-related commits, excluding merge commits
Copyright © 2011 www.opensips-solutions.com