Query Configuration
This page explains how to configure and scale query processing components in kdb Insights Enterpriseto optimize performance and resource utilization.
The kdb Insights Enterprisedatabase uses Data Access Processes (DAPs) to serve data for queries. DAPs are split into tiers based on the age of the data. Tiers are typically split into a real-time database (RDB), an intra-day database (IDB), and a historical database (HDB). DAPs are configured under a daps
key of the shard file within a package. The data of a given tier is maintained by the mount or mounts for that tier. Different scaling configurations are possible depending on how many tiers are provided to a DAP.
Tip
DAPs are accessed using the routing layer. Routing configuration is set at install time across all packages.
Tip
This guide discusses configuration using YAML files. You can also configure your system using the Web Interface
Configuration
Configuration for the Data Access Process is nested under a daps
key within the shard file.
YAML
# Other fields ...
daps:
instances:
da:
mountList: [rdb, idb, hdb]
name |
type |
required |
description |
---|---|---|---|
mountName |
string |
No |
References the name of the mount this DAP uses to surface data.
Either
Providing |
mountList |
string[] |
No |
References a set of mounts this DAP uses to surface data.
Either
Providing |
pctMemThreshold |
float |
No |
This threshold limits the amount of memory that is used before the DAP triggers a cache flush.
This value is a decimal value between 0 and 1, and is multiplied by the memory limit of the DAP (which is determined, in order of priority, from the
When this value is exceeded, the DAP enters low memory mode until the next writedown interval completes. See best practices. |
Scaling configurations
DAPs can be configured in two different modes depending on the anticipated query requirements. DAPs can either be configured to scale independently per data tier, or uniformly across all data tiers.
Scaling independently
Scaling independently means that you can have more RDBs than IDBs or HDBs, or vice versa. This allows you to tailor your setup to match the anticipated query distribution across the data tiers to maximize query throughput. Scaling independently means that each tier will consume its own set of resources and will run its own container. To use this mode, configure your DAP with the mountName
configuration option.
YAML
daps:
instances:
rdb:
mountName: rdb
idb:
mountName: idb
hdb:
mountName: hdb
Scaling Uniformly
To share container resources, you can scale your DAPs uniformly in a single container. This mode is typically referred to as single DAP mode. In this mode, RDBs, IDBs and HDBs are all within a single container.
In this mode, adding another instance adds another copy of all configured tiers. To use this mode, configure your DAP with the mountList configuration option.
YAML
daps:
instances:
db:
mountList: [rdb, idb, hdb]
Environment variables
Advanced configuration can be supplied to a DAP using environment variables. Environment variables are configured differently depending on the method of deployment. In all cases, the variables are always string values.
Package
User Interface
In a package, environment variables have to be set for the daps.instances.<name>
element. Environment variables are supplied under the env
as a list of objects where each is a pair of name
and value
.
YAML
daps:
instances:
da:
env:
- name: KXI_NAME
value: "da"
name |
description |
---|---|
|
Process name. |
|
Service class for data access (for example, RDB, IDB, HDB). Must match value in |
|
Assembly YAML file (for internal use only). |
|
Port. |
|
File containing custom code to load in DA processes. |
|
Whether this DAP is a query environment (default: |
|
Maximum number of rows, per partitioned table, to store in memory. |
|
Comma-delimited list of query environment APIs to allow in non-query-environment DAPs (e.g. |
|
Time in seconds between DAPs of the same class reloading after an EOX (default: |
|
Whether to use KX Reaper and object storage cache (default: |
|
Time in milliseconds to run the heartbeat to connected processes (default: |
|
Number of heartbeat intervals a process can miss before being disconnected (default: |
|
Frequency in milliseconds to run garbage collect in a timer (default: |
|
Set to "true" to enable async flush on messages from DA to Agg (default |
|
If "true", RT |
|
A URL address for an explicit Resource Coordinator for this specific DAP instance to connect to. This must be a fully qualified host name and port. If not specified, the DAP will fallback to Kubernetes label discovery. |
|
Set to path relative to the root of the bucket to use an inventory file. |
|
If "true", DAP runs with late data mode on. Takes precedence over |
|
Number of connection retry attempts to perform before restarting the process. (default: |
|
If set and |
|
If set and neither |
In addition, the following environment variables apply to both the sidecar and DAP images.
name |
container |
description |
---|---|---|
|
sidecar |
Metrics configuration file. |
|
ALL |
|
|
ALL |
|
|
ALL |
|
|
ALL |
Alternative logging configuration: replaces |
In kdb Insights Enterprise, variables can be supplied in the web interface under the advanced query settings option.
name |
description |
---|---|
|
Process name. |
|
Service class for data access (e.g. RDB, IDB, HDB). Must match value in |
|
Assembly YAML file (for internal use only). |
|
Port. |
|
File containing custom code to load in DA processes. |
|
Whether this DAP is a query environment (default: |
|
Maximum number of rows, per partitioned table, to store in memory. |
|
Comma-delimited list of query environment APIs to allow in non-query-environment DAPs (e.g. |
|
Time in seconds between DAPs of the same class reloading after an EOX (default: |
|
Whether to use KX Reaper and object storage cache (default: |
|
Time in milliseconds to run the heartbeat to connected processes (default: |
|
Number of heartbeat intervals a process can miss before being disconnected (default: |
|
Frequency in milliseconds to run garbage collect in a timer (default: |
|
Set to "true" to enable async flush on messages from DA to Agg (default |
|
If "true", RT |
|
A URL address for an explicit Resource Coordinator for this specific DAP instance to connect to. This must be a fully qualified host name and port. If not specified, the DAP will fallback to Kubernetes label discovery. |
|
Set to path relative to the root of the bucket to use an inventory file. |
|
If "true", DAP will run with late data mode on. Takes precedence over |
|
Number of connection retry attempts to perform before restarting the process. (default: |
|
If set and |
|
If set and neither |
In addition, the following environment variables apply to both the sidecar and DAP images.
name |
container |
description |
---|---|---|
|
sidecar |
Metrics configuration file. |
|
ALL |
|
|
ALL |
|
|
ALL |
|
|
ALL |
Alternative logging configuration: replaces |
Query size limitations
IPC queries routing through the Service Gateway using the SQL, getData
or user defined analytics (UDAs) have no limitations on size when using version 6 of the q IPC Protocol.
In the response path, queries are streamed through the Gateway when the response size exceeds KXI_SG_STREAM_THRESHOLD
bytes.
For RESTful queries, responses are not streamed to the client, the results will be uncompressed, and limited to 2Gb.