Time-based scaling of Enterprise Search on Elastic Cloud

Does your Elastic Enterprise Search Cloud deployment follow a predictable usage pattern? You can automatically scale up and down your deployment on a schedule to achieve optimal performance and reduce operating costs. In this article we show you how to use the Elastic Cloud API to change how many Enterprise Search nodes you’re running. We call these APIs from a cron job to achieve hands-free, time-triggered autoscaling. And for a comprehensive scaling strategy, you can combine the time-based scaling technique presented here with Elastic Cloud's recently released autoscaling capabilities. With a few simple clicks in the Elastic Cloud UI, you can automatically scale your Elasticsearch and ML nodes as your data grows. The problem: Handling predictable traffic spikesSome of our users have predictable search spikes, like during business hours, or a spike between 9:00am and 10:00am on weekdays, or the second and fourth Friday of every month. During these times, they might need many more Enterprise Search and Elasticsearch nodes to handle the load.  Autoscaling algorithms typically rely on events such as high CPU, high memory, or disk consumption to increase a deployment to meet the increased demand. In the case of predictable, high spikes in traffic, so many visitors come online so suddenly that we cannot wait for a metric like high CPU before deploying new nodes. We need new nodes ready to take traffic at the start of the spike. Scaling Enterprise Search on Elastic CloudElastic Cloud offers a robust REST API to configure your deployments. Resizing an Enterprise Search deployment via API using curl follows this general pattern: export DEPLOYMENT_ID=bf4d13dcdc9340f5ac... # Your Cloud deployment ID from the Cloud Deployments page export ECE_API_KEY=VlU4MDFIY0JxVld3M... # Generate an API key under Cloud, Features, API Keys curl -k -X PUT -H "Authorization: ApiKey $ECE_API_KEY" https://cloud.elastic.co/api/v1/deployments/$DEPLOYMENT_ID -H 'content-type: application/json' -d '{ ... plan template changes payload ... }' To easily determine the plan changes payload, use the Elastic Cloud Deployments UI to prepare the changes you want to make to your cluster. In the Edit Deployment screen, change the number of nodes and size of each node:

Select the Equivalent API request link below the Save button to copy the corresponding JSON plan template:

The Elastic Cloud API does not offer a JSON attribute such as node_count or node_size to set the number of Enterprise Search nodes. Instead, the API accepts a value for the total memory of the Enterprise Search deployment. Each node has a fixed size, for example 8GB, configurable as a separate parameter in your Deployment plan. Elastic Cloud computes how many nodes you will require to meet your specified total memory. For example, here is a snippet of an Enterprise Search deployment plan being resized to 4 nodes. Each node is 8GB. "enterprise_search": [ { ...
"plan": { "cluster_topology": [ { ... "size": { "value": 32768,
https://www.elastic.co/blog/time-based-scaling-of-enterprise-search-on-elastic-cloud

Created 4y | Apr 1, 2021, 3:20:48 PM


Login to add comment