Skip to content
NarDBv0.2.0-dev

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.

SettingDefaultEnforced by
max_connections64the server (nardbd): open sessions
max_concurrent_queries16the engine: extra queries wait for a free slot
query_timeout30 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:

Terminal
>> set_pool -c 200 -q 8 -t 15
>> set_pool                    # opens a dialog filled with the current values
>> show_pool

Database → Pool Settings... and File → Database Settings... open the same dialog. In the Go API:

Go
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#

SettingRange
max_connections1 – 10000
max_concurrent_queries1 – 10000
query_timeout0 – 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.