# What does "script.cache.max\_size" and "script.cache.max\_size" mean?

**URL:** <https://discuss.elastic.co/t/what-does-script-cache-max-size-and-script-cache-max-size-mean/142454>\
**Category:** Elasticsearch\
**Created:** [August 1, 2018, 2:00am UTC](https://discuss.elastic.co/t/what-does-script-cache-max-size-and-script-cache-max-size-mean/142454 "2018-08-01T02:00:46Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![xyx](https://avatars.discourse-cdn.com/v4/letter/x/eb8c5e/32.png) [@xyx](https://discuss.elastic.co/u/xyx)\
**Post date:** [August 1, 2018, 2:00am UTC](https://discuss.elastic.co/t/what-does-script-cache-max-size-and-script-cache-max-size-mean/142454/1 "2018-08-01T02:00:46Z")

</div>

I want do update by script.But my scropt source is too large,about ten thousand characters.

If I use Inline scripts,it is so heavy to http request(builk update).So I want use sotred scripts,but I see this.

You can configure the size of this cache by using the script.cache.max\_size setting. By default, the cache size is 100.  
The size of stored scripts is limited to 65,535 bytes. This can be changed by setting script.max\_size\_in\_bytes setting to increase that soft limit

---

<div class="post-metadata">

**Author:** ![rjernst](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rjernst/32/6363_2.png) [@rjernst](https://discuss.elastic.co/u/rjernst)\
**Post date:** [August 9, 2018, 3:14am UTC](https://discuss.elastic.co/t/what-does-script-cache-max-size-and-script-cache-max-size-mean/142454/2 "2018-08-09T03:14:59Z")

</div>

You are likely hitting the internal maximum inside painless. There is an [open issue](https://github.com/elastic/elasticsearch/issues/23209) to improve this, making it based on the script context (eg a scoring script should be short, since it could be run on millions of documents in a request, but an update script could be much longer).

The script cache size is how many compiled scripts are kept in the cache.

---

<div class="post-metadata">

**Author:** ![xyx](https://avatars.discourse-cdn.com/v4/letter/x/eb8c5e/32.png) [@xyx](https://discuss.elastic.co/u/xyx)\
**Post date:** [August 9, 2018, 6:53am UTC](https://discuss.elastic.co/t/what-does-script-cache-max-size-and-script-cache-max-size-mean/142454/3 "2018-08-09T06:53:40Z")

</div>

It is really helps me.Thank you.

---

<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:** [September 6, 2018, 6:53am UTC](https://discuss.elastic.co/t/what-does-script-cache-max-size-and-script-cache-max-size-mean/142454/4 "2018-09-06T06:53:54Z")

</div>

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