Skip to content
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Some use cases might not scale effectively. Redis experts can help determine if

## Prerequisites

Redis Query Engine requires a cluster running Redis Software version 7.4.2-54 or later.
Redis Query Engine requires a cluster running Redis Software version 7.4.2-54 or later. For the simplified configuration experience (no shard restart required, new UI, and new REST API), Redis Software version 8.x or later is required.

If you do not have a cluster that supports Redis Query Engine, [install Redis Software]({{<relref "/operate/rs/installing-upgrading/install/install-on-linux">}}) version 7.4.2-54 or later on a new cluster, or [upgrade an existing cluster]({{<relref "/operate/rs/installing-upgrading/upgrading/upgrade-cluster">}}).

Expand Down Expand Up @@ -73,15 +73,39 @@ The following table shows the number of CPUs required for each performance facto
| Scale factor | 4x |
| Minimum CPUs required for scale factor - WORKERS | 6 |

## Configure query performance factor manually
## Configure query performance factor in the Cluster Manager UI

To manually configure the query performance factor in Redis Software:
### Redis Software 8.x and later {#config-db-ui-v8}

1. [Configure query performance factor parameters](#config-db-ui) when you create a new database or edit an existing database's configuration in the Cluster Manager UI.
Starting with Redis Software 8.x, configuring the query performance factor is simplified. You can select the query performance factor directly from the Cluster Manager UI without manually setting connection routing, connection limits, or module parameters. Changes to the query performance factor for existing databases take effect immediately without restarting shards.

To configure the query performance factor:

1. In the Cluster Manager UI, [create a new database]({{<relref "/operate/rs/databases/create">}}) or [edit an existing database]({{<relref "/operate/rs/databases/configure#edit-database-settings">}}).

1. In the **Capabilities** section, click **Add parameters**.

{{<image filename="images/rs/screenshots/databases/rs-qpf-add-parameters-v8.png" alt="The Create database screen with the Add parameters button in the Capabilities section.">}}

1. In the **Parameters** dialog, use the **Query performance factor** dropdown to select the performance factor value (Standard, 2x, 4x, 6x, 8x, 10x, 12x, 14x, or 16x).

{{<image filename="images/rs/screenshots/databases/rs-qpf-select-factor-v8.png" alt="The Parameters dialog with the Query performance factor dropdown showing available scaling options.">}}

1. Click **Done** to close the parameter editor.

1. Click **Create** or **Save**.

The new configuration applies automatically. No shard restart is required, even for existing databases.

### Prior to Redis Software 8 {#config-db-ui-prior}

To manually configure the query performance factor in Redis Software versions prior to 8.x:

1. [Configure query performance factor parameters](#config-db-ui-params) when you create a new database or edit an existing database's configuration in the Cluster Manager UI.

1. If you configure the query performance factor for an existing database, you also need to [restart shards](#restart-shards). Newly created databases can skip this step.

### Configure query performance factor parameters in the Cluster Manager UI {#config-db-ui}
#### Configure query performance factor parameters {#config-db-ui-params}

You can use the Cluster Manager UI to configure the query performance factor when you [create a new database]({{<relref "/operate/rs/databases/create">}}) or [edit an existing database]({{<relref "/operate/rs/databases/configure#edit-database-settings">}}) with search enabled.

Expand All @@ -107,7 +131,7 @@ You can use the Cluster Manager UI to configure the query performance factor whe

1. Click **Create** or **Save**.

### Restart shards {#restart-shards}
#### Restart shards {#restart-shards}

After you update the query performance factor for an existing database, restart all shards to apply the new settings. You can migrate shards to restart them. Newly created databases can skip this step.

Expand Down Expand Up @@ -156,9 +180,73 @@ After you update the query performance factor for an existing database, restart

## Configure query performance factor with the REST API

### Redis Software 8.x and later {#rest-api-v8}

Starting with Redis Software 8.x, you can configure the query performance factor using the [`query_performance_factor`]({{<relref "/operate/rs/references/rest-api/objects/bdb/query_performance_factor">}}) object in the [BDB object]({{<relref "/operate/rs/references/rest-api/objects/bdb">}}). You no longer need to manually set `sched_policy`, `conns`, or module `WORKERS` parameters. Changes take effect immediately without restarting shards.

#### Create a new database {#create-db-rest-api-v8}

To create a database with the query performance factor enabled, use the [create database REST API endpoint]({{<relref "/operate/rs/references/rest-api/requests/bdbs#post-bdbs-v1">}}) with the `query_performance_factor` field:

```json
{
"name": "scalable-search-db",
"type": "redis",
"memory_size": 10000000,
"port": 13000,
"authentication_redis_pass": "<your default db pwd>",
"proxy_policy": "all-master-shards",
"sharding": true,
"shards_count": 3,
"shards_placement": "sparse",
"shard_key_regex": [{"regex": ".*\\{(?<tag>.*)\\}.*"}, {"regex": "(?<tag>.*)"}],
"replication": false,
"module_list": [{
"module_name": "search",
"module_args": ""
}],
"query_performance_factor": {
"active": true,
"scaling_factor": 4
}
}
```

The following [cURL](https://curl.se/docs/) request creates a new database from the JSON example:

```sh
curl -k -u "<user>:<password>" https://<host>:9443/v1/bdbs -H "Content-Type:application/json" -d @scalable-search-db.json
```

#### Update an existing database {#update-db-rest-api-v8}

To configure the query performance factor for an existing database, use the [update database configuration]({{<relref "/operate/rs/references/rest-api/requests/bdbs#put-bdbs">}}) endpoint with the `query_performance_factor` field:

```sh
curl -k -u "<user>:<password>" -X PUT https://<host>:9443/v1/bdbs/<DB_ID> -H "Content-Type:application/json" -d '{
"query_performance_factor": {
"active": true,
"scaling_factor": 4
}
}'
```

No shard restart is required. The new configuration applies automatically.

#### Query performance factor object fields

| Field | Type/Value | Description |
|-------|------------|-------------|
| active | boolean (default:&nbsp;false) | If true, enables query performance factor for the database |
| scaling_factor | integer (range:&nbsp;0-16) (default:&nbsp;0) | Scales the magnitude of the query performance factor |

See the [`query_performance_factor` object reference]({{<relref "/operate/rs/references/rest-api/objects/bdb/query_performance_factor">}}) for more details.

### Prior to Redis Software 8 {#rest-api-prior}

You can configure the query performance factor when you [create a new database](#create-db-rest-api) or [update an existing database](#update-db-rest-api) using the Redis Software [REST API]({{<relref "/operate/rs/references/rest-api">}}).

### Create new database with the REST API {#create-db-rest-api}
#### Create new database with the REST API {#create-db-rest-api}

To create a database and configure the query performance factor, use the [create database REST API endpoint]({{<relref "/operate/rs/references/rest-api/requests/bdbs#post-bdbs-v1">}}) with a [BDB object]({{<relref "/operate/rs/references/rest-api/objects/bdb">}}) that includes the following parameters:

Expand All @@ -175,7 +263,7 @@ To create a database and configure the query performance factor, use the [create

See [Calculate performance factor](#calculate-query-performance-factor) to determine the value to use for `<NUMBER_OF_CPUS>`.

#### Example REST API request for a new database
##### Example REST API request for a new database

The following JSON is an example request body used to create a new database with a 4x query performance factor configured:

Expand Down Expand Up @@ -207,7 +295,7 @@ The following [cURL](https://curl.se/docs/) request creates a new database from
curl -k -u "<user>:<password>" https://<host>:9443/v1/bdbs -H "Content-Type:application/json" -d @scalable-search-db.json
```

### Update existing database with the REST API {#update-db-rest-api}
#### Update existing database with the REST API {#update-db-rest-api}

To configure the query performance factor for an existing database, use the following REST API requests:

Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading