kubo / ruby-oci8

Ruby-oci8 - Oracle interface for ruby
Other
169 stars 75 forks source link

Question [Is ruby-oci8 support DRCP] #165

Closed coolflighter closed 3 years ago

coolflighter commented 7 years ago

Dear Kubo

Please do me a favor let me ask a question. There is a Ruby Program access DB with ruby-oci8 . The Ruby Program trigger hundreds of new connections very frequently , and the connections also stay long time on db(from a few minutes to around 1 hour). I want to know Is DRCP can alleviate the concurrency issue caused by frequent connections ? Oracle version is 11.2.0.3 . If ruby-oci8 support DRCP, Can you give me some advice about How to configure ruby-oci8 & DRCP ?

Thank you very much. menglong.zheng@oracle.com

kubo commented 7 years ago

As far as I checked, you can use DRCP by (1) enabling DRCP on server side and (2) connecting to the server by putting POOLED in a easy connect string or in a TNS connect descriptor. I don't know whether DRCP alleviates the issue. It depends on situations.

coolflighter commented 7 years ago

Dear Kubo

Thank you very much. 教えていただき、ありがとうございます。

cjbj commented 7 years ago

@kubo the app should also set a connection class name. Without a class you won't get full reuse of the DRCP pool. The 'Purity' also needs to be considered too. See:

https://github.com/php/php-src/blob/c8aa6f3a9a3d2c114d0c5e0c9fdd0a465dbb54a5/ext/oci8/oci8.c#L3189-L3208

kubo commented 7 years ago

@cjbj Thank you! I'll check it.