On 5/3/2022 3:44 am, Andrei A. Voropaev via dbi-users wrote:
Hello,

after looking at the sources of DBD::Oracle I am somewhat confused. OCI
offers Session pooling and Connection pooling. "DRCP" is abbreviation
for "connection pooling", but DBD::Oracle offers "session pooling",
which is not exactly the same.

Connected to this is the question about "connection class"
(ora_drcp_class). This parameter is necessary for "connection pooling",
but I couldn't find anything about it in the documentation for "session 
pooling".
Can someone please clarify this? So far it appears, that this parameter
is simply ignored in "session pooling".

Thank you.

I'll give some background, some of which you may know.

For Oracle applications, Oracle Call Interface (OCI) Connection pooling is mostly superseded by OCI Session pooling.  For various reasons to do with searchability & user name expectations, we tend to generically refer to 'connection pools' in applications even if at the OCI level the underlying Session Pool API is used. As well as giving great app scalability, the Session Pool supports all the goodies of Oracle's "Continuous Availability" features.

DRCP is a different pool of 'server' processes that resides on the database host.  These processes are the database end of application connections.  DRCP is great if the database host is short of memory but it's not a solution for every connection problem.  Check the doc for when it should be used: https://www.oracle.com/pls/topic/lookup?ctx=dblatest&id=GUID-015CA8C1-2386-4626-855D-CC546DDC1086

Both DRCP and OCI Session pools support the concept of a connection class name.  This allows some isolation of session memory if pools are shared between distinct use cases.  Commonly session pools are not shared, so connection class isn't set for them.  Setting the class name is more (very) important for DRCP since it directly affects performance (as well as giving the security separation).

Although DRCP can be used for any application connection, it is more efficient if it is used in conjunction with OCI Session Pooling (or JDBC equivalent). I was going to write more, but I recently put out a blog which mentions DRCP and has a diagram: "Always Use Connection Pools - and How" https://blogs.oracle.com/opal/post/always-use-connection-pools There is also further background in miscellaneous doc like https://oracle.github.io/node-oracledb/doc/api.html#drcp and https://www.oracle.com/technetwork/topics/php/whatsnew/php-scalability-ha-twp-128842.pdf My colleague is currently working on an updated DRCP technical brief; follow the above blog to be notified when it is published.

I can't comment on the DBD::Oracle specifics too much, however there is a reference in the doc to session pooling here: https://metacpan.org/pod/DBD::Oracle#ora_envhp  From tracing OCI, when you set ora_drcp then an OCI Session pool is created.  This is nice.  I couldn't quickly see if it is efficiently used like a full application pool, but the exposed settings would imply it is.   For example settings like ora_drcp_min seem related to sizing of the session pool (which is in the Perl process), not to the DRCP pool (which is in the Database tier).  Sizing of the DRCP pool is done via PL/SQL when the pool is created.

Overall, it looks like DBD::Oracle has DRCP+Session Pooling, or no pooling at 
all.

Chris

--
https://twitter.com/ghrd

Reply via email to