问题
Lets say I'm having 6 node cluster having m4.2xl (~ 8CPU 32GB RAM) - How many max tables I can create across keyspaces? and Is there a limit on max tables for a given Keyspace?
Highly Appreciate your response!
回答1:
There could be performance degradation when you have too many tables in the cluster. For every table you need to allocate an additional memory, etc. independent if anybody writes into it or not. From DataStax documentation:
The table thresholds have additional dependencies on JVM Heap and the byte count. Each table uses approximately 1 MB of memory. For each table being acted on, there is a memtable representation in JVM Heap. Tables with large data models increase pressure on memory. Each keyspace also causes additional overhead in JVM memory; therefore having lots of keyspaces may also reduce the table threshold.
DataStax recommends not to have more than 500, although I have seen more, but it required an additional tuning of table parameters.
回答2:
Having too many tables is an anti-pattern in Cassandra. It is difficult to measure the performance impact directly from the table numbers in the cluster. Because there might be other factors of course. However, Datastax offers some thresholds;
Warning threshold: 200 tables. The cluster may run smoothly above this threshold, but once your database reaches the warning threshold, it's time to start monitoring and planning a re-architecture. If possible, remove unused and underutilized tables.
Failure threshold: 500 tables. On a cluster that has exceeded 500 tables, expect problems and errors, including (but not limited) issues related to high memory usage and compactions.
来源:https://stackoverflow.com/questions/57324790/how-many-max-number-of-tables-i-can-create-in-a-given-cassandra-cluster-is-the