Skip to content

Commit d508c4d

Browse files
committed
improve acrolinx score
1 parent cbb830c commit d508c4d

File tree

1 file changed

+13
-14
lines changed

1 file changed

+13
-14
lines changed

articles/managed-instance-apache-cassandra/best-practice-performance.md

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
title: Best practices for optimal performance in Azure Managed Instance for Apache Cassandra
3-
description: Learn about best practices to ensure optimal performance from Azure Managed Instance for Apache Cassandra
3+
description: Learn about best practices to ensure optimal performance from Azure Managed Instance for Apache Cassandra.
44
author: IriaOsara
55
ms.service: managed-instance-apache-cassandra
66
ms.topic: how-to
@@ -36,7 +36,7 @@ Transactional workloads typically need a data center optimized for low latency,
3636

3737
### Optimizing for analytical workloads
3838

39-
We recommend customers apply the following `cassandra.yaml` settings for analytical workloads (see [here](create-cluster-portal.md#update-cassandra-configuration) on how to apply)
39+
We recommend customers apply the following `cassandra.yaml` settings for analytical workloads (see [here](create-cluster-portal.md#update-cassandra-configuration) on how to apply).
4040

4141

4242

@@ -78,7 +78,7 @@ We recommend boosting Cassandra client driver timeouts in accordance with the ti
7878

7979
### Optimizing for low latency
8080

81-
Our default settings are already suitable for low latency workloads. To ensure best performance for tail latencies we highly recommend using a client driver that supports [speculative execution](https://docs.datastax.com/en/developer/java-driver/4.10/manual/core/speculative_execution/) and configuring your client accordingly. For Java V4 driver, you can find a demo illustrating how this works and how to enable the policy [here](https://github.com/Azure-Samples/azure-cassandra-mi-java-v4-speculative-execution).
81+
Our default settings are already suitable for low latency workloads. To ensure best performance for tail latencies, we highly recommend using a client driver that supports [speculative execution](https://docs.datastax.com/en/developer/java-driver/4.10/manual/core/speculative_execution/) and configuring your client accordingly. For Java V4 driver, you can find a demo illustrating how this works and how to enable the policy [here](https://github.com/Azure-Samples/azure-cassandra-mi-java-v4-speculative-execution).
8282

8383

8484

@@ -93,7 +93,7 @@ Like every database system, Cassandra works best if the CPU utilization is aroun
9393
:::image type="content" source="./media/best-practice-performance/metrics.png" alt-text="Screenshot of CPU metrics." lightbox="./media/best-practice-performance/metrics.png" border="true":::
9494

9595

96-
If the CPU is permanently above 80% for most nodes the database will become overloaded manifesting in multiple client timeouts. In this scenario, we recommend taking the following actions:
96+
If the CPU is permanently above 80% for most nodes the database becomes overloaded manifesting in multiple client timeouts. In this scenario, we recommend taking the following actions:
9797

9898
* vertically scale up to a SKU with more CPU cores (especially if the cores are only 8 or less).
9999
* horizontally scale by adding more nodes (as mentioned earlier, the number of nodes should be multiple of the replication factor).
@@ -151,7 +151,7 @@ If your IOPS max out what your SKU supports, you can:
151151
* [Scale up the data center(s)](create-cluster-portal.md#scale-a-datacenter) by adding more nodes.
152152

153153

154-
For more information refer to [Virtual Machine and disk performance](../virtual-machines/disks-performance.md).
154+
For more information, refer to [Virtual Machine and disk performance](../virtual-machines/disks-performance.md).
155155

156156
### Network performance
157157

@@ -161,7 +161,7 @@ In most cases network performance is sufficient. However, if you're frequently s
161161
:::image type="content" source="./media/best-practice-performance/metrics-network.png" alt-text="Screenshot of network metrics." lightbox="./media/best-practice-performance/metrics-network.png" border="true":::
162162

163163

164-
If you only see the network elevated for a small number of nodes, you might have a hot partition and need to review your data distribution and/or access patterns for a potential skew.
164+
If you only see the network elevated for a few nodes, you might have a hot partition and need to review your data distribution and/or access patterns for a potential skew.
165165

166166
* Vertically scale up to a different SKU supporting more network I/O.
167167
* Horizontally scale up the cluster by adding more nodes.
@@ -177,7 +177,7 @@ Deployments should be planned and provisioned to support the maximum number of p
177177

178178
### Disk space
179179

180-
In most cases, there's sufficient disk space as default deployments are optimized for IOPS, which leads to low utilization of the disk. Nevertheless, we advise occasionally reviewing disk space metrics. Cassandra accumulates a lot of disk and then reduces it when compaction is triggered. Hence it is important to review disk usage over longer periods to establish trends - like compaction unable to recoup space.
180+
In most cases, there's sufficient disk space as default deployments are optimized for IOPS, which leads to low utilization of the disk. Nevertheless, we advise occasionally reviewing disk space metrics. Cassandra accumulates a lot of disks and then reduces it when compaction is triggered. Hence it's important to review disk usage over longer periods to establish trends - like compaction unable to recoup space.
181181

182182
> [!NOTE]
183183
> In order to ensure available space for compaction, disk utilization should be kept to around 50%.
@@ -192,11 +192,11 @@ If you only see this behavior for a few nodes, you might have a hot partition an
192192

193193
### JVM memory
194194

195-
Our default formula assigns half the VM's memory to the JVM with an upper limit of 31 GB - which in most cases is a good balance between performance and memory. Some workloads, especially ones which have frequent cross-partition reads or range scans might be memory challenged.
195+
Our default formula assigns half the VM's memory to the JVM with an upper limit of 31 GB - which in most cases is a good balance between performance and memory. Some workloads, especially ones that have frequent cross-partition reads or range scans might be memory challenged.
196196

197197
In most cases memory gets reclaimed effectively by the Java garbage collector, but especially if the CPU is often above 80% there aren't enough CPU cycles for the garbage collector left. So any CPU performance problems should be addresses before memory problems.
198198

199-
If the CPU hovers below 70%, and the garbage collection isn't able to reclaim memory, you might need more JVM memory. This is especially the case if you're on a SKU with limited memory. In most cases, you'll need to review your queries and client settings and reduce `fetch_size` along with what is chosen in `limit` within your CQL query.
199+
If the CPU hovers below 70%, and the garbage collection isn't able to reclaim memory, you might need more JVM memory. This is especially the case if you're on a SKU with limited memory. In most cases, you need to review your queries and client settings and reduce `fetch_size` along with what is chosen in `limit` within your CQL query.
200200

201201
If you indeed need more memory, you can:
202202

@@ -206,7 +206,7 @@ If you indeed need more memory, you can:
206206

207207
### Tombstones
208208

209-
We run repairs every seven days with reaper which removes rows whose TTL has expired (called "tombstone"). Some workloads have more frequent deletes and see warnings like `Read 96 live rows and 5035 tombstone cells for query SELECT ...; token <token> (see tombstone_warn_threshold)` in the Cassandra logs, or even errors indicating that a query couldn't be fulfilled due to excessive tombstones.
209+
We run repairs every seven days with reaper, which removes rows whose TTL has expired (called "tombstone"). Some workloads have more frequent deletes and see warnings like `Read 96 live rows and 5035 tombstone cells for query SELECT ...; token <token> (see tombstone_warn_threshold)` in the Cassandra logs, or even errors indicating that a query couldn't be fulfilled due to excessive tombstones.
210210

211211
A short term mitigation if queries don't get fulfilled is to increase the `tombstone_failure_threshold` in the [Cassandra config](create-cluster-portal.md#update-cassandra-configuration) from the default 100,000 to a higher value.
212212

@@ -234,16 +234,15 @@ This indicates a problem in the data model. Here's a [stack overflow article](ht
234234

235235
## Specialized optimizations
236236
### Compression
237-
Cassandra allows the selection of an appropriate compression algorithm when a table is created (see [Compression](https://cassandra.apache.org/doc/latest/cassandra/operating/compression.html)) The default is LZ4 which is excellent
238-
for throughput and CPU but consumes more space on disk. Using Zstd (Cassandra 4.0 and up) saves about ~12% space with
237+
Cassandra allows the selection of an appropriate compression algorithm when a table is created (see [Compression](https://cassandra.apache.org/doc/latest/cassandra/operating/compression.html)) The default is LZ4, which is excellent for throughput and CPU but consumes more space on disk. Using Zstd (Cassandra 4.0 and up) saves about ~12% space with
239238
minimal CPU overhead.
240239

241240
### Optimizing memtable heap space
242241
Our default is to use 1/4 of the JVM heap for [memtable_heap_space](https://cassandra.apache.org/doc/latest/cassandra/configuration/cass_yaml_file.html#memtable_heap_space)
243242
in the cassandra.yaml. For write oriented application and/or on SKUs with small memory
244243
this can lead to frequent flushing and fragmented sstables thus requiring more compaction.
245-
In such cases increasing it to at least 4048 might be beneficial but requires careful benchmarking
246-
to make sure other operations (e.g. reads) aren't affected.
244+
In such cases increasing, it to at least 4048 might be beneficial but requires careful benchmarking
245+
to make sure other operations (for example, reads) aren't affected.
247246

248247
## Next steps
249248

0 commit comments

Comments
 (0)