Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update performance.md - Remove old curl commands #8761

Merged
merged 4 commits into from
Nov 21, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
```
kolchfa-aws marked this conversation as resolved.
Show resolved Hide resolved
{% 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"
}
}
```
kolchfa-aws marked this conversation as resolved.
Show resolved Hide resolved
{% 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
```
kolchfa-aws marked this conversation as resolved.
Show resolved Hide resolved
{% 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"} }
```
kolchfa-aws marked this conversation as resolved.
Show resolved Hide resolved
{% 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/).
Loading