Pool settings
Connection count, concurrent query limit and query timeout.
Pool settings are stored in the database itself, so the same limits apply no matter who opens the file.
| Setting | Default | Enforced by |
|---|---|---|
max_connections | 64 | the server (nardbd): open sessions |
max_concurrent_queries | 16 | the engine: extra queries wait for a free slot |
query_timeout | 30 seconds (0 = no limit) | the engine: the query is cancelled when it runs out |
In embedded use only one process can open the database, so there is only one connection; max_connections is enforced by the server only.
Changing them#
In the shell:
>> set_pool -c 200 -q 8 -t 15
>> set_pool # opens a dialog filled with the current values
>> show_poolDatabase → Pool Settings... and File → Database Settings... open the same dialog. In the Go API:
err := db.SetPool(nardb.Pool{MaxConnections: 200, MaxConcurrentQueries: 8, QueryTimeoutSeconds: 15})The new query limit applies immediately; waiting queries wake up under the new limit.
Limits#
| Setting | Range |
|---|---|
max_connections | 1 – 10000 |
max_concurrent_queries | 1 – 10000 |
query_timeout | 0 – 86400 seconds |
The timeout includes the time a query spends waiting for a slot. A query that waits too long at a busy moment returns context deadline exceeded.