Overview
SQL Query Stress uses JSON configuration files to define load test parameters. These files contain all settings including connection information, query text, thread counts, and statistics collection options.Generating a Sample File
To generate a sample configuration file with all available options:sample.json in the current directory.
Root Configuration Object
The configuration file is a JSON object implementing theQueryStressSettings class with the following properties:
Query Settings
The SQL query to execute during the load test.Default:
"" (empty string)Example:SQL query to retrieve parameter values for the main query. Results from this query populate parameterized queries.Default:
"" (empty string)Example:Dictionary mapping SQL parameter names to column names from the
ParamQuery result set.Default: {} (empty object)Example:Load Test Settings
Number of concurrent threads to execute the query.Default:
1Range: 1-1000+Example:Number of times each thread executes the query.Default:
1Example:Delay in milliseconds between query executions within each thread.Default:
0 (no delay)Example:Connection Settings
Connection timeout in seconds. Value of 0 defaults to 15 seconds.Default:
15Example:Query execution timeout in seconds. Value of 0 means no timeout.Default:
0 (no timeout)Example:Enable ADO.NET connection pooling.Default:
trueExample:Statistics Settings
Enable collection of I/O statistics (logical reads). Sets
SET STATISTICS IO ON.Default: trueExample:Enable collection of CPU and elapsed time statistics. Sets
SET STATISTICS TIME ON.Default: trueExample:Execution Options
Force the client to retrieve and read all data from result sets. If false, only executes the query without reading results.Default:
falseExample:Cancel active SQL commands immediately when the test is stopped (do not wait for completion).Default:
trueExample:Database Connection Objects
Connection information for the database where the main query executes. This object implements the
ConnectionInfo class.See Connection Info Properties below.Connection information for the database where the parameter query executes. Only needed if using parameterized queries.See Connection Info Properties below.
If true, use
MainDbConnectionInfo settings for parameter queries instead of ParamDbConnectionInfo.Default: trueExample:Connection Info Properties
BothMainDbConnectionInfo and ParamDbConnectionInfo use the following structure:
SQL Server instance name or address.Default:
"(local)"Examples:"localhost"".\\SQLEXPRESS""myserver.database.windows.net"
Database name to connect to.Default:
"" (empty string, uses default database)Example:Use Windows integrated authentication instead of SQL Server authentication.Default:
trueExample:Use Azure Active Directory interactive authentication (MFA).Default:
falseExample:SQL Server login username. Required when
IntegratedAuth is false and AzureMFA is false.Default: "" (empty string)Example:SQL Server login password. Required when
IntegratedAuth is false and AzureMFA is false.Default: "" (empty string)Example:Connection timeout in seconds. Value of 0 uses the root
ConnectionTimeout setting.Default: 0Example:Enable connection pooling for this connection.Default:
trueExample:Maximum connection pool size. Value of 0 uses ADO.NET default (100). SQL Query Stress automatically sets
MinPoolSize equal to MaxPoolSize.Default: 0Example:Application intent for the connection.Values:
0= ReadWrite (default)1= ReadOnly
0Example:Connection encryption setting.Values:
"Optional"(default)"Mandatory""Strict"
"Optional"Example:Whether to trust the server certificate without validation.Default:
falseExample:Additional connection string parameters to append.Default:
"" (empty string)Example:Complete Example
Here is a complete, valid configuration file fromsample.json:
Configuration with Parameters
Example configuration using parameterized queries:Related
- CLI Command Reference - Command-line options to override settings
- Statistics Reference - Understanding collected metrics