# How to scale up the cache file size when we scale up the disk size?

**URL:** <https://discuss.elastic.co/t/how-to-scale-up-the-cache-file-size-when-we-scale-up-the-disk-size/287747>\
**Category:** Elasticsearch\
**Tags:** elastic-stack-searchable-snapshots\
**Created:** [October 27, 2021, 3:27am UTC](https://discuss.elastic.co/t/how-to-scale-up-the-cache-file-size-when-we-scale-up-the-disk-size/287747 "2021-10-27T03:27:32Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![gaobinlong](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/gaobinlong/32/49319_2.png) [@gaobinlong](https://discuss.elastic.co/u/gaobinlong)\
**Post date:** [October 27, 2021, 3:27am UTC](https://discuss.elastic.co/t/how-to-scale-up-the-cache-file-size-when-we-scale-up-the-disk-size/287747/1 "2021-10-27T03:27:32Z")

</div>

Our es clusters are deployed in cloud, and the cloud disk is very easy to scale up it's size. We found that the size of the local cache file `shared_snapshot_cache` on the dedicated frozen node didn't change when we scale up the node's disk size, but then changed after we restart the node. My question is that can we resize the local cache file dynamicly instead of restarting the node?

---

<div class="post-metadata">

**Author:** ![gaobinlong](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/gaobinlong/32/49319_2.png) [@gaobinlong](https://discuss.elastic.co/u/gaobinlong)\
**Post date:** [October 29, 2021, 3:11am UTC](https://discuss.elastic.co/t/how-to-scale-up-the-cache-file-size-when-we-scale-up-the-disk-size/287747/2 "2021-10-29T03:11:05Z")

</div>

Anyone can give me some cue about how to do this? We are testing the searchable snapshot feature now.

---

<div class="post-metadata">

**Author:** ![DavidTurner](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/davidturner/32/22453_2.png) [@DavidTurner](https://discuss.elastic.co/u/DavidTurner)\
**Post date:** [October 29, 2021, 7:55am UTC](https://discuss.elastic.co/t/how-to-scale-up-the-cache-file-size-when-we-scale-up-the-disk-size/287747/3 "2021-10-29T07:55:56Z")

</div>

> [@gaobinlong](#):
>
> My question is that can we resize the local cache file dynamicly instead of restarting the node?

No you can't. It would be rather complicated to implement.

---

<div class="post-metadata">

**Author:** ![gaobinlong](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/gaobinlong/32/49319_2.png) [@gaobinlong](https://discuss.elastic.co/u/gaobinlong)\
**Post date:** [October 29, 2021, 8:19am UTC](https://discuss.elastic.co/t/how-to-scale-up-the-cache-file-size-when-we-scale-up-the-disk-size/287747/4 "2021-10-29T08:19:57Z")

</div>

@DavidTurner thanks for your reply, I found that the local cache file `shared_snapshot_cache` was created by the native system call `fallocate`, can we just execute `fallocate -l $new_file_size shared_snapshot_cache ` to enlarge the size of the file?

---

<div class="post-metadata">

**Author:** ![DavidTurner](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/davidturner/32/22453_2.png) [@DavidTurner](https://discuss.elastic.co/u/DavidTurner)\
**Post date:** [October 29, 2021, 8:36am UTC](https://discuss.elastic.co/t/how-to-scale-up-the-cache-file-size-when-we-scale-up-the-disk-size/287747/5 "2021-10-29T08:36:44Z")

</div>

You shouldn't make any modifications within the data path yourself - see the warning in [this section of the docs](https://www.elastic.co/guide/en/elasticsearch/reference/current/modules-node.html#data-path):

> **WARNING** : Don’t modify anything within the data directory or run processes that might interfere with its contents. If something other than Elasticsearch modifies the contents of the data directory, then Elasticsearch may fail, reporting corruption or other data inconsistencies, or may appear to work correctly having silently lost some of your data...

I doubt what you say would even work, but it's certainly not something you should rely on.

---

<div class="post-metadata">

**Author:** ![gaobinlong](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/gaobinlong/32/49319_2.png) [@gaobinlong](https://discuss.elastic.co/u/gaobinlong)\
**Post date:** [October 29, 2021, 8:40am UTC](https://discuss.elastic.co/t/how-to-scale-up-the-cache-file-size-when-we-scale-up-the-disk-size/287747/6 "2021-10-29T08:40:09Z")

</div>

OK, got it, thanks @DavidTurner

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [November 26, 2021, 8:40am UTC](https://discuss.elastic.co/t/how-to-scale-up-the-cache-file-size-when-we-scale-up-the-disk-size/287747/7 "2021-11-26T08:40:47Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
