---
type: api
title: Get cache statistics
description: **All methods and paths for this operation:**
url: https://www.elastic.co/elastic/docs-builder/docs/4371/api/doc/elasticsearch/operation/operation-searchable-snapshots-cache-stats
resource: https://www.elastic.co/elastic/docs-builder/docs/4371/api/doc/elasticsearch/operation/operation-searchable-snapshots-cache-stats
products:
  - Elasticsearch
---

# Get cache statistics


Availability: 7.13+

## Paths

- `GET` `/_searchable_snapshots/{node_id}/cache/stats`
- `GET` `/_searchable_snapshots/cache/stats`

- [Api key auth](/elastic/docs-builder/docs/4371/api/doc/elasticsearch/authentication#apikeyauth)
- [Basic auth](/elastic/docs-builder/docs/4371/api/doc/elasticsearch/authentication#basicauth)
- [Bearer auth](/elastic/docs-builder/docs/4371/api/doc/elasticsearch/authentication#bearerauth)

#### Path Parameters

- `node_id` (union NodeId | [] NodeId) — optional, leave it out to use `/_searchable_snapshots/cache/stats`
  The names of the nodes in the cluster to target.

## Description

Get statistics about the shared cache for partially mounted indices.

## Required authorization

* Cluster privileges: `manage`

[More about searchable snapshots](https://www.elastic.co/docs/deploy-manage/tools/snapshot-and-restore/searchable-snapshots)

## Response

`application/json`

- `nodes` (map string to Node)
  Map values ({} Node)
  - `shared_cache` ({} Shared)
    - `reads` (number)
    - `bytes_read_in_bytes` (number | string ByteSize)
    - `writes` (number)
    - `bytes_written_in_bytes` (number | string ByteSize)
    - `evictions` (number)
    - `num_regions` (number)
    - `size_in_bytes` (number | string ByteSize)
    - `region_size_in_bytes` (number | string ByteSize)
## Code Examples

#### Console

```console
GET /_searchable_snapshots/cache/stats
```

#### JavaScript

```javascript
const response = await client.searchableSnapshots.cacheStats();
```

#### Python

```python
resp = client.searchable_snapshots.cache_stats()
```

#### curl

```curl
curl -X GET "$ELASTICSEARCH_URL/_searchable_snapshots/cache/stats" \
  -H "Authorization: ApiKey $ELASTIC_API_KEY"
```

#### Java

```java
client.searchableSnapshots().cacheStats(c -> c);
```

#### C#

```c#
var response = await client.SearchableSnapshots.CacheStatsAsync();
```

#### PHP

```php
$resp = $client->searchableSnapshots()->cacheStats();
```

#### Ruby

```ruby
response = client.searchable_snapshots.cache_stats
```

## Response Examples

#### Cache stats response example1

A successful response from `GET /_searchable_snapshots/cache/stats`.

```json
{
  "nodes" : {
    "eerrtBMtQEisohZzxBLUSw" : {
      "shared_cache" : {
        "reads" : 6051, // The number of cache region read operations. If reads > writes, the difference represents requests successfully served from the cache without accessing the snapshot repository.
        "bytes_read_in_bytes" : 5448829,
        "writes" : 37, // The number of cache region write operations. If reads == writes, every request required fetching data from the snapshot repository into the cache.
        "bytes_written_in_bytes" : 1208320,
        "evictions" : 5, // The number of cache region evictions. A low eviction count indicates the cache is effectively serving requests. Use this metric to evaluate cache sizing.
        "num_regions" : 65536,
        "size_in_bytes" : 1099511627776,
        "region_size_in_bytes" : 16777216 // The size of each cache region. A region is a contiguous byte range stored on local disk.
      }
    }
  }
}
```

