]> git.ipfire.org Git - thirdparty/asterisk.git/commit
res_odbc: cache_type option for res_odbc.
authorJaco Kroon <jaco@uls.co.za>
Tue, 10 Dec 2024 20:36:02 +0000 (22:36 +0200)
committerGeorge Joseph <gjoseph@sangoma.com>
Thu, 26 Jun 2025 18:10:20 +0000 (12:10 -0600)
commit11aa03a859efbcac0e1f8ff49f285fee8964ce97
tree2f43ac6bf5a4f078f397b62bc3141a46e347323b
parent16f6b2ba67d64baf841c9f5c284cca54f3debeab
res_odbc: cache_type option for res_odbc.

This enables setting cache_type classes to a round-robin queueing system
rather than the historic stack mechanism.

This should result in lower risk of connection drops due to shorter idle
times (the first connection to go onto the stack could in theory never
be used again, ever, but sit there consuming resources, there could be
multiple of these).

And with a queue rather than a stack, dead connections are guaranteed to
be detected and purged eventually.

This should end up better balancing connection_cnt with actual load
over time, assuming the database doesn't keep connections open
excessively long from it's side.

Signed-off-by: Jaco Kroon <jaco@uls.co.za>
UserNote: When using res_odbc it should be noted that back-end
connections to the underlying database can now be configured to re-use
the cached connections in a round-robin manner rather than repeatedly
re-using the same connection.  This helps to keep connections alive, and
to purge dead connections from the system, thus more dynamically
adjusting to actual load.  The downside is that one could keep too many
connections active for a longer time resulting in resource also begin
consumed on the database side.

(cherry picked from commit c684603d72944a6a4c86f1e69f7dca58087b808c)
configs/samples/res_odbc.conf.sample
res/res_odbc.c