The Cassandra database cluster performance may be impacted by tombstone occurrences which
results in slower query response times. When this performance degrades the Agile Service Manager
installation, the following procedure to set gc_grace_seconds
can be used to
mitigate this degradation.
About this task
For an on-prem environment, gc_grace_seconds
can be safely set to 0.
Procedure
-
Log into a server where Agile Service Manager is running.
-
Find the name of a Cassandra container.
docker ps | grep cassandra
For
example:$ docker ps | grep cassandra
000000000000 nasm-cassandra:3.11.3.62 "/opt/ibm/start-ca..." 5 hours ago Up 5 hours asm_cassandra_1
The pod is identified as asm-cassandra-1
-
Run the following command to exec into the container and start cqlsh:
docker exec -ti {container name} cqlsh -u cassandra -p cassandra
For
example:$ docker exec -ti asm_cassandra_1 cqlsh -u cassandra -p
Connected to topology_cassandra at asm_cassandra_1:9042.
[cqlsh 5.0.1 | Cassandra 3.11.3 | CQL spec 3.4.4 | Native protocol v4]
Use HELP for help.
cassandra@cqlsh>
Repeat steps 4 to 6 for all tables within the janusgraph key
space.
-
Verify the current setting of
gc_grace_seconds
.
SELECT table_name,gc_grace_seconds FROM system_schema.tables WHERE keyspace_name='janusgraph';
For
example:cassandra@cqlsh> SELECT table_name,gc_grace_seconds FROM system_schema.tables WHERE keyspace_name='janusgraph';
table_name | gc_grace_seconds
-------------------------+------------------
edgestore | 864000
edgestore_lock_ | 864000
graphindex | 864000
graphindex_lock_ | 864000
janusgraph_ids | 864000
system_properties | 864000
system_properties_lock_ | 864000
systemlog | 864000
txlog | 864000
-
Change the value to 0 (zero) using the ALTER TABLE command:
ALTER TABLE janusgraph.{table name} WITH gc_grace_seconds = {gc_grace_seconds value};
For
example:cassandra@cqlsh> ALTER TABLE janusgraph.edgestore WITH gc_grace_seconds = 0;
-
Verify the settings have worked.
SELECT table_name,gc_grace_seconds FROM system_schema.tables WHERE keyspace_name='janusgraph';
For
example:cassandra@cqlsh> SELECT table_name,gc_grace_seconds FROM system_schema.tables WHERE keyspace_name='janusgraph';
table_name | gc_grace_seconds
-------------------------+------------------
edgestore | 0
edgestore_lock_ | 864000
graphindex | 864000
graphindex_lock_ | 864000
janusgraph_ids | 864000
system_properties | 864000
system_properties_lock_ | 864000
systemlog | 864000
txlog | 864000
(9 rows)
Remember: Repeat steps 4 to 6 for all tables within the janusgraph key space.
-
Exit cqlsh:
Example:cassandra@cqlsh> exit
$