I'm developing API for product based on Oracle database and I tried to use ruby-oci8 gem, but I faced a strange problem - OCI8.new is very slow, it takes 1,2-1,5 second to connect to database.
For example:
~ mmulev$ irb
2.1.1 :001 > require 'oci8'
=> true
2.1.1 :002 > def test
2.1.1 :003?> t0 = Time.now
2.1.1 :004?> OCI8.new('SCHEMA', 'STRONG_PASS', '//db_host:port/service_name')
2.1.1 :005?> Time.now - t0
2.1.1 :006?> end
=> :test
2.1.1 :007 > test
=> 1.217809
2.1.1 :008 >
The same thing in php (oci_new_connect) needs approximately 0,1-0,2 second to establish connection and return handler.
Is there any other solutions besides connection pooling?
P.S. ruby API code was profiled by method_profiler and by Benchmark, oracle v - 11g