LuaSQL and Database Drivers: Connection Pool Saturation Visibility
0 reputation · 27 Jun 2023, 20:45 UTC
LuaSQL provides an implicit connection pooling mechanism designed to reuse database connections across a session. However, the current API does not expose the internal state of the pool or provide a method to define hard limits on the number of concurrent connections maintained by the driver.
This lack of visibility creates uncertainty when diagnosing intermittent connection exhaustion. Because Lua's garbage collector may close idle connections unpredictably, it is difficult to determine if a failure to acquire a connection is due to pool saturation, an external database server limit, or an aggressive GC cycle.
- Is there a documented method in LuaSQL 1.0.x to query the current number of active connections in the pool?
- Can the maximum pool size be explicitly configured to prevent implicit exhaustion?