You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
title: Scale capacity for query and index workloads
2
+
title: Adjust capacity for query and index workloads
3
3
titleSuffix: Azure Cognitive Search
4
4
description: Adjust partition and replica computer resources in Azure Cognitive Search, where each resource is priced in billable search units.
5
5
@@ -8,68 +8,60 @@ author: HeidiSteen
8
8
ms.author: heidist
9
9
ms.service: cognitive-search
10
10
ms.topic: conceptual
11
-
ms.date: 11/04/2019
11
+
ms.date: 02/14/2020
12
12
---
13
13
14
-
# Scale up partitions and replicas to add capacity for query and index workloads in Azure Cognitive Search
14
+
# Adjust capacity in Azure Cognitive Search
15
15
16
-
After you [choose a pricing tier](search-sku-tier.md) and [provision a search service](search-create-service-portal.md), the next step is to optionally increase the number of replicas or partitions used by your service. Each tier offers a fixed number of billing units. This article explains how to allocate those units to achieve an optimal configuration that balances your requirements for query execution, indexing, and storage.
16
+
Before [provisioning a search service](search-create-service-portal.md) and locking in a specific pricing tier, take a few minutes to understand the role of replicas and partitions in a service, whether you need proportionally larger or faster partitions, and how you might configure the service for expected load.
17
17
18
-
Resource configuration is available when you set up a service at the [Basic tier](https://aka.ms/azuresearchbasic) or one of the [Standard or Storage Optimized tiers](search-limits-quotas-capacity.md). For services at these tiers, capacity is purchased in increments of *search units* (SUs) where each partition and replica counts as one SU.
19
-
20
-
Using fewer SUs results in a proportionally lower bill. Billing is in effect for as long as the service is set up. If you are temporarily not using a service, the only way to avoid billing is by deleting the service and then re-creating it when you need it.
21
-
22
-
> [!Note]
23
-
> Deleting a service deletes everything on it. There is no facility within Azure Cognitive Search for backing up and restoring persisted search data. To redeploy an existing index on a new service, you should run the program used to create and load it originally.
18
+
Capacity is a function of the [tier you choose](search-sku-tier.md) (tiers determine hardware characteristics), and the replica and partition combination necessary for projected workloads. This article focuses on replica and partition combinations and interactions.
24
19
25
20
## Terminology: replicas and partitions
26
-
Replicas and partitions are the primary resources that back a search service.
27
21
28
-
| Resource | Definition |
29
-
|----------|------------|
30
-
|*Partitions*| Provides index storage and I/O for read/write operations (for example, when rebuilding or refreshing an index).|
31
-
|*Replicas*| Instances of the search service, used primarily to load balance query operations. Each replica always hosts one copy of an index. If you have 12 replicas, you will have 12 copies of every index loaded on the service.|
22
+
|||
23
+
|-|-|
24
+
|*Partitions*| Provides index storage and I/O for read/write operations (for example, when rebuilding or refreshing an index). Each partition has a share of the total index. If you allocate three partitions, your index is divided into thirds. |
25
+
|*Replicas*| Instances of the search service, used primarily to load balance query operations. Each replica is one copy of an index. If you allocate three replicas, you'll have three copies of an index available for servicing query requests.|
32
26
33
-
> [!NOTE]
34
-
> There is no way to directly manipulate or manage which indexes run on a replica. One copy of each index on every replica is part of the service architecture.
35
-
>
27
+
## How to allocate replicas and partitions
36
28
29
+
Initially, a service is allocated a minimal level of resources consisting of one partition and one replica.
37
30
38
-
## How to allocate replicas and partitions
39
-
In Azure Cognitive Search, a service is initially allocated a minimal level of resources consisting of one partition and one replica. For tiers that support it, you can incrementally adjust computational resources by increasing partitions if you need more storage and I/O, or add more replicas for larger query volumes or better performance. A single service must have sufficient resources to handle all workloads (indexing and queries). You cannot subdivide workloads among multiple services.
31
+
A single service must have sufficient resources to handle all workloads (indexing and queries). Neither workload runs in the background. You can schedule indexing for times when query requests are naturally less frequent, but the service will not otherwise prioritize one task over another.
40
32
41
-
To increase or change the allocation of replicas and partitions, we recommend using the Azure portal. The portal enforces limits on allowable combinations that stay below maximum limits. If you require a script-based or code-based provisioning approach, the [Azure PowerShell](search-manage-powershell.md) or the [Management REST API](https://docs.microsoft.com/rest/api/searchmanagement/services) are alternative solutions.
33
+
When modifying the allocation of replicas and partitions, we recommend using the Azure portal. The portal enforces limits on allowable combinations that stay below maximum limits of a tier. However, if you require a script-based or code-based provisioning approach, the [Azure PowerShell](search-manage-powershell.md) or the [Management REST API](https://docs.microsoft.com/rest/api/searchmanagement/services) are alternative solutions.
42
34
43
-
Generally, search applications need more replicas than partitions, particularly when the service operations are biased toward query workloads. The section on [high availability](#HA) explains why.
35
+
As a general rule, search applications tend to need more replicas than partitions, particularly when the service operations are biased toward query workloads. The section on [high availability](#HA) explains why.
44
36
45
37
1. Sign in to the [Azure portal](https://portal.azure.com/) and select the search service.
46
38
47
-
2. In **Settings**, open the **Scale** page to modify replicas and partitions.
39
+
1. In **Settings**, open the **Scale** page to modify replicas and partitions.
48
40
49
41
The following screenshot shows a standard service provisioned with one replica and partition. The formula at the bottom indicates how many search units are being used (1). If the unit price was $100 (not a real price), the monthly cost of running this service would be $100 on average.
50
42
51
43

52
44
53
-
3. Use the slider to increase or decrease the number of partitions. The formula at the bottom indicates how many search units are being used.
45
+
1. Use the slider to increase or decrease the number of partitions. The formula at the bottom indicates how many search units are being used.
54
46
55
47
This example doubles capacity, with two replicas and partitions each. Notice the search unit count; it is now four because the billing formula is replicas multiplied by partitions (2 x 2). Doubling capacity more than doubles the cost of running the service. If the search unit cost was $100, the new monthly bill would now be $400.
56
48
57
49
For the current per unit costs of each tier, visit the [Pricing page](https://azure.microsoft.com/pricing/details/search/).
58
50
59
51

60
52
61
-
3. Click **Save** to confirm the changes.
53
+
1. Click **Save** to confirm the changes.
62
54
63
55

64
56
65
57
Changes in capacity take several hours to complete. You cannot cancel once the process has started and there is no real-time monitoring for replica and partition adjustments. However, the following message remains visible while changes are underway.
66
58
67
59

68
60
69
-
70
61
> [!NOTE]
71
-
> After a service is provisioned, it cannot be upgraded to a higher SKU. You must create a search service at the new tier and reload your indexes. See [Create an Azure Cognitive Search service in the portal](search-create-service-portal.md) for help with service provisioning.
62
+
> After a service is provisioned, it cannot be upgraded to a higher tier. You must create a search service at the new tier and reload your indexes. See [Create an Azure Cognitive Search service in the portal](search-create-service-portal.md) for help with service provisioning.
72
63
>
64
+
> Additionally, partitions and replicas are managed exclusively and internally by the service. There is no concept of processor affinity, or assigning a workload to a specific node.
73
65
>
74
66
75
67
<aid="chart"></a>
@@ -96,10 +88,10 @@ SUs, pricing, and capacity are explained in detail on the Azure website. For mor
96
88
> The number of replicas and partitions divides evenly into 12 (specifically, 1, 2, 3, 4, 6, 12). This is because Azure Cognitive Search pre-divides each index into 12 shards so that it can be spread in equal portions across all partitions. For example, if your service has three partitions and you create an index, each partition will contain four shards of the index. How Azure Cognitive Search shards an index is an implementation detail, subject to change in future releases. Although the number is 12 today, you shouldn't expect that number to always be 12 in the future.
97
89
>
98
90
99
-
100
91
<aid="HA"></a>
101
92
102
93
## High availability
94
+
103
95
Because it's easy and relatively fast to scale up, we generally recommend that you start with one partition and one or two replicas, and then scale up as query volumes build. Query workloads run primarily on replicas. If you need more throughput or high availability, you will probably require additional replicas.
104
96
105
97
General recommendations for high availability are:
@@ -112,31 +104,27 @@ Service level agreements (SLA) for Azure Cognitive Search are targeted at query
112
104
113
105
Basic tier tops out at one partition and three replicas. If you want the flexibility to immediately respond to fluctuations in demand for both indexing and query throughput, consider one of the Standard tiers. If you find your storage requirements are growing much more rapidly than your query throughput, consider one of the Storage Optimized tiers.
114
106
115
-
### Index availability during a rebuild
107
+
##Disaster recovery
116
108
117
-
High availability for Azure Cognitive Search pertains to queries and index updates that don't involve rebuilding an index. If you delete a field, change a data type, or rename a field, you will need to rebuild the index. To rebuild the index, you must delete the index, re-create the index, and reload the data.
109
+
Currently, there is no built-in mechanism for disaster recovery. Adding partitions or replicas would be the wrong strategy for meeting disaster recovery objectives. The most common approach is to add redundancy at the service level by setting up a second search service in another region. As with availability during an index rebuild, the redirection or failover logic must come from your code.
118
110
119
-
> [!NOTE]
120
-
> You can add new fields to an Azure Cognitive Search index without rebuilding the index. The value of the new field will be null for all documents already in the index.
111
+
## Estimate replicas
121
112
122
-
When rebuilding the index there will be a period of time when the data is being added to the new index. If you would like to continue to make your old index available during this time, you must have a copy of the old index with a different name on the same service, or a copy of the index with the same name on a different service, and then provide redirection or failover logic in your code.
113
+
On a production service, you should allocate three replicas for SLA purposes. If you experience slow query performance, one remedy is to add replicas so that additional copies of the index are brought online to support bigger query workloads and to load balance the requests over the multiple replicas.
123
114
124
-
## Disaster recovery
125
-
Currently, there is no built-in mechanism for disaster recovery. Adding partitions or replicas would be the wrong strategy for meeting disaster recovery objectives. The most common approach is to add redundancy at the service level by setting up a second search service in another region. As with availability during an index rebuild, the redirection or failover logic must come from your code.
115
+
We do not provide guidelines on how many replicas are needed to accommodate query loads. Query performance depends on the complexity of the query and competing workloads. Although adding replicas clearly results in better performance, the result is not strictly linear: adding three replicas does not guarantee triple throughput.
126
116
127
-
## Increase query performance with replicas
128
-
Query latency is an indicator that additional replicas are needed. Generally, a first step toward improving query performance is to add more of this resource. As you add replicas, additional copies of the index are brought online to support bigger query workloads and to load balance the requests over the multiple replicas.
117
+
For guidance in estimating QPS for your solution, see [Scale for performance](search-performance-optimization.md)and [Monitor queries](search-monitor-queries.md)
129
118
130
-
We cannot provide hard estimates on queries per second (QPS): query performance depends on the complexity of the query and competing workloads. Although adding replicas clearly results in better performance, the result is not strictly linear: adding three replicas does not guarantee triple throughput.
119
+
## Estimate partitions
131
120
132
-
For guidance in estimating QPS for your workloads, see [Azure Cognitive Search performance and optimization considerations](search-performance-optimization.md).
121
+
The [tier you choose](search-sku-tier.md) determines partition size and speed, and each tier is optimized around a set of characteristics that fit various scenarios. If you choose a higher-end tier, you might need fewer partitions than if you go with S1.
133
122
134
-
## Increase indexing performance with partitions
135
123
Search applications that require near real-time data refresh will need proportionally more partitions than replicas. Adding partitions spreads read/write operations across a larger number of compute resources. It also gives you more disk space for storing additional indexes and documents.
136
124
137
125
Larger indexes take longer to query. As such, you might find that every incremental increase in partitions requires a smaller but proportional increase in replicas. The complexity of your queries and query volume will factor into how quickly query execution is turned around.
138
126
139
-
140
127
## Next steps
141
128
142
-
[Choose a pricing tier for Azure Cognitive Search](search-sku-tier.md)
129
+
> [!div class="nextstepaction"]
130
+
> [Choose a pricing tier for Azure Cognitive Search](search-sku-tier.md)
0 commit comments