Skip to content

Commit

Permalink
Update performance.md - Remove old curl commands (opensearch-project#…
Browse files Browse the repository at this point in the history
…8761)

* Update performance.md

Updating old curl examples to current standard across the rest of the documentation.

Signed-off-by: Landon Lengyel <[email protected]>

* Apply suggestions from code review

Signed-off-by: kolchfa-aws <[email protected]>

---------

Signed-off-by: Landon Lengyel <[email protected]>
Signed-off-by: kolchfa-aws <[email protected]>
Co-authored-by: kolchfa-aws <[email protected]>
Signed-off-by: Eric Pugh <[email protected]>
  • Loading branch information
2 people authored and epugh committed Nov 23, 2024
1 parent d3d2778 commit 2708633
Showing 1 changed file with 15 additions and 12 deletions.
27 changes: 15 additions & 12 deletions _tuning-your-cluster/performance.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,9 @@ An increased `index.translog.flush_threshold_size` can also increase the time th
Before increasing `index.translog.flush_threshold_size`, call the following API operation to get current flush operation statistics:

```json
curl -XPOST "os-endpoint/index-name/_stats/flush?pretty"
GET /<index>/_stats/flush?pretty
```
{% include copy.html %}


Replace the `os-endpoint` and `index-name` with your endpoint and index name.
{% include copy-curl.html %}

In the output, note the number of flushes and the total time. The following example output shows that there are 124 flushes, which took 17,690 milliseconds:

Expand All @@ -53,9 +50,15 @@ In the output, note the number of flushes and the total time. The following exam
To increase the flush threshold size, call the following API operation:

```json
curl -XPUT "os-endpoint/index-name/_settings?pretty" -d "{"index":{"translog.flush_threshold_size" : "1024MB"}}"
PUT /<index>/_settings
{
"index":
{
"translog.flush_threshold_size" : "1024MB"
}
}
```
{% include copy.html %}
{% include copy-curl.html %}

In this example, the flush threshold size is set to 1024 MB, which is ideal for instances that have more than 32 GB of memory.

Expand All @@ -65,9 +68,9 @@ Choose the appropriate threshold size for your cluster.
Run the stats API operation again to see whether the flush activity changed:

```json
curl -XGET "os-endpoint/index-name/_stats/flush?pretty"
GET /<index>/_stats/flush
```
{% include copy.html %}
{% include copy-curl.html %}

It's a best practice to increase the `index.translog.flush_threshold_size` only for the current index. After you confirm the outcome, apply the changes to the index template.
{: .note}
Expand Down Expand Up @@ -127,14 +130,14 @@ To reduce the size of the OpenSearch response, use the `filter_path` parameter t
In the following example, the `index-name`, `type-name`, and `took` fields are excluded from the response:

```json
curl -XPOST "es-endpoint/index-name/type-name/_bulk?pretty&filter_path=-took,-items.index._index,-items.index._type" -H 'Content-Type: application/json' -d'
POST /_bulk?pretty&filter_path=-took,-items.index._index,-items.index._type
{ "index" : { "_index" : "test2", "_id" : "1" } }
{ "user" : "testuser" }
{ "update" : {"_id" : "1", "_index" : "test2"} }
{ "doc" : {"user" : "example"} }
```
{% include copy.html %}
{% include copy-curl.html %}

## Compression codecs

In OpenSearch 2.9 and later, there are two new codecs for compression: `zstd` and `zstd_no_dict`. You can optionally specify a compression level for these in the `index.codec.compression_level` setting with values in the [1, 6] range. [Benchmark]({{site.url}}{{site.baseurl}}/im-plugin/index-codecs/#benchmarking) data shows that `zstd` provides a 7% better write throughput and `zstd_no_dict` provides a 14% better throughput, along with a 30% improvement in storage compared with the `default` codec. For more information about compression, see [Index codecs]({{site.url}}{{site.baseurl}}/im-plugin/index-codecs/).
In OpenSearch 2.9 and later, there are two new codecs for compression: `zstd` and `zstd_no_dict`. You can optionally specify a compression level for these in the `index.codec.compression_level` setting with values in the [1, 6] range. [Benchmark]({{site.url}}{{site.baseurl}}/im-plugin/index-codecs/#benchmarking) data shows that `zstd` provides a 7% better write throughput and `zstd_no_dict` provides a 14% better throughput, along with a 30% improvement in storage compared with the `default` codec. For more information about compression, see [Index codecs]({{site.url}}{{site.baseurl}}/im-plugin/index-codecs/).

0 comments on commit 2708633

Please sign in to comment.