./configure --with-oci8=$ORACLE_HOME --with-apxs2=/usr/sbin/apxs --with-config-file-path=/etc/httpd/conf --enable-sigchild --without-sqlite --without-mysql
compiled it and installed. Everything went fine, and on sample page I've displayed phpinfo():
I've changed php.ini to enable Database Resident Connection Pooling:
oci8.connection_class="TESTPOOL"and tested that it is used in PHP.
Then I've decided to test and compare performance of different methods of connection to Oracle from PHP. I've created simple PHP page, that connects to Oracle, execute simple query that returns one row, and inserts one row to another table. I've prepared test script for Apache JMeter against this page.
Test specification:
- Run on single processor machine
- Oracle and Apache+PHP run in VMware
- DRCP setup to have max 4 processes (3 processes effectively used, 4th for authentication only)
- 6 simultaneous users opening the same web page 200 times
-
4 versions of PHP script were used:
- oci_connect used to connect to Oracle without using DRCP (Database
Resident Connection Pooling)– in this case new connection is created for
every request from web browser. Connection is then closed at the end of
script
- oci_pconnect used to connect to Oracle without using DRCP – in this
case new connection is created for every apache process that is responding
to request from web browser. Connection is then closed at the end of
script
- oci_connect used to connect to Oracle with using DRCP (Database
Resident Connection Pooling)– in this case for every request connection is
obtained from pool and given back to pool at the end of script, seems that
in this case only process is reused (PURITY=NEW), while session is not (see my observations when using SQL*Plus )
- oci_pconnect used to connect to Oracle with using DRCP (Database Resident Connection Pooling)– in this case for every request connection is obtained from pool and given back to pool at the end of script. But in this case full potential of DRCP is used (PURITY=SELF)
Version | Description | # Requests | Average | Median | Standard Deviation | Throughput |
|
---|---|---|---|---|---|---|---|
1 | oci_connect without DRCP | 1200 | 989 | 875 | 828 | 359 |
|
2 | oci_pconnect without DRCP | 1200 | 123 | 94 | 187 | 2505 |
|
3 | oci_connect with DRCP | 1200 | 117 | 94 | 115 | 2907 |
|
4 | oci_pconnect with DRCP | 1200 | 82 | 78 | 30 | 4060 |
|
I must say that I'm positively impressed by performance achieved by version 3 where oci_pconnect with DRCP was used. I expected that performance for version 2,3,4 will be very similar. But I've observed 60% increase in Throughput and 33% shorter response times when comparing version 2 and 4 (oci_pconnect with and without DRCP). I've changed one setting for my test in JMeter: I've turned on Keep-Alive for http transfer and here are the results:
Version | Description | # Requests | Average | Median | Standard Deviation | Throughput |
|
---|---|---|---|---|---|---|---|
1 | oci_connect without DRCP |
|
|
|
|
|
Not tested |
2 | oci_pconnect without DRCP | 1200 | 84 | 63 | 116 | 4077 |
|
3 | oci_connect with DRCP | 1200 | 104 | 94 | 45 | 3265 |
|
4 | oci_pconnect with DRCP | 1200 | 78 | 78 | 23 | 4396 |
|
- oci_pconnect with DRCP works stable in both cases (with and without Keep-Alive) giving maximun throughput and very low standard deviation,
- oci_pconnect with DRCP has high standard deviation what means that there are lot of request with response time much higher then average,
- In both cases connecting to Oracle with use of DRCP performed better than without.
Cheers, Paweł
7 comments:
Pawel,
Interesting test. It might be biased by VMware (I recall that I sometimes had nasty overhead during process fork with VMware but I don't have exact details).
I'm looking forward for your next post on that topic. I'm particularly interested in that as DRCP is one of topics I cover during my RAC connection management presentation.
Cheers,
Alex
Hi Alex,
I've tried to get rid of VMware influences. Before every measured test I've run it once (or) to stabilize environment. And results are repeatable (of course with small deviation).
I hope I've managed to minimize VMware impact on test results.
Of course it would be good to test it on real machine, but I do not have one at this moment.
Pawel
Hi Pawel,
A couple of things:
1. The setup that you had with DRCP disabled was it DEDICATED or SHARED server setup?
2. You know that you don't need to recompile ALL of PHP to get oci8 to work.
Hi Gena,
1. it was using DEDICATED server.
2. it was easier for me to recompile full PHP.
Hi Pawel,
Would it be too much of a request to try it with SHARED server setup? Would DRCP enabled matter if you have SHARED setup?
Thank you,
Gena01
Hi Gena,
What exactly you are interested in? DRCP cannot work as Shared Server. You want to have comparison between Shared Server and DRCP?
I have not much time this week, but I'll try to test soon.
Hi Gena,
You will find answer to your question in my last post
Post a Comment