Skip to content

Commit 37ee519

Browse files
mdx to asciidoc
1 parent 1b3caa8 commit 37ee519

File tree

3 files changed

+212
-128
lines changed

3 files changed

+212
-128
lines changed

serverless/index-serverless-general.asciidoc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,3 +32,5 @@ include::./pages/service-status.asciidoc[leveloffset=+2]
3232
include::./pages/user-profile.asciidoc[leveloffset=+2]
3333

3434
include::./pages/cloud-regions.asciidoc[leveloffset=+2]
35+
36+
include::./pages/ml-nlp-auto-scale.asciidoc[leveloffset=+2]
Lines changed: 210 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,210 @@
1+
[[general-ml-nlp-auto-scale]]
2+
= Trained model autoscaling
3+
4+
// :keywords: serverless
5+
6+
You can enable autoscaling for each of your trained model deployments.
7+
Autoscaling allows Elasticsearch to automatically adjust the resources the model deployment can use based on the workload demand.
8+
9+
There are two ways to enable autoscaling:
10+
11+
* through APIs by enabling adaptive allocations
12+
* in Kibana by enabling adaptive resources
13+
14+
15+
Trained model autoscaling is available for both serverless and Cloud deployments. In serverless deployments, processing power is managed differently across Search, Observability, and Security projects, which impacts their costs and resource limits.
16+
17+
Security and Observability projects are only charged for data ingestion and retention. They are not charged for processing power (VCU usage), which is used for more complex operations, like running advanced search models. For example, in Search projects, models such as ELSER require significant processing power to provide more accurate search results.
18+
19+
[discrete]
20+
[[enabling-autoscaling-through-apis-adaptive-allocations]]
21+
== Enabling autoscaling through APIs - adaptive allocations
22+
23+
Model allocations are independent units of work for NLP tasks.
24+
If you set a static number of allocations, they remain constant even when not all the available resources are fully used or when the load on the model requires more resources.
25+
Instead of setting the number of allocations manually, you can enable adaptive allocations to set the number of allocations based on the load on the process.
26+
This can help you to manage performance and cost more easily.
27+
(Refer to the https://cloud.elastic.co/pricing[pricing calculator] to learn more about the possible costs.)
28+
29+
When adaptive allocations are enabled, the number of allocations of the model is set automatically based on the current load.
30+
When the load is high, additional model allocations are automatically created as needed.
31+
When the load is low, a model allocation is automatically removed.
32+
You can explicitly set the minimum and maximum number of allocations; autoscaling will occur within these limits.
33+
34+
[NOTE]
35+
====
36+
If you set the minimum number of allocations to 1, you will be charged even if the system is not using those resources.
37+
====
38+
39+
You can enable adaptive allocations by using:
40+
41+
* the create inference endpoint API for https://www.elastic.co/guide/en/elasticsearch/reference/master/infer-service-elser.html[ELSER], https://www.elastic.co/guide/en/elasticsearch/reference/master/infer-service-elasticsearch.html[E5 and models uploaded through Eland] that are used as inference services.
42+
* the https://www.elastic.co/guide/en/elasticsearch/reference/master/start-trained-model-deployment.html[start trained model deployment] or https://www.elastic.co/guide/en/elasticsearch/reference/master/update-trained-model-deployment.html[update trained model deployment] APIs for trained models that are deployed on machine learning nodes.
43+
44+
If the new allocations fit on the current machine learning nodes, they are immediately started.
45+
If more resource capacity is needed for creating new model allocations, then your machine learning node will be scaled up if machine learning autoscaling is enabled to provide enough resources for the new allocation.
46+
The number of model allocations can be scaled down to 0.
47+
They cannot be scaled up to more than 32 allocations, unless you explicitly set the maximum number of allocations to more.
48+
Adaptive allocations must be set up independently for each deployment and https://www.elastic.co/guide/en/elasticsearch/reference/master/put-inference-api.html[inference endpoint].
49+
50+
When you create inference endpoints on Serverless using Kibana, adaptive allocations are automatically turned on, and there is no option to disable them.
51+
52+
[discrete]
53+
[[optimizing-for-typical-use-cases]]
54+
=== Optimizing for typical use cases
55+
56+
You can optimize your model deployment for typical use cases, such as search and ingest.
57+
When you optimize for ingest, the throughput will be higher, which increases the number of inference requests that can be performed in parallel.
58+
When you optimize for search, the latency will be lower during search processes.
59+
60+
* If you want to optimize for ingest, set the number of threads to `1` (`"threads_per_allocation": 1`).
61+
* If you want to optimize for search, set the number of threads to greater than `1`.
62+
Increasing the number of threads will make the search processes more performant.
63+
64+
[discrete]
65+
[[enabling-autoscaling-in-kibana-adaptive-resources]]
66+
== Enabling autoscaling in Kibana - adaptive resources
67+
68+
You can enable adaptive resources for your models when starting or updating the model deployment.
69+
Adaptive resources make it possible for Elasticsearch to scale up or down the available resources based on the load on the process.
70+
This can help you to manage performance and cost more easily.
71+
When adaptive resources are enabled, the number of VCUs that the model deployment uses is set automatically based on the current load.
72+
When the load is high, the number of VCUs that the process can use is automatically increased.
73+
When the load is low, the number of VCUs that the process can use is automatically decreased.
74+
75+
You can choose from three levels of resource usage for your trained model deployment; autoscaling will occur within the selected level's range.
76+
77+
Refer to the tables in the auto-scaling-matrix section to find out the setings for the level you selected.
78+
79+
image::images/ml-nlp-deployment.png[ML model deployment with adaptive resources enabled.]
80+
81+
Search projects are given access to more processing resources, while Security and Observability projects have lower limits. This difference is reflected in the UI configuration: Search projects have higher resource limits compared to Security and Observability projects to accommodate their more complex operations.
82+
83+
On Serverless, adaptive allocations are automatically enabled for all project types.
84+
However, the "Adaptive resources" control is not displayed in Kibana for Observability and Security projects.
85+
86+
[discrete]
87+
[[model-deployment-resource-matrix]]
88+
== Model deployment resource matrix
89+
90+
The used resources for trained model deployments depend on three factors:
91+
92+
* your cluster environment (Serverless, Cloud, or on-premises)
93+
* the use case you optimize the model deployment for (ingest or search)
94+
* whether model autoscaling is enabled with adaptive allocations/resources to have dynamic resources, or disabled for static resources
95+
96+
The following tables show you the number of allocations, threads, and VCUs available on Serverless when adaptive resources are enabled or disabled.
97+
98+
[discrete]
99+
[[deployments-on-serverless-optimized-for-ingest]]
100+
=== Deployments on serverless optimized for ingest
101+
102+
In case of ingest-optimized deployments, we maximize the number of model allocations.
103+
104+
[discrete]
105+
[[adaptive-resources-enabled]]
106+
=== Adaptive Resources Enabled
107+
108+
[discrete]
109+
[[ingest-optimized-deployments]]
110+
==== Ingest-Optimized Deployments
111+
112+
|===
113+
| Level | Allocations | Threads | VCUs
114+
115+
| Low
116+
| 0 to 2 dynamically
117+
| 1
118+
| 0 to 16 dynamically
119+
120+
| Medium
121+
| 1 to 32 dynamically
122+
| 1
123+
| 8 to 256 dynamically
124+
125+
| High
126+
a| * 1 to 512 for Search
127+
* 1 to 128 for Security and Observability
128+
| 1
129+
a| * 8 to 4096 for Search
130+
* 8 to 1024 for Security and Observability
131+
|===
132+
133+
[discrete]
134+
[[adaptive-resources-disabled-search-only]]
135+
==== Adaptive Resources Disabled (Search Only)
136+
137+
|===
138+
| Level | Allocations | Threads | VCUs
139+
140+
| Low
141+
| Exactly 2
142+
| 1
143+
| 16
144+
145+
| Medium
146+
| Exactly 32
147+
| 1
148+
| 256
149+
150+
| High
151+
a| * 512 for Search
152+
* No static allocations for Security and Observability
153+
| 1
154+
a| * 4096 for Search
155+
* No static allocations for Security and Observability |
156+
|===
157+
158+
[discrete]
159+
[[deployments-on-serverless-optimized-for-search]]
160+
=== Deployments on Serverless Optimized for Search
161+
162+
[discrete]
163+
[[adaptive-resources-enabled-for-search]]
164+
==== Adaptive Resources Enabled
165+
166+
|===
167+
| Level | Allocations | Threads | VCUs
168+
169+
| Low
170+
| 0 to 1 dynamically
171+
| Always 2
172+
| 0 to 16 dynamically
173+
174+
| Medium
175+
| 1 to 2 (if threads=16), dynamically
176+
| Maximum (e.g., 16)
177+
| 8 to 256 dynamically
178+
179+
| High
180+
a| * 1 to 32 (if threads=16), dynamically
181+
* 1 to 128 for Security and Observability
182+
| Maximum (e.g., 16)
183+
a| * 8 to 4096 for Search
184+
* 8 to 1024 for Security and Observability
185+
|===
186+
187+
[discrete]
188+
[[adaptive-resources-disabled-for-search]]
189+
==== Adaptive Resources Disabled
190+
191+
|===
192+
| Level | Allocations | Threads | VCUs
193+
194+
| Low
195+
| 1 statically
196+
| Always 2
197+
| 16
198+
199+
| Medium
200+
| 2 statically (if threads=16)
201+
| Maximum (e.g., 16)
202+
| 256
203+
204+
| High
205+
a| * 32 statically (if threads=16) for Search
206+
* No static allocations for Security and Observability
207+
| Maximum (e.g., 16)
208+
a| * 4096 for Search
209+
* No static allocations for Security and Observability
210+
|===

serverless/pages/ml-nlp-auto-scale.mdx

Lines changed: 0 additions & 128 deletions
This file was deleted.

0 commit comments

Comments
 (0)