Table of Contents

Property MinPoolSize

Namespace
YndigoBlue.Velocity.Data
Assembly
YndigoBlue.Velocity.dll

MinPoolSize

Gets or sets the minimum number of connections in the connection pool.

public int MinPoolSize { get; set; }

Property Value

int

Remarks

This setting controls how many database connections are kept open and ready in the pool at all times, even if not currently in use. The default value of 0 means no connections are pre-opened; connections are created on-demand.

MinPoolSize Trade-offs:

  • Memory Cost: Each open connection consumes memory on both client and server. Setting MinPoolSize to 20 means 20 connections are always open, consuming memory even during idle periods. On resource-constrained systems, this can be significant.
  • Startup Latency Improvement: When your application starts and performs its first database operation, it must create a connection (which involves network latency, authentication, initialization). With MinPoolSize = 0, this happens on the first operation. With MinPoolSize > 0, pre-opened connections are ready immediately, reducing first-operation latency.
  • Connection Warm-up: Keeping connections open ensures they are "warm" and cached by the network stack and database, improving subsequent operation performance.
  • Typical Setting: For web applications with frequent requests, setting MinPoolSize = 5-10 ensures connections are ready without excessive memory waste. For batch applications that operate intermittently, MinPoolSize = 0 is appropriate.

Constraint: MinPoolSize must be less than or equal to MaxPoolSize. Values are enforced when the connection pool is initialized.